From 44d798d9763bc32aaf49fe7c10d604845f4b6685 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 17 Oct 2011 23:05:28 +0000 Subject: Add support for a new extension to the .file directive: .file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llc/llc.cpp | 6 ++++++ tools/llvm-mc/llvm-mc.cpp | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 7211954..4cb3cf1 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -133,6 +133,9 @@ cl::opt DisableDotLoc("disable-dot-loc", cl::Hidden, cl::opt DisableCFI("disable-cfi", cl::Hidden, cl::desc("Do not use .cfi_* directives")); +cl::opt DisableDwarfDirectory("disable-dwarf-directory", cl::Hidden, + cl::desc("Do not use file directives with an explicit directory.")); + static cl::opt DisableRedZone("disable-red-zone", cl::desc("Do not emit code that uses the red zone."), @@ -316,6 +319,9 @@ int main(int argc, char **argv) { if (DisableCFI) Target.setMCUseCFI(false); + if (DisableDwarfDirectory) + Target.setMCUseDwarfDirectory(false); + // Disable .loc support for older OS X versions. if (TheTriple.isMacOSX() && TheTriple.isMacOSXVersionLT(10, 6)) diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index ce4a5b3..280a1bb 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -409,8 +409,10 @@ static int AssembleInput(const char *ProgName) { } Str.reset(TheTarget->createAsmStreamer(Ctx, FOS, /*asmverbose*/true, /*useLoc*/ true, - /*useCFI*/ true, IP, CE, MAB, - ShowInst)); + /*useCFI*/ true, + /*useDwarfDirectory*/ true, + IP, CE, MAB, ShowInst)); + } else if (FileType == OFT_Null) { Str.reset(createNullStreamer(Ctx)); } else { @@ -515,4 +517,3 @@ int main(int argc, char **argv) { return 0; } - -- cgit v1.1