From 6c583141bf6b7a6b5f8125c1037ecbc089813288 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 18 Dec 2012 00:31:01 +0000 Subject: Add support for passing -main-file-name all the way through to the assembler. Part of PR14624 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170390 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/llvm-mc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/llvm-mc/llvm-mc.cpp') diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index c12a93d171..930f528668 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -161,6 +161,10 @@ static cl::opt DebugCompilationDir("fdebug-compilation-dir", cl::desc("Specifies the debug info's compilation dir")); +static cl::opt +MainFileName("main-file-name", + cl::desc("Specifies the name we should consider the input file")); + enum ActionType { AC_AsLex, AC_Assemble, @@ -397,6 +401,8 @@ int main(int argc, char **argv) { Ctx.setDwarfDebugFlags(StringRef(DwarfDebugFlags)); if (!DebugCompilationDir.empty()) Ctx.setCompilationDir(DebugCompilationDir); + if (!MainFileName.empty()) + Ctx.setMainFileName(MainFileName); // Package up features to be passed to target/subtarget std::string FeaturesStr; -- cgit v1.2.3