diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-17 21:40:04 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-17 21:40:04 +0000 |
commit | d566df67bed6381f6e859bbd21fd43ff89277cc0 (patch) | |
tree | ef5937d68dd571048353a1766e9174e6d491e3db /tools/driver/cc1as_main.cpp | |
parent | 2bff7e5a02495dabd26013c15613f082fce67633 (diff) |
Fix PR14625 by teaching the driver to detect PWD for assembly files.
This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).
The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/cc1as_main.cpp')
-rw-r--r-- | tools/driver/cc1as_main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index 87e3bfba84..73be56c2b4 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -83,6 +83,7 @@ struct AssemblerInvocation { unsigned SaveTemporaryLabels : 1; unsigned GenDwarfForAssembly : 1; std::string DwarfDebugFlags; + std::string DebugCompilationDir; /// @} /// @name Frontend Options @@ -181,6 +182,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts, Opts.SaveTemporaryLabels = Args->hasArg(OPT_L); Opts.GenDwarfForAssembly = Args->hasArg(OPT_g); Opts.DwarfDebugFlags = Args->getLastArgValue(OPT_dwarf_debug_flags); + Opts.DebugCompilationDir = Args->getLastArgValue(OPT_fdebug_compilation_dir); // Frontend Options if (Args->hasArg(OPT_INPUT)) { @@ -305,6 +307,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, Ctx.setGenDwarfForAssembly(true); if (!Opts.DwarfDebugFlags.empty()) Ctx.setDwarfDebugFlags(StringRef(Opts.DwarfDebugFlags)); + if (!Opts.DebugCompilationDir.empty()) + Ctx.setCompilationDir(Opts.DebugCompilationDir); // Build up the feature string from the target feature list. std::string FS; |