[cfe-commits] r39129 - /cfe/cfe/trunk/Driver/clang.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:27:50 PDT 2007
Author: sabre
Date: Wed Jul 11 11:27:50 2007
New Revision: 39129
URL: http://llvm.org/viewvc/llvm-project?rev=39129&view=rev
Log:
for now -fsyntax-only builds all the AST's but doesn't print them.
Modified:
cfe/cfe/trunk/Driver/clang.cpp
Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39129&r1=39128&r2=39129&view=diff
==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:27:50 2007
@@ -784,6 +784,16 @@
// ASTStreamer drivers
//===----------------------------------------------------------------------===//
+static void BuildASTs(Preprocessor &PP, unsigned MainFileID) {
+ ASTStreamerTy *Streamer = ASTStreamer_Init(PP, MainFileID);
+
+ while (ASTStreamer_ReadTopLevelDecl(Streamer))
+ /* keep reading */;
+
+ ASTStreamer_Terminate(Streamer);
+}
+
+
static void PrintASTs(Preprocessor &PP, unsigned MainFileID) {
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, MainFileID);
@@ -804,6 +814,7 @@
ASTStreamer_Terminate(Streamer);
}
+
//===----------------------------------------------------------------------===//
// Main driver
//===----------------------------------------------------------------------===//
@@ -937,7 +948,7 @@
PrintASTs(PP, MainFileID);
break;
case ParseSyntaxOnly: // -fsyntax-only
- ParseFile(PP, new EmptyAction(), MainFileID);
+ BuildASTs(PP, MainFileID);
break;
}
More information about the cfe-commits
mailing list