Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage the
[oota-llvm.git] / tools / llvm-mc / llvm-mc.cpp
index 15cacfabeb573b77d242e174e20d101d93b9738c..c12a93d1716e65836a185cbb5e8e351ef7449c81 100644 (file)
@@ -157,6 +157,10 @@ static cl::opt<bool>
 GenDwarfForAssembly("g", cl::desc("Generate dwarf debugging info for assembly "
                                   "source files"));
 
+static cl::opt<std::string>
+DebugCompilationDir("fdebug-compilation-dir",
+                    cl::desc("Specifies the debug info's compilation dir"));
+
 enum ActionType {
   AC_AsLex,
   AC_Assemble,
@@ -389,8 +393,10 @@ int main(int argc, char **argv) {
     Ctx.setAllowTemporaryLabels(false);
 
   Ctx.setGenDwarfForAssembly(GenDwarfForAssembly);
-  if (!DwarfDebugFlags.empty()) 
+  if (!DwarfDebugFlags.empty())
     Ctx.setDwarfDebugFlags(StringRef(DwarfDebugFlags));
+  if (!DebugCompilationDir.empty())
+    Ctx.setCompilationDir(DebugCompilationDir);
 
   // Package up features to be passed to target/subtarget
   std::string FeaturesStr;