mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-30 04:37:20 +00:00
Handle globals with explicit alignment requests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a1ab72daad
commit
ced704ba60
@ -74,7 +74,6 @@ namespace {
|
|||||||
else
|
else
|
||||||
NS = NewSection;
|
NS = NewSection;
|
||||||
|
|
||||||
|
|
||||||
if (CurSection != NS) {
|
if (CurSection != NS) {
|
||||||
CurSection = NS;
|
CurSection = NS;
|
||||||
if (!CurSection.empty())
|
if (!CurSection.empty())
|
||||||
@ -398,7 +397,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchSection(".text", F);
|
SwitchSection(".text", F);
|
||||||
emitAlignment(4);
|
emitAlignment(4, F);
|
||||||
if (!F->hasInternalLinkage())
|
if (!F->hasInternalLinkage())
|
||||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||||
O << CurrentFnName << ":\n";
|
O << CurrentFnName << ":\n";
|
||||||
@ -466,7 +465,8 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
|
|||||||
const TargetData &TD = TM.getTargetData();
|
const TargetData &TD = TM.getTargetData();
|
||||||
|
|
||||||
// Print out module-level global variables here.
|
// Print out module-level global variables here.
|
||||||
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
|
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
|
||||||
|
I != E; ++I)
|
||||||
if (I->hasInitializer()) { // External global require no code
|
if (I->hasInitializer()) { // External global require no code
|
||||||
O << '\n';
|
O << '\n';
|
||||||
std::string name = Mang->getValueName(I);
|
std::string name = Mang->getValueName(I);
|
||||||
@ -512,7 +512,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
emitAlignment(Align);
|
emitAlignment(Align, I);
|
||||||
O << name << ":\t\t\t\t; '" << I->getName() << "'\n";
|
O << name << ":\t\t\t\t; '" << I->getName() << "'\n";
|
||||||
emitGlobalConstant(C);
|
emitGlobalConstant(C);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user