diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-17 21:32:42 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-17 21:32:42 +0000 |
commit | 10700aad85d716e79fd913511c0beb8f67c91bc6 (patch) | |
tree | caabd1e002f3848ea26bff2f93f197138bb610f7 /llvm/tools/llvm-mc/llvm-mc.cpp | |
parent | 48a100190e562de481c0200aa3fb6c26d3e2b16f (diff) | |
download | bcm5719-llvm-10700aad85d716e79fd913511c0beb8f67c91bc6.tar.gz bcm5719-llvm-10700aad85d716e79fd913511c0beb8f67c91bc6.zip |
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
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<bool> GenDwarfForAssembly("g", cl::desc("Generate dwarf debugging info for assembly " "source files")); +static cl::opt<std::string> +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; |