mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +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:
@@ -67,8 +67,7 @@ namespace {
|
||||
|
||||
void emitFunctionHeader(const MachineFunction &MF);
|
||||
bool runOnMachineFunction(MachineFunction &F);
|
||||
bool doFinalization(Module &M);
|
||||
void printModuleLevelGV(const GlobalVariable* GVar);
|
||||
void PrintGlobalVariable(const GlobalVariable* GVar);
|
||||
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AsmPrinter::getAnalysisUsage(AU);
|
||||
@@ -90,15 +89,6 @@ FunctionPass *llvm::createSystemZCodePrinterPass(formatted_raw_ostream &o,
|
||||
return new SystemZAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
|
||||
}
|
||||
|
||||
bool SystemZAsmPrinter::doFinalization(Module &M) {
|
||||
// Print out module-level global variables here.
|
||||
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ++I)
|
||||
printModuleLevelGV(I);
|
||||
|
||||
return AsmPrinter::doFinalization(M);
|
||||
}
|
||||
|
||||
void SystemZAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
|
||||
unsigned FnAlign = MF.getAlignment();
|
||||
const Function *F = MF.getFunction();
|
||||
@@ -331,7 +321,7 @@ static void PrintUnmangledNameSafely(const Value *V, formatted_raw_ostream &OS)
|
||||
OS << *Name;
|
||||
}
|
||||
|
||||
void SystemZAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
|
||||
void SystemZAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
|
||||
const TargetData *TD = TM.getTargetData();
|
||||
|
||||
if (!GVar->hasInitializer())
|
||||
|
||||
Reference in New Issue
Block a user