summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/cc1as_main.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-17 21:40:04 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-17 21:40:04 +0000
commit4d5e1a9b3409b6036d152e3f040c09adbcea4e76 (patch)
tree227ff7d8626285d63afd567e82c0d4bf163f06f4 /clang/tools/driver/cc1as_main.cpp
parent66d5714ae6a0fb433d8c67d4e22473353ed327c2 (diff)
downloadbcm5719-llvm-4d5e1a9b3409b6036d152e3f040c09adbcea4e76.tar.gz
bcm5719-llvm-4d5e1a9b3409b6036d152e3f040c09adbcea4e76.zip
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. llvm-svn: 170373
Diffstat (limited to 'clang/tools/driver/cc1as_main.cpp')
-rw-r--r--clang/tools/driver/cc1as_main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp
index 87e3bfba845..73be56c2b4c 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud