summaryrefslogtreecommitdiffstats
path: root/clang/Sema/ASTStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-10 06:20:45 +0000
committerChris Lattner <sabre@nondot.org>2006-11-10 06:20:45 +0000
commitcb6a382b67bcb3cc8bb3b1f9e95c266f7abfcb1c (patch)
treef54a1779d323142b295783ca10a3521347cf2d84 /clang/Sema/ASTStreamer.cpp
parent88724336e9ac35e24ff8df82d6feff8525529eb7 (diff)
downloadbcm5719-llvm-cb6a382b67bcb3cc8bb3b1f9e95c266f7abfcb1c.tar.gz
bcm5719-llvm-cb6a382b67bcb3cc8bb3b1f9e95c266f7abfcb1c.zip
introduce a new ASTContext class to hold long-lived ast nodes.
llvm-svn: 39161
Diffstat (limited to 'clang/Sema/ASTStreamer.cpp')
-rw-r--r--clang/Sema/ASTStreamer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/Sema/ASTStreamer.cpp b/clang/Sema/ASTStreamer.cpp
index 49689e9c2c8..c530c781295 100644
--- a/clang/Sema/ASTStreamer.cpp
+++ b/clang/Sema/ASTStreamer.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "clang/AST/ASTStreamer.h"
+#include "clang/AST/ASTContext.h"
#include "Sema.h"
#include "clang/Parse/Action.h"
#include "clang/Parse/Parser.h"
@@ -23,9 +24,9 @@ namespace {
Parser P;
std::vector<Decl*> LastInGroupList;
public:
- ASTStreamer(Preprocessor &PP, unsigned MainFileID)
- : P(PP, *new Sema(PP, LastInGroupList)) {
- PP.EnterSourceFile(MainFileID, 0, true);
+ ASTStreamer(ASTContext &Ctx, unsigned MainFileID)
+ : P(Ctx.PP, *new Sema(Ctx, LastInGroupList)) {
+ Ctx.PP.EnterSourceFile(MainFileID, 0, true);
// Initialize the parser.
P.Initialize();
@@ -79,9 +80,9 @@ namespace {
/// ASTStreamer_Init - Create an ASTStreamer with the specified preprocessor
/// and FileID.
-ASTStreamerTy *llvm::clang::ASTStreamer_Init(Preprocessor &PP,
+ASTStreamerTy *llvm::clang::ASTStreamer_Init(ASTContext &Ctx,
unsigned MainFileID) {
- return new ASTStreamer(PP, MainFileID);
+ return new ASTStreamer(Ctx, MainFileID);
}
/// ASTStreamer_ReadTopLevelDecl - Parse and return one top-level declaration. This
OpenPOWER on IntegriCloud