Don't call SectionForGlobal for hasAvailableExternallyLinkage()
authorDan Gohman <gohman@apple.com>
Sun, 2 Aug 2009 01:18:44 +0000 (01:18 +0000)
committerDan Gohman <gohman@apple.com>
Sun, 2 Aug 2009 01:18:44 +0000 (01:18 +0000)
variables either.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77844 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PIC16/PIC16AsmPrinter.cpp

index f0e4cbaae6ab7c1f60d667959022565ee471f51f..e98cf41b5400cd3b62da447fb6decfdb60cf7271 100644 (file)
@@ -238,7 +238,7 @@ bool PIC16AsmPrinter::doInitialization(Module &M) {
   // Set the section names for all globals.
   for (Module::global_iterator I = M.global_begin(), E = M.global_end();
        I != E; ++I)
-    if (!I->isDeclaration())
+    if (!I->isDeclaration() && !I->hasAvailableExternallyLinkage())
       I->setSection(getObjFileLowering().
                     SectionForGlobal(I, Mang,TM)->getName());