Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage the

compilation directory.

This defaults to the current working directory, just as it always has,
but now an assembler can choose to override it with a custom directory.
I've taught llvm-mc about this option and added a test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170371 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth
2012-12-17 21:32:42 +00:00
parent c83b8fec01
commit 6c31d31357
5 changed files with 30 additions and 4 deletions

View 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;