Avoid compiler warning (in -Asserts mode)
[oota-llvm.git] / lib / Target / PIC16 / PIC16AsmPrinter.cpp
index ea4515696a5e92e6eca9eaf39acbd573ba1cfefe..e98cf41b5400cd3b62da447fb6decfdb60cf7271 100644 (file)
@@ -238,7 +238,9 @@ 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)
-    I->setSection(getObjFileLowering().SectionForGlobal(I, Mang,TM)->getName());
+    if (!I->isDeclaration() && !I->hasAvailableExternallyLinkage())
+      I->setSection(getObjFileLowering().
+                    SectionForGlobal(I, Mang,TM)->getName());
 
   DbgInfo.BeginModule(M);
   EmitFunctionDecls(M);