aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-19 16:15:56 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-19 16:15:56 +0000
commit94dc8f640ebea52241412512ed48601626edbc58 (patch)
treed2f85a840dec17223611a920b85f8e27fb4e60e2 /lib/Frontend/ASTUnit.cpp
parentf7ad50026074776bde13fdf790bcf2f647904f1b (diff)
Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 1aaa536cb3..935c415243 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -278,8 +278,7 @@ public:
ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
Diagnostic &Diags,
bool OnlyLocalDecls,
- bool CaptureDiagnostics,
- bool WantPreprocessingRecord) {
+ bool CaptureDiagnostics) {
// Create the compiler instance to use for building the AST.
CompilerInstance Clang;
llvm::OwningPtr<ASTUnit> AST;
@@ -329,15 +328,6 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
// Create the preprocessor.
Clang.createPreprocessor();
- // If the ASTUnit was requested to store information about preprocessing,
- // create storage for that information and attach an appropriate callback to
- // populate that storage.
- if (WantPreprocessingRecord) {
- AST->Preprocessing.reset(new PreprocessingRecord);
- Clang.getPreprocessor().addPPCallbacks(
- new PopulatePreprocessingRecord(*AST->Preprocessing));
- }
-
Act.reset(new TopLevelDeclTrackerAction(*AST));
if (!Act->BeginSourceFile(Clang, Clang.getFrontendOpts().Inputs[0].second,
/*IsAST=*/false))
@@ -377,8 +367,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
bool OnlyLocalDecls,
RemappedFile *RemappedFiles,
unsigned NumRemappedFiles,
- bool CaptureDiagnostics,
- bool WantPreprocessingRecord) {
+ bool CaptureDiagnostics) {
llvm::SmallVector<const char *, 16> Args;
Args.push_back("<clang>"); // FIXME: Remove dummy argument.
Args.insert(Args.end(), ArgBegin, ArgEnd);
@@ -430,6 +419,5 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
CI->getFrontendOpts().DisableFree = true;
return LoadFromCompilerInvocation(CI.take(), Diags, OnlyLocalDecls,
- CaptureDiagnostics,
- WantPreprocessingRecord);
+ CaptureDiagnostics);
}