summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-17 21:32:42 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-17 21:32:42 +0000
commit10700aad85d716e79fd913511c0beb8f67c91bc6 (patch)
treecaabd1e002f3848ea26bff2f93f197138bb610f7 /llvm/lib/MC/MCDwarf.cpp
parent48a100190e562de481c0200aa3fb6c26d3e2b16f (diff)
downloadbcm5719-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/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 597ee1d691c..d53d2fc0b72 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -627,8 +627,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string.
// AT_comp_dir, the working directory the assembly was done in.
- llvm::sys::Path CWD = llvm::sys::Path::GetCurrentDirectory();
- MCOS->EmitBytes(StringRef(CWD.c_str()), 0);
+ MCOS->EmitBytes(context.getCompilationDir(), 0);
MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string.
// AT_APPLE_flags, the command line arguments of the assembler tool.
OpenPOWER on IntegriCloud