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/lib/MC/MCDwarf.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/MC/MCDwarf.cpp') 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. -- cgit v1.2.3