[cfe-commits] r41906 - in /cfe/trunk: Analysis/DeadStores.cpp Driver/ASTStreamers.cpp Driver/LLVMCodegen.cpp include/clang/AST/ASTContext.h
Chris Lattner
sabre at nondot.org
Wed Sep 12 18:14:03 PDT 2007
Author: lattner
Date: Wed Sep 12 20:14:03 2007
New Revision: 41906
URL: http://llvm.org/viewvc/llvm-project?rev=41906&view=rev
Log:
make the sourcemgr available through ASTContext.
Modified:
cfe/trunk/Analysis/DeadStores.cpp
cfe/trunk/Driver/ASTStreamers.cpp
cfe/trunk/Driver/LLVMCodegen.cpp
cfe/trunk/include/clang/AST/ASTContext.h
Modified: cfe/trunk/Analysis/DeadStores.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/DeadStores.cpp?rev=41906&r1=41905&r2=41906&view=diff
==============================================================================
--- cfe/trunk/Analysis/DeadStores.cpp (original)
+++ cfe/trunk/Analysis/DeadStores.cpp Wed Sep 12 20:14:03 2007
@@ -29,7 +29,9 @@
ASTContext Ctx;
public:
DeadStoreObserver(Preprocessor& pp) :
- PP(pp), Ctx(PP.getTargetInfo(), PP.getIdentifierTable()) {}
+ PP(pp), Ctx(PP.getSourceManager(), PP.getTargetInfo(),
+ PP.getIdentifierTable()) {
+ }
virtual ~DeadStoreObserver() {}
Modified: cfe/trunk/Driver/ASTStreamers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTStreamers.cpp?rev=41906&r1=41905&r2=41906&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTStreamers.cpp (original)
+++ cfe/trunk/Driver/ASTStreamers.cpp Wed Sep 12 20:14:03 2007
@@ -27,7 +27,8 @@
Stmt::CollectingStats(true);
}
- ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
+ ASTContext Context(PP.getSourceManager(), PP.getTargetInfo(),
+ PP.getIdentifierTable());
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
while (ASTStreamer_ReadTopLevelDecl(Streamer))
@@ -106,7 +107,8 @@
}
void clang::PrintASTs(Preprocessor &PP, unsigned MainFileID, bool Stats) {
- ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
+ ASTContext Context(PP.getSourceManager(), PP.getTargetInfo(),
+ PP.getIdentifierTable());
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
while (Decl *D = ASTStreamer_ReadTopLevelDecl(Streamer)) {
@@ -137,7 +139,8 @@
}
void clang::DumpASTs(Preprocessor &PP, unsigned MainFileID, bool Stats) {
- ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
+ ASTContext Context(PP.getSourceManager(), PP.getTargetInfo(),
+ PP.getIdentifierTable());
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
while (Decl *D = ASTStreamer_ReadTopLevelDecl(Streamer)) {
@@ -184,7 +187,8 @@
unsigned MainFileID, bool Stats) {
bool printFDecl = Visitor.printFuncDeclStart();
- ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
+ ASTContext Context(PP.getSourceManager(), PP.getTargetInfo(),
+ PP.getIdentifierTable());
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
while (Decl *D = ASTStreamer_ReadTopLevelDecl(Streamer)) {
Modified: cfe/trunk/Driver/LLVMCodegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/LLVMCodegen.cpp?rev=41906&r1=41905&r2=41906&view=diff
==============================================================================
--- cfe/trunk/Driver/LLVMCodegen.cpp (original)
+++ cfe/trunk/Driver/LLVMCodegen.cpp Wed Sep 12 20:14:03 2007
@@ -29,7 +29,8 @@
bool PrintStats) {
Diagnostic &Diags = PP.getDiagnostics();
// Create the streamer to read the file.
- ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
+ ASTContext Context(PP.getSourceManager(), PP.getTargetInfo(),
+ PP.getIdentifierTable());
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
// Create the module to codegen into.
Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=41906&r1=41905&r2=41906&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Wed Sep 12 20:14:03 2007
@@ -40,6 +40,7 @@
RecordDecl *CFConstantStringTypeDecl;
llvm::StringMap<char> SelectorNames;
public:
+ SourceManager &SourceMgr;
TargetInfo &Target;
IdentifierTable &Idents;
Builtin::Context BuiltinInfo;
@@ -54,8 +55,8 @@
QualType FloatTy, DoubleTy, LongDoubleTy;
QualType FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy;
- ASTContext(TargetInfo &t, IdentifierTable &idents) :
- CFConstantStringTypeDecl(0), Target(t), Idents(idents) {
+ ASTContext(SourceManager &SM, TargetInfo &t, IdentifierTable &idents) :
+ CFConstantStringTypeDecl(0), SourceMgr(SM), Target(t), Idents(idents) {
InitBuiltinTypes();
BuiltinInfo.InitializeBuiltins(idents, Target);
}
More information about the cfe-commits
mailing list