From: Chris Lattner Date: Sun, 2 Aug 2009 01:02:43 +0000 (+0000) Subject: don't call SectionForGlobal on declarations, you can't tell the section a X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6f411dfad902a8729363eec8486590542ec2976c;p=oota-llvm.git don't call SectionForGlobal on declarations, you can't tell the section a declaration will end up in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77843 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp index ea4515696a5..f0e4cbaae6a 100644 --- a/lib/Target/PIC16/PIC16AsmPrinter.cpp +++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp @@ -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->setSection(getObjFileLowering(). + SectionForGlobal(I, Mang,TM)->getName()); DbgInfo.BeginModule(M); EmitFunctionDecls(M);