summaryrefslogtreecommitdiff
path: root/tools/driver
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-12-18 00:31:10 +0000
committerEric Christopher <echristo@gmail.com>2012-12-18 00:31:10 +0000
commit27e2b983beb8b5a29869639637327725623069a8 (patch)
tree558b2e5d9a00e83cb3754c125df5762471e611e3 /tools/driver
parent073fec91b73f08ba86ad46573141be14c7a0d262 (diff)
downloadclang-27e2b983beb8b5a29869639637327725623069a8.tar.gz
Add support for passing the main file name down to the assembler
for location information. Part of PR14624 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver')
-rw-r--r--tools/driver/cc1as_main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp
index 73be56c2b4..f01d97d1c5 100644
--- a/tools/driver/cc1as_main.cpp
+++ b/tools/driver/cc1as_main.cpp
@@ -84,6 +84,7 @@ struct AssemblerInvocation {
unsigned GenDwarfForAssembly : 1;
std::string DwarfDebugFlags;
std::string DebugCompilationDir;
+ std::string MainFileName;
/// @}
/// @name Frontend Options
@@ -183,6 +184,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
Opts.GenDwarfForAssembly = Args->hasArg(OPT_g);
Opts.DwarfDebugFlags = Args->getLastArgValue(OPT_dwarf_debug_flags);
Opts.DebugCompilationDir = Args->getLastArgValue(OPT_fdebug_compilation_dir);
+ Opts.MainFileName = Args->getLastArgValue(OPT_main_file_name);
// Frontend Options
if (Args->hasArg(OPT_INPUT)) {
@@ -309,6 +311,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
Ctx.setDwarfDebugFlags(StringRef(Opts.DwarfDebugFlags));
if (!Opts.DebugCompilationDir.empty())
Ctx.setCompilationDir(Opts.DebugCompilationDir);
+ if (!Opts.MainFileName.empty())
+ Ctx.setMainFileName(StringRef(Opts.MainFileName));
// Build up the feature string from the target feature list.
std::string FS;