aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-10-21 02:32:14 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-10-21 02:32:14 +0000
commit7c4fd9121f5885096fd3258d20a984e3f08f8603 (patch)
tree893801c3743e40c6bc4da17e1f4b30bce28c0cc7 /lib/Frontend/CompilerInvocation.cpp
parent0e9e9814a7f8313c0c02b6afea71f0e4c411873e (diff)
Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
closer to what GCC does, except that GCC also checks that the inodes for $PWD and '.' match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142633 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 05d2e692e5..76ceb9b0a5 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -131,6 +131,10 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
Res.push_back("-disable-llvm-optzns");
if (Opts.DisableRedZone)
Res.push_back("-disable-red-zone");
+ if (!Opts.DebugCompilationDir.empty()) {
+ Res.push_back("-fdebug-compilation-dir");
+ Res.push_back(Opts.DebugCompilationDir);
+ }
if (!Opts.DwarfDebugFlags.empty()) {
Res.push_back("-dwarf-debug-flags");
Res.push_back(Opts.DwarfDebugFlags);
@@ -1071,6 +1075,7 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data);
Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes);
Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
+ Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir);
if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
StringRef Name = A->getValue(Args);