mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
make AsmPrinter::doFinalization iterate over the global variables
and call PrintGlobalVariable, allowing elimination and simplification of various targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -49,11 +49,10 @@ namespace {
|
||||
bool printInstruction(const MachineInstr *MI);
|
||||
void printOp(const MachineOperand &MO, bool IsCallOp = false);
|
||||
void printOperand(const MachineInstr *MI, int opNum);
|
||||
void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true);
|
||||
void printModuleLevelGV(const GlobalVariable* GVar);
|
||||
void printBaseOffsetPair(const MachineInstr *MI, int i, bool brackets=true);
|
||||
void PrintGlobalVariable(const GlobalVariable *GVar);
|
||||
bool runOnMachineFunction(MachineFunction &F);
|
||||
bool doInitialization(Module &M);
|
||||
bool doFinalization(Module &M);
|
||||
|
||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
unsigned AsmVariant, const char *ExtraCode);
|
||||
@@ -209,7 +208,7 @@ bool AlphaAsmPrinter::doInitialization(Module &M)
|
||||
return AsmPrinter::doInitialization(M);
|
||||
}
|
||||
|
||||
void AlphaAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
|
||||
void AlphaAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
|
||||
const TargetData *TD = TM.getTargetData();
|
||||
|
||||
if (!GVar->hasInitializer()) return; // External global require no code
|
||||
@@ -266,14 +265,6 @@ void AlphaAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
|
||||
O << '\n';
|
||||
}
|
||||
|
||||
bool AlphaAsmPrinter::doFinalization(Module &M) {
|
||||
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ++I)
|
||||
printModuleLevelGV(I);
|
||||
|
||||
return AsmPrinter::doFinalization(M);
|
||||
}
|
||||
|
||||
/// PrintAsmOperand - Print out an operand for an inline asm expression.
|
||||
///
|
||||
bool AlphaAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
|
Reference in New Issue
Block a user