Add 'OverridenFilesKeepOriginalName' field in SourceManager which if true the SourceManager
should report the original file name for contents of files that were overriden by other files,
otherwise it should report the name of the new file. Default is true.
Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine.
llvm-svn: 127289
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 9252c6a..5e534b3 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1576,6 +1576,7 @@
bool CaptureDiagnostics,
RemappedFile *RemappedFiles,
unsigned NumRemappedFiles,
+ bool RemappedFilesKeepOriginalName,
bool PrecompilePreamble,
bool CompleteTranslationUnit,
bool CacheCodeCompletionResults,
@@ -1658,6 +1659,8 @@
CI->getPreprocessorOpts().addRemappedFile(RemappedFiles[I].first, fname);
}
}
+ CI->getPreprocessorOpts().RemappedFilesKeepOriginalName =
+ RemappedFilesKeepOriginalName;
// Override the resources path.
CI->getHeaderSearchOpts().ResourceDir = ResourceFilesPath;