From 10700aad85d716e79fd913511c0beb8f67c91bc6 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 17 Dec 2012 21:32:42 +0000 Subject: Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage the compilation directory. This defaults to the current working directory, just as it always has, but now an assembler can choose to override it with a custom directory. I've taught llvm-mc about this option and added a test case. llvm-svn: 170371 --- llvm/tools/llvm-mc/llvm-mc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp') diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 15cacfabeb5..c12a93d1716 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -157,6 +157,10 @@ static cl::opt GenDwarfForAssembly("g", cl::desc("Generate dwarf debugging info for assembly " "source files")); +static cl::opt +DebugCompilationDir("fdebug-compilation-dir", + cl::desc("Specifies the debug info's compilation dir")); + enum ActionType { AC_AsLex, AC_Assemble, @@ -389,8 +393,10 @@ int main(int argc, char **argv) { Ctx.setAllowTemporaryLabels(false); Ctx.setGenDwarfForAssembly(GenDwarfForAssembly); - if (!DwarfDebugFlags.empty()) + if (!DwarfDebugFlags.empty()) Ctx.setDwarfDebugFlags(StringRef(DwarfDebugFlags)); + if (!DebugCompilationDir.empty()) + Ctx.setCompilationDir(DebugCompilationDir); // Package up features to be passed to target/subtarget std::string FeaturesStr; -- cgit v1.2.3