for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
AI != AE; ++AI)
// Size should be aligned to DWORD boundary
- Size += ((TD->getTypeSize(AI->getType()) + 3)/4)*4;
+ Size += ((TD->getABITypeSize(AI->getType()) + 3)/4)*4;
// We're not supporting tooooo huge arguments :)
Info.setBytesToPopOnReturn((unsigned int)Size);
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getTypeSize(Type);
+ unsigned Size = TD->getABITypeSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(I);
if (I->hasHiddenVisibility()) {
if (Subtarget->isTargetELF())
O << "\t.type\t" << name << ",@object\n";
- if (C->isNullValue()) {
+ if (C->isNullValue() && !I->hasSection()) {
if (I->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
O << "\t.globl\t" << name << "\n";
}
}
- if (!I->hasSection() && !I->isThreadLocal() &&
+ if (!I->isThreadLocal() &&
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
I->hasLinkOnceLinkage())) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
case GlobalValue::LinkOnceLinkage:
case GlobalValue::WeakLinkage:
if (Subtarget->isTargetDarwin()) {
- O << "\t.globl " << name << "\n"
+ O << "\t.globl\t" << name << "\n"
<< "\t.weak_definition " << name << "\n";
SwitchToDataSection(".section __DATA,__const_coal,coalesced", I);
} else if (Subtarget->isTargetCygMing()) {
name +
",\"aw\"");
SwitchToDataSection(SectionName.c_str(), I);
- O << "\t.globl " << name << "\n"
+ O << "\t.globl\t" << name << "\n"
<< "\t.linkonce same_size\n";
} else {
std::string SectionName("\t.section\t.llvm.linkonce.d." +
// their name or something. For now, just emit them as external.
case GlobalValue::ExternalLinkage:
// If external or appending, declare as a global symbol
- O << "\t.globl " << name << "\n";
+ O << "\t.globl\t" << name << "\n";
// FALL THROUGH
case GlobalValue::InternalLinkage: {
if (I->isConstant()) {
}
// Output linker support code for dllexported globals
- if (DLLExportedGVs.begin() != DLLExportedGVs.end()) {
+ if (!DLLExportedGVs.empty()) {
SwitchToDataSection(".section .drectve");
}
O << "\t.ascii \" -export:" << *i << ",data\"\n";
}
- if (DLLExportedFns.begin() != DLLExportedFns.end()) {
+ if (!DLLExportedFns.empty()) {
SwitchToDataSection(".section .drectve");
}
O << "\n";
- if (MMI) {
+ if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI) {
// Add the (possibly multiple) personalities to the set of global values.
const std::vector<Function *>& Personalities = MMI->getPersonalities();
}
// Output stubs for external and common global variables.
- if (GVStubs.begin() != GVStubs.end())
+ if (!GVStubs.empty())
SwitchToDataSection(
".section __IMPORT,__pointers,non_lazy_symbol_pointers");
for (std::set<std::string>::iterator i = GVStubs.begin(), e = GVStubs.end();