just remove the use_empty() check entirely, the only reason it

existed was for llvm-gcc 3.4 (which used the __main hack) which 
is really really long dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-03-09 08:18:48 +00:00
parent 5c3e7b1718
commit ea3a9ff53d

View File

@ -419,23 +419,17 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
const TargetData *TD = TM.getTargetData();
unsigned Align = Log2_32(TD->getPointerPrefAlignment());
if (GV->getName() == "llvm.global_ctors") {
GV->removeDeadConstantUsers();
if (GV->use_empty()) {
SwitchToDataSection(TAI->getStaticCtorsSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
return true;
}
SwitchToDataSection(TAI->getStaticCtorsSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
return true;
}
if (GV->getName() == "llvm.global_dtors") {
GV->removeDeadConstantUsers();
if (GV->use_empty()) {
SwitchToDataSection(TAI->getStaticDtorsSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
return true;
}
SwitchToDataSection(TAI->getStaticDtorsSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
return true;
}
return false;