Honour text sections
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 9 Jul 2008 13:28:19 +0000 (13:28 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 9 Jul 2008 13:28:19 +0000 (13:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53319 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ATTAsmPrinter.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index 0236e49288823a30a25274d2f08325c96e9f9a6b..61556baea1b13d7d9e3413574bf8dd695e8f94de 100644 (file)
@@ -154,10 +154,11 @@ std::string X86ATTAsmPrinter::getSectionForFunction(const Function &F) const {
 
 void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
   const Function *F = MF.getFunction();
+  std::string SectionName = TAI->SectionForGlobal(F);
 
   decorateName(CurrentFnName, F);
 
-  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
+  SwitchToTextSection(SectionName.c_str());
 
   unsigned FnAlign = OptimizeForSize ? 1 : 4;
   switch (F->getLinkage()) {
index dd1bdb884ad2062c05a4b22f46d6f5630db1a94b..43d60cbd8f4d73ec7163b538004b9ab7d5378209 100644 (file)
@@ -433,7 +433,7 @@ X86ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
       return UniqueSectionForGlobal(F, kind);
     }
   } else if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
-    if (GVar->isWeakForLinker()
+    if (GVar->isWeakForLinker())
       return UniqueSectionForGlobal(GVar, kind);
     else {
       switch (kind) {