From 313570fb17979bd48607362272f2aafc3d8ddad7 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Tue, 7 Mar 2006 22:00:35 +0000 Subject: Use "llvm.metadata" section for debug globals. Filter out these globals in the asm printer. llvm-svn: 26599 --- llvm/lib/CodeGen/AsmPrinter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index dfac3c07788..11c6f231b9f 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -131,8 +131,12 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { /// special global used by LLVM. If so, emit it and return true, otherwise /// do nothing and return false. bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) { - assert(GV->hasInitializer() && GV->hasAppendingLinkage() && - "Not a special LLVM global!"); + // Ignore debug and non-emitted data. + if (GV->getSection() == "llvm.metadata") return true; + + if (!GV->hasAppendingLinkage()) return false; + + assert(GV->hasInitializer() && "Not a special LLVM global!"); if (GV->getName() == "llvm.used") return true; // No need to emit this at all. -- cgit v1.2.3