Tidy up some C-isms.
Change-Id: I53b457cab9067369320457549071fc3e4c23c81b
diff --git a/src/compiler/Compiler.h b/src/compiler/Compiler.h
index 6d62f29..db7f2ba 100644
--- a/src/compiler/Compiler.h
+++ b/src/compiler/Compiler.h
@@ -170,34 +170,26 @@
bool oatStartup(void);
void oatShutdown(void);
void oatScanAllClassPointers(void (*callback)(void* ptr));
-void oatInitializeSSAConversion(struct CompilationUnit* cUnit);
-int SRegToVReg(const struct CompilationUnit* cUnit, int ssaReg);
-int SRegToSubscript(const struct CompilationUnit* cUnit, int ssaReg);
-bool oatFindLocalLiveIn(struct CompilationUnit* cUnit,
- struct BasicBlock* bb);
-bool oatDoSSAConversion(struct CompilationUnit* cUnit,
- struct BasicBlock* bb);
-bool oatDoConstantPropagation(struct CompilationUnit* cUnit,
- struct BasicBlock* bb);
-bool oatFindInductionVariables(struct CompilationUnit* cUnit,
- struct BasicBlock* bb);
+void oatInitializeSSAConversion(CompilationUnit* cUnit);
+int SRegToVReg(const CompilationUnit* cUnit, int ssaReg);
+int SRegToSubscript(const CompilationUnit* cUnit, int ssaReg);
+bool oatFindLocalLiveIn(CompilationUnit* cUnit, BasicBlock* bb);
+bool oatDoSSAConversion(CompilationUnit* cUnit, BasicBlock* bb);
+bool oatDoConstantPropagation(CompilationUnit* cUnit, BasicBlock* bb);
+bool oatFindInductionVariables(CompilationUnit* cUnit, BasicBlock* bb);
/* Clear the visited flag for each BB */
-bool oatClearVisitedFlag(struct CompilationUnit* cUnit,
- struct BasicBlock* bb);
-char* oatGetDalvikDisassembly(CompilationUnit* cUnit,
- const DecodedInstruction& insn,
+bool oatClearVisitedFlag(CompilationUnit* cUnit, BasicBlock* bb);
+char* oatGetDalvikDisassembly(CompilationUnit* cUnit, const DecodedInstruction& insn,
const char* note);
-char* oatFullDisassembler(struct CompilationUnit* cUnit,
- const struct MIR* mir);
-char* oatGetSSAString(struct CompilationUnit* cUnit,
- struct SSARepresentation* ssaRep);
-void oatDataFlowAnalysisDispatcher(struct CompilationUnit* cUnit,
- bool (*func)(struct CompilationUnit* , struct BasicBlock*),
+char* oatFullDisassembler(CompilationUnit* cUnit, const MIR* mir);
+char* oatGetSSAString(CompilationUnit* cUnit, SSARepresentation* ssaRep);
+void oatDataFlowAnalysisDispatcher(CompilationUnit* cUnit,
+ bool (*func)(CompilationUnit* , BasicBlock*),
DataFlowAnalysisMode dfaMode,
bool isIterative);
-void oatMethodSSATransformation(struct CompilationUnit* cUnit);
+void oatMethodSSATransformation(CompilationUnit* cUnit);
u8 oatGetRegResourceMask(int reg);
-void oatDumpCFG(struct CompilationUnit* cUnit, const char* dirPrefix);
+void oatDumpCFG(CompilationUnit* cUnit, const char* dirPrefix);
void oatProcessSwitchTables(CompilationUnit* cUnit);
bool oatIsFpReg(int reg);
uint32_t oatFpRegMask(void);
diff --git a/src/compiler/CompilerIR.h b/src/compiler/CompilerIR.h
index 88593bd..67d741a 100644
--- a/src/compiler/CompilerIR.h
+++ b/src/compiler/CompilerIR.h
@@ -91,8 +91,8 @@
bool live; // Is there an associated SSA name?
bool dirty; // If live, is it dirty?
int sReg; // Name of live value
- struct LIR *defStart; // Starting inst in last def sequence
- struct LIR *defEnd; // Ending inst in last def sequence
+ LIR *defStart; // Starting inst in last def sequence
+ LIR *defEnd; // Ending inst in last def sequence
};
struct RegisterPool {
@@ -143,9 +143,9 @@
struct LIR {
int offset; // Offset of this instruction
int dalvikOffset; // Offset of Dalvik opcode
- struct LIR* next;
- struct LIR* prev;
- struct LIR* target;
+ LIR* next;
+ LIR* prev;
+ LIR* target;
int opcode;
int operands[5]; // [0..4] = [dest, src1, src2, extra, extra2]
struct {
@@ -213,9 +213,9 @@
DecodedInstruction dalvikInsn;
unsigned int width;
unsigned int offset;
- struct MIR* prev;
- struct MIR* next;
- struct SSARepresentation* ssaRep;
+ MIR* prev;
+ MIR* next;
+ SSARepresentation* ssaRep;
int optimizationFlags;
int seqNum;
union {
@@ -224,7 +224,7 @@
// Used by the inlined invoke to find the class and method pointers
CallsiteInfo* callsiteInfo;
// Used to quickly locate all Phi opcodes
- struct MIR* phiNext;
+ MIR* phiNext;
} meta;
};
@@ -253,10 +253,10 @@
bool isFallThroughFromInvoke; // True means the block needs alignment
MIR* firstMIRInsn;
MIR* lastMIRInsn;
- struct BasicBlock* fallThrough;
- struct BasicBlock* taken;
- struct BasicBlock* iDom; // Immediate dominator
- struct BasicBlockDataFlow* dataFlowInfo;
+ BasicBlock* fallThrough;
+ BasicBlock* taken;
+ BasicBlock* iDom; // Immediate dominator
+ BasicBlockDataFlow* dataFlowInfo;
GrowableList* predecessors;
ArenaBitVector* dominators;
ArenaBitVector* iDominated; // Set nodes being immediately dominated
@@ -425,7 +425,7 @@
bool qdMode; // Compile for code size/compile time
bool usesLinkRegister; // For self-verification only
bool methodTraceSupport; // For TraceView profiling
- struct RegisterPool* regPool;
+ RegisterPool* regPool;
int optRound; // round number to tell an LIR's age
InstructionSet instructionSet;
/* Number of total regs used in the whole cUnit after SSA transformation */
@@ -529,10 +529,10 @@
std::string compilerMethodMatch;
// Flips sense of compilerMethodMatch - apply flags if doesn't match.
bool compilerFlipMatch;
- struct ArenaMemBlock* arenaHead;
- struct ArenaMemBlock* currentArena;
+ ArenaMemBlock* arenaHead;
+ ArenaMemBlock* currentArena;
int numArenaBlocks;
- struct Memstats* mstats;
+ Memstats* mstats;
int* opcodeCount; // Count Dalvik opcodes for tuning
#ifndef NDEBUG
/*
diff --git a/src/compiler/CompilerUtility.h b/src/compiler/CompilerUtility.h
index f7b9b0e..4a15f26 100644
--- a/src/compiler/CompilerUtility.h
+++ b/src/compiler/CompilerUtility.h
@@ -33,7 +33,7 @@
struct ArenaMemBlock {
size_t blockSize;
size_t bytesAllocated;
- struct ArenaMemBlock *next;
+ ArenaMemBlock *next;
char ptr[0];
};
@@ -87,9 +87,10 @@
#define BLOCK_NAME_LEN 80
/* Forward declarations */
-struct LIR;
struct BasicBlock;
struct CompilationUnit;
+struct LIR;
+struct RegLocation;
void oatInitGrowableList(CompilationUnit* cUnit,GrowableList* gList,
size_t initLength, oatListKind kind = kListMisc);
@@ -124,14 +125,13 @@
bool oatTestBitVectors(const ArenaBitVector* src1, const ArenaBitVector* src2);
int oatCountSetBits(const ArenaBitVector* pBits);
-void oatDumpLIRInsn(CompilationUnit* cUnit, struct LIR* lir,
- unsigned char* baseAddr);
-void oatDumpResourceMask(struct LIR* lir, u8 mask, const char* prefix);
+void oatDumpLIRInsn(CompilationUnit* cUnit, LIR* lir, unsigned char* baseAddr);
+void oatDumpResourceMask(LIR* lir, u8 mask, const char* prefix);
void oatDumpBlockBitVector(const GrowableList* blocks, char* msg,
const ArenaBitVector* bv, int length);
-void oatGetBlockName(struct BasicBlock* bb, char* name);
+void oatGetBlockName(BasicBlock* bb, char* name);
const char* oatGetShortyFromTargetIdx(CompilationUnit*, int);
-void oatDumpRegLocTable(struct RegLocation*, int);
+void oatDumpRegLocTable(RegLocation*, int);
void oatDumpMemStats(CompilationUnit* cUnit);
} // namespace art
diff --git a/src/compiler/codegen/GenInvoke.cc b/src/compiler/codegen/GenInvoke.cc
index a904419..b986e78 100644
--- a/src/compiler/codegen/GenInvoke.cc
+++ b/src/compiler/codegen/GenInvoke.cc
@@ -884,7 +884,7 @@
* method. By doing this during basic block construction, we can also
* take advantage of/generate new useful dataflow info.
*/
- std::string tgtMethod = PrettyMethod(mir->dalvikInsn.vB, *cUnit->dex_file);
+ std::string tgtMethod(PrettyMethod(mir->dalvikInsn.vB, *cUnit->dex_file));
if (tgtMethod.compare("char java.lang.String.charAt(int)") == 0) {
return genInlinedCharAt(cUnit, bb, mir, type, isRange);
}
diff --git a/src/compiler/codegen/Optimizer.h b/src/compiler/codegen/Optimizer.h
index 06c7732..94b1907 100644
--- a/src/compiler/codegen/Optimizer.h
+++ b/src/compiler/codegen/Optimizer.h
@@ -25,8 +25,7 @@
struct CompilationUnit;
struct LIR;
-void oatApplyLocalOptimizations(struct CompilationUnit* cUnit,
- struct LIR* head, struct LIR* tail);
+void oatApplyLocalOptimizations(CompilationUnit* cUnit, LIR* head, LIR* tail);
} // namespace art
diff --git a/src/compiler/codegen/Ralloc.h b/src/compiler/codegen/Ralloc.h
index 2169082..671dffe 100644
--- a/src/compiler/codegen/Ralloc.h
+++ b/src/compiler/codegen/Ralloc.h
@@ -95,7 +95,7 @@
extern void oatResetDefLoc(CompilationUnit* cUnit, RegLocation rl);
/* Set up temp & preserved register pools specialized by target */
-extern void oatInitPool(struct RegisterInfo* regs, int* regNums, int num);
+extern void oatInitPool(RegisterInfo* regs, int* regNums, int num);
/*
* Mark the beginning and end LIR of a def sequence. Note that