From cda011b5adebd1f6f513b43141698a4f071a7148 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 3 Dec 2008 11:01:37 +0000 Subject: Fix bug 3140. Print a single parameter .file directive if we have an ELF target. llvm-svn: 60480 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index bfc2e35cf36..b640a589bad 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -142,6 +142,14 @@ bool AsmPrinter::doInitialization(Module &M) { GCModuleInfo *MI = getAnalysisToUpdate(); assert(MI && "AsmPrinter didn't require GCModuleInfo?"); + + if (TAI->hasSingleParameterDotFile()) { + /* Very minimal debug info. It is ignored if we emit actual + debug info. If we don't, this at helps the user find where + a function came from. */ + O << "\t.file\t\"" << M.getModuleIdentifier() << "\"\n"; + } + for (GCModuleInfo::iterator I = MI->begin(), E = MI->end(); I != E; ++I) if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*I)) MP->beginAssembly(O, *this, *TAI); -- cgit v1.2.3