diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-11-13 08:58:20 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-13 08:58:20 +0000 |
| commit | 242ea9a05af8d5635e5c47697dd533ed9da2bfeb (patch) | |
| tree | bcb457d915918ce58c30cfbba7bf8c5e44773f7f /clang/lib/Sema/Sema.cpp | |
| parent | 599313ef94fb801b55c67ece2b7ae657890af3b5 (diff) | |
| download | bcm5719-llvm-242ea9a05af8d5635e5c47697dd533ed9da2bfeb.tar.gz bcm5719-llvm-242ea9a05af8d5635e5c47697dd533ed9da2bfeb.zip | |
Rework Sema code completion interface.
- Provide Sema in callbacks, instead of requiring it in constructor. This
eliminates the need for a factory function. Clients now just pass the object
to consume the results in directly.
- CodeCompleteConsumer is cheap to construct, so building it whenever we are
doing code completion is reasonable.
Doug, please review.
llvm-svn: 87099
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
| -rw-r--r-- | clang/lib/Sema/Sema.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index f6f572feec0..b2bbac8bc2a 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -347,10 +347,11 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { } Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, - bool CompleteTranslationUnit) + bool CompleteTranslationUnit, + CodeCompleteConsumer *CodeCompleter) : LangOpts(pp.getLangOptions()), PP(pp), Context(ctxt), Consumer(consumer), Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), - ExternalSource(0), CodeCompleter(0), CurContext(0), + ExternalSource(0), CodeCompleter(CodeCompleter), CurContext(0), PreDeclaratorDC(0), CurBlock(0), PackContext(0), ParsingDeclDepth(0), IdResolver(pp.getLangOptions()), StdNamespace(0), StdBadAlloc(0), GlobalNewDeleteDeclared(false), ExprEvalContext(PotentiallyEvaluated), |

