Skip to content

Commit 9fe24d7

Browse files
committed
for now -fsyntax-only builds all the AST's but doesn't print them.
llvm-svn: 39129
1 parent c95c8f2 commit 9fe24d7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

clang/Driver/clang.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,16 @@ static void ParseFile(Preprocessor &PP, Action *PA, unsigned MainFileID) {
784784
// ASTStreamer drivers
785785
//===----------------------------------------------------------------------===//
786786

787+
static void BuildASTs(Preprocessor &PP, unsigned MainFileID) {
788+
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, MainFileID);
789+
790+
while (ASTStreamer_ReadTopLevelDecl(Streamer))
791+
/* keep reading */;
792+
793+
ASTStreamer_Terminate(Streamer);
794+
}
795+
796+
787797
static void PrintASTs(Preprocessor &PP, unsigned MainFileID) {
788798
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, MainFileID);
789799

@@ -804,6 +814,7 @@ static void PrintASTs(Preprocessor &PP, unsigned MainFileID) {
804814
ASTStreamer_Terminate(Streamer);
805815
}
806816

817+
807818
//===----------------------------------------------------------------------===//
808819
// Main driver
809820
//===----------------------------------------------------------------------===//
@@ -937,7 +948,7 @@ int main(int argc, char **argv) {
937948
PrintASTs(PP, MainFileID);
938949
break;
939950
case ParseSyntaxOnly: // -fsyntax-only
940-
ParseFile(PP, new EmptyAction(), MainFileID);
951+
BuildASTs(PP, MainFileID);
941952
break;
942953
}
943954

0 commit comments

Comments
 (0)