Get rid of uneeded extern, enum, typedef and struct qualifiers.
Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
diff --git a/vm/compiler/codegen/CompilerCodegen.h b/vm/compiler/codegen/CompilerCodegen.h
index 8223d2a..2e3b107 100644
--- a/vm/compiler/codegen/CompilerCodegen.h
+++ b/vm/compiler/codegen/CompilerCodegen.h
@@ -19,10 +19,6 @@
#include "compiler/CompilerIR.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* Maximal number of switch cases to have inline chains */
#define MAX_CHAINED_SWITCH_CASES 64
@@ -39,7 +35,7 @@
void dvmCompilerAssembleLIR(CompilationUnit *cUnit, JitTranslationInfo *info);
/* Perform translation chain operation. */
-void* dvmJitChain(void* tgtAddr, u4* branchAddr);
+extern "C" void* dvmJitChain(void* tgtAddr, u4* branchAddr);
/* Install class objects in the literal pool */
void dvmJitInstallClassObjectPointers(CompilationUnit *cUnit,
@@ -75,8 +71,4 @@
/* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */
void dvmCompilerGenMemBarrier(CompilationUnit *cUnit, int barrierKind);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _DALVIK_VM_COMPILERCODEGEN_H_ */
diff --git a/vm/compiler/codegen/Optimizer.h b/vm/compiler/codegen/Optimizer.h
index 2b05476..dd8e788 100644
--- a/vm/compiler/codegen/Optimizer.h
+++ b/vm/compiler/codegen/Optimizer.h
@@ -23,14 +23,14 @@
* If the corresponding bit is set in gDvmJit.disableOpt, the selected
* optimization will be suppressed.
*/
-typedef enum optControlVector {
+enum optControlVector {
kLoadStoreElimination = 0,
kLoadHoisting,
kTrackLiveTemps,
kSuppressLoads,
kMethodInlining,
kMethodJit,
-} optControlVector;
+};
/* Forward declarations */
struct CompilationUnit;
diff --git a/vm/compiler/codegen/arm/CalloutHelper.h b/vm/compiler/codegen/arm/CalloutHelper.h
index 3bfb299..2660108 100644
--- a/vm/compiler/codegen/arm/CalloutHelper.h
+++ b/vm/compiler/codegen/arm/CalloutHelper.h
@@ -19,10 +19,6 @@
#ifndef _DALVIK_VM_COMPILER_CODEGEN_ARM_CALLOUT_HELPER_H
#define _DALVIK_VM_COMPILER_CODEGEN_ARM_CALLOUT_HELPER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*
* Declare/comment prototypes of all native callout functions invoked by the
* JIT'ed code here and use the LOAD_FUNC_ADDR macro to load the address into
@@ -35,37 +31,37 @@
#define LOAD_FUNC_ADDR(cUnit, reg, addr) loadConstant(cUnit, reg, addr)
/* Conversions */
-float __aeabi_i2f(int op1); // OP_INT_TO_FLOAT
-int __aeabi_f2iz(float op1); // OP_FLOAT_TO_INT
-float __aeabi_d2f(double op1); // OP_DOUBLE_TO_FLOAT
-double __aeabi_f2d(float op1); // OP_FLOAT_TO_DOUBLE
-double __aeabi_i2d(int op1); // OP_INT_TO_DOUBLE
-int __aeabi_d2iz(double op1); // OP_DOUBLE_TO_INT
-float __aeabi_l2f(long op1); // OP_LONG_TO_FLOAT
-double __aeabi_l2d(long op1); // OP_LONG_TO_DOUBLE
+extern "C" float __aeabi_i2f(int op1); // OP_INT_TO_FLOAT
+extern "C" int __aeabi_f2iz(float op1); // OP_FLOAT_TO_INT
+extern "C" float __aeabi_d2f(double op1); // OP_DOUBLE_TO_FLOAT
+extern "C" double __aeabi_f2d(float op1); // OP_FLOAT_TO_DOUBLE
+extern "C" double __aeabi_i2d(int op1); // OP_INT_TO_DOUBLE
+extern "C" int __aeabi_d2iz(double op1); // OP_DOUBLE_TO_INT
+extern "C" float __aeabi_l2f(long op1); // OP_LONG_TO_FLOAT
+extern "C" double __aeabi_l2d(long op1); // OP_LONG_TO_DOUBLE
s8 dvmJitf2l(float op1); // OP_FLOAT_TO_LONG
s8 dvmJitd2l(double op1); // OP_DOUBLE_TO_LONG
/* Single-precision FP arithmetics */
-float __aeabi_fadd(float a, float b); // OP_ADD_FLOAT[_2ADDR]
-float __aeabi_fsub(float a, float b); // OP_SUB_FLOAT[_2ADDR]
-float __aeabi_fdiv(float a, float b); // OP_DIV_FLOAT[_2ADDR]
-float __aeabi_fmul(float a, float b); // OP_MUL_FLOAT[_2ADDR]
-float fmodf(float a, float b); // OP_REM_FLOAT[_2ADDR]
+extern "C" float __aeabi_fadd(float a, float b); // OP_ADD_FLOAT[_2ADDR]
+extern "C" float __aeabi_fsub(float a, float b); // OP_SUB_FLOAT[_2ADDR]
+extern "C" float __aeabi_fdiv(float a, float b); // OP_DIV_FLOAT[_2ADDR]
+extern "C" float __aeabi_fmul(float a, float b); // OP_MUL_FLOAT[_2ADDR]
+extern "C" float fmodf(float a, float b); // OP_REM_FLOAT[_2ADDR]
/* Double-precision FP arithmetics */
-double __aeabi_dadd(double a, double b); // OP_ADD_DOUBLE[_2ADDR]
-double __aeabi_dsub(double a, double b); // OP_SUB_DOUBLE[_2ADDR]
-double __aeabi_ddiv(double a, double b); // OP_DIV_DOUBLE[_2ADDR]
-double __aeabi_dmul(double a, double b); // OP_MUL_DOUBLE[_2ADDR]
-double fmod(double a, double b); // OP_REM_DOUBLE[_2ADDR]
+extern "C" double __aeabi_dadd(double a, double b); // OP_ADD_DOUBLE[_2ADDR]
+extern "C" double __aeabi_dsub(double a, double b); // OP_SUB_DOUBLE[_2ADDR]
+extern "C" double __aeabi_ddiv(double a, double b); // OP_DIV_DOUBLE[_2ADDR]
+extern "C" double __aeabi_dmul(double a, double b); // OP_MUL_DOUBLE[_2ADDR]
+extern "C" double fmod(double a, double b); // OP_REM_DOUBLE[_2ADDR]
/* Integer arithmetics */
-int __aeabi_idivmod(int op1, int op2); // OP_REM_INT[_2ADDR|_LIT8|_LIT16]
-int __aeabi_idiv(int op1, int op2); // OP_DIV_INT[_2ADDR|_LIT8|_LIT16]
+extern "C" int __aeabi_idivmod(int op1, int op2); // OP_REM_INT[_2ADDR|_LIT8|_LIT16]
+extern "C" int __aeabi_idiv(int op1, int op2); // OP_DIV_INT[_2ADDR|_LIT8|_LIT16]
/* Long long arithmetics - OP_REM_LONG[_2ADDR] & OP_DIV_LONG[_2ADDR] */
-long long __aeabi_ldivmod(long long op1, long long op2);
+extern "C" long long __aeabi_ldivmod(long long op1, long long op2);
/* Originally declared in Sync.h */
bool dvmUnlockObject(struct Thread* self, struct Object* obj); //OP_MONITOR_EXIT
@@ -114,7 +110,7 @@
* Functions declared in gDvmInlineOpsTable[] are used for
* OP_EXECUTE_INLINE & OP_EXECUTE_INLINE_RANGE.
*/
-double sqrt(double x); // INLINE_MATH_SQRT
+extern "C" double sqrt(double x); // INLINE_MATH_SQRT
/*
* The following functions are invoked through the compiler templates (declared
@@ -125,8 +121,4 @@
* dvmLockObject // MONITOR_ENTER
*/
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_CALLOUT_HELPER_H */
diff --git a/vm/compiler/codegen/arm/Codegen.h b/vm/compiler/codegen/arm/Codegen.h
index afeb340..e67f3d8 100644
--- a/vm/compiler/codegen/arm/Codegen.h
+++ b/vm/compiler/codegen/arm/Codegen.h
@@ -25,10 +25,6 @@
#include "compiler/CompilerIR.h"
#include "CalloutHelper.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#if defined(_CODEGEN_C)
/*
* loadConstant() sometimes needs to add a small imm to a pre-existing constant
@@ -60,14 +56,10 @@
#if defined(WITH_SELF_VERIFICATION)
/* Self Verification memory instruction decoder */
-void dvmSelfVerificationMemOpDecode(int lr, int* sp);
+extern "C" void dvmSelfVerificationMemOpDecode(int lr, int* sp);
#endif
extern void dvmCompilerSetupResourceMasks(ArmLIR *lir);
extern ArmLIR* dvmCompilerRegCopyNoInsert(CompilationUnit *cUnit, int rDest,
int rSrc);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.h b/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.h
index fa01210..452f2a5 100644
--- a/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.h
+++ b/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.h
@@ -19,7 +19,7 @@
/* Create the TemplateOpcode enum */
#define JIT_TEMPLATE(X) TEMPLATE_##X,
-typedef enum {
+enum TemplateOpcode {
#include "../../../template/armv5te-vfp/TemplateOpList.h"
/*
* For example,
@@ -28,7 +28,7 @@
* ...
*/
TEMPLATE_LAST_MARK,
-} TemplateOpcode;
+};
#undef JIT_TEMPLATE
#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV5TE_VFP_ARCHVARIANT_H */
diff --git a/vm/compiler/codegen/arm/armv5te/ArchVariant.h b/vm/compiler/codegen/arm/armv5te/ArchVariant.h
index 4cc4fa6..07a1c8c 100644
--- a/vm/compiler/codegen/arm/armv5te/ArchVariant.h
+++ b/vm/compiler/codegen/arm/armv5te/ArchVariant.h
@@ -19,7 +19,7 @@
/* Create the TemplateOpcode enum */
#define JIT_TEMPLATE(X) TEMPLATE_##X,
-typedef enum {
+enum TemplateOpcode {
#include "../../../template/armv5te/TemplateOpList.h"
/*
* For example,
@@ -28,7 +28,7 @@
* ...
*/
TEMPLATE_LAST_MARK,
-} TemplateOpcode;
+};
#undef JIT_TEMPLATE
#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV5TE_ARCHVARIANT_H */
diff --git a/vm/compiler/codegen/arm/armv7-a/ArchVariant.h b/vm/compiler/codegen/arm/armv7-a/ArchVariant.h
index 747ecc1..66e236b 100644
--- a/vm/compiler/codegen/arm/armv7-a/ArchVariant.h
+++ b/vm/compiler/codegen/arm/armv7-a/ArchVariant.h
@@ -14,16 +14,12 @@
* limitations under the License.
*/
-#ifndef _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV5TE_VFP_ARCHVARIANT_H
-#define _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV5TE_VFP_ARCHVARIANT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifndef _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV7_A_ARCHVARIANT_H
+#define _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV7_A_ARCHVARIANT_H
/* Create the TemplateOpcode enum */
#define JIT_TEMPLATE(X) TEMPLATE_##X,
-typedef enum {
+enum TemplateOpcode {
#include "../../../template/armv5te-vfp/TemplateOpList.h"
/*
* For example,
@@ -32,11 +28,7 @@
* ...
*/
TEMPLATE_LAST_MARK,
-} TemplateOpcode;
+};
#undef JIT_TEMPLATE
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV5TE_VFP_ARCHVARIANT_H */
+#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_ARMV7_A_ARCHVARIANT_H */
diff --git a/vm/compiler/codegen/x86/CalloutHelper.h b/vm/compiler/codegen/x86/CalloutHelper.h
index a64f017..52c030f 100644
--- a/vm/compiler/codegen/x86/CalloutHelper.h
+++ b/vm/compiler/codegen/x86/CalloutHelper.h
@@ -54,6 +54,6 @@
* Functions declared in gDvmInlineOpsTable[] are used for
* OP_EXECUTE_INLINE & OP_EXECUTE_INLINE_RANGE.
*/
-double sqrt(double x); // INLINE_MATH_SQRT
+extern "C" double sqrt(double x); // INLINE_MATH_SQRT
#endif /* _DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H */
diff --git a/vm/compiler/codegen/x86/ia32/ArchVariant.h b/vm/compiler/codegen/x86/ia32/ArchVariant.h
index e4eebf3..c5ce38e 100644
--- a/vm/compiler/codegen/x86/ia32/ArchVariant.h
+++ b/vm/compiler/codegen/x86/ia32/ArchVariant.h
@@ -19,7 +19,7 @@
/* Create the TemplateOpcode enum */
#define JIT_TEMPLATE(X) TEMPLATE_##X,
-typedef enum {
+enum TemplateOpcode {
#include "../../../template/ia32/TemplateOpList.h"
/*
* For example,
@@ -28,7 +28,7 @@
* ...
*/
TEMPLATE_LAST_MARK,
-} TemplateOpcode;
+};
#undef JIT_TEMPLATE
#endif /* _DALVIK_VM_COMPILER_CODEGEN_X86_IA32_ARCHVARIANT_H */