diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-09-26 20:14:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-09-26 20:14:22 +0000 |
commit | 9f3d942e9970bc8f51add390b2a2c46b5a2ab747 (patch) | |
tree | a29754e7dfd73c6f7cf374eb249918c5502f3e45 | |
parent | 41193e4464818d5c4809a8a4140bb0bf26d7733f (diff) | |
download | clang-9f3d942e9970bc8f51add390b2a2c46b5a2ab747.tar.gz |
Removed option "-parse-ast-check" from clang driver. This is now implemented
using "-parse-ast -verify".
Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.
Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
44 files changed, 48 insertions, 54 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index f1a5ea92ed..b5c155991a 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -53,7 +53,6 @@ enum ProgActions { ParseASTPrint, // Parse ASTs and print them. ParseASTDump, // Parse ASTs and dump them. ParseASTView, // Parse ASTs and view them in Graphviz. - ParseASTCheck, // Parse ASTs and check diagnostics. BuildAST, // Parse ASTs. ParseCFGDump, // Parse ASTS. Build CFGs. Print CFGs. ParseCFGView, // Parse ASTS. Build CFGs. View CFGs. @@ -93,8 +92,6 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore, "Run parser, build ASTs, then dump them"), clEnumValN(ParseASTView, "parse-ast-view", "Run parser, build ASTs, and view them with GraphViz."), - clEnumValN(ParseASTCheck, "parse-ast-check", - "Run parser, build ASTs, then check diagnostics"), clEnumValN(ParseCFGDump, "dump-cfg", "Run parser, then build and print CFGs."), clEnumValN(ParseCFGView, "view-cfg", @@ -809,7 +806,6 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID, ASTConsumer* Consumer = NULL; bool ClearSourceMgr = false; - bool PerformDiagnosticsCheck = VerifyDiagnostics; switch (ProgAction) { default: @@ -853,8 +849,6 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID, ClearSourceMgr = true; break; - case ParseASTCheck: - PerformDiagnosticsCheck = true; case ParseSyntaxOnly: // -fsyntax-only case BuildAST: Consumer = new ASTConsumer(); @@ -895,7 +889,7 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID, } if (Consumer) { - if (PerformDiagnosticsCheck) + if (VerifyDiagnostics) exit (CheckASTConsumer(PP, MainFileID, Consumer)); else ParseAST(PP, MainFileID, *Consumer, Stats); @@ -948,7 +942,7 @@ int main(int argc, char **argv) { InitializeLanguageStandard(LangInfo); std::auto_ptr<TextDiagnostics> DiagClient; - if (ProgAction != ParseASTCheck) { + if (!VerifyDiagnostics) { // Print diagnostics to stderr by default. DiagClient.reset(new TextDiagnosticPrinter(SourceMgr)); } else { @@ -957,7 +951,7 @@ int main(int argc, char **argv) { if (InputFilenames.size() != 1) { fprintf(stderr, - "parse-ast-check only works on single input files for now.\n"); + "-verify only works on single input files for now.\n"); return 1; } } diff --git a/test/Lexer/block_cmt_end.c b/test/Lexer/block_cmt_end.c index 20d9045221..444500d03d 100644 --- a/test/Lexer/block_cmt_end.c +++ b/test/Lexer/block_cmt_end.c @@ -3,7 +3,7 @@ RUN: clang -E %s | grep foo && RUN: clang -E %s | not grep abc && RUN: clang -E %s | not grep xyz && - RUN: clang -parse-ast-check %s + RUN: clang -parse-ast -verify %s */ // This is a simple comment, /*/ does not end a comment, the trailing */ does. diff --git a/test/Lexer/constants.c b/test/Lexer/constants.c index f7e4cd02fb..5d0f301b8d 100644 --- a/test/Lexer/constants.c +++ b/test/Lexer/constants.c @@ -1,4 +1,4 @@ -/* RUN: clang -parse-ast-check %s +/* RUN: clang -parse-ast -verify %s */ int x = 000000080; /* expected-error {{invalid digit}} */ diff --git a/test/Lexer/cxx0x_keyword.cpp b/test/Lexer/cxx0x_keyword.cpp index f3a8a7add2..267416af28 100644 --- a/test/Lexer/cxx0x_keyword.cpp +++ b/test/Lexer/cxx0x_keyword.cpp @@ -1,2 +1,2 @@ -// RUN: clang -parse-ast-check -std=c++0x %s 2>&1 +// RUN: clang -parse-ast -verify -std=c++0x %s 2>&1 int static_assert; /* expected-error {{expected identifier or '('}}} */ diff --git a/test/Misc/diag-checker.c b/test/Misc/diag-checker.c index 2aa5051d8b..c988ccb977 100644 --- a/test/Misc/diag-checker.c +++ b/test/Misc/diag-checker.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s #include <stdio.h> diff --git a/test/Parser/CompoundStmtScope.c b/test/Parser/CompoundStmtScope.c index d6a4730632..4d1da43e25 100644 --- a/test/Parser/CompoundStmtScope.c +++ b/test/Parser/CompoundStmtScope.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int foo() { { diff --git a/test/Parser/argument_redef.c b/test/Parser/argument_redef.c index c3dae512a3..2dce5ab4bd 100644 --- a/test/Parser/argument_redef.c +++ b/test/Parser/argument_redef.c @@ -1,4 +1,4 @@ -/* RUN: clang -parse-ast-check %s +/* RUN: clang -parse-ast -verify %s */ int foo(int A) { /* expected-error {{previous definition is here}} */ diff --git a/test/Parser/attributes.c b/test/Parser/attributes.c index 6815df72b8..ecd1237aad 100644 --- a/test/Parser/attributes.c +++ b/test/Parser/attributes.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s -pedantic +// RUN: clang -parse-ast -verify %s -pedantic static __inline void __attribute__((__always_inline__, __nodebug__)) // expected-warning {{extension used}} foo (void) diff --git a/test/Parser/bad-control.c b/test/Parser/bad-control.c index 914393461a..caad1f19c9 100644 --- a/test/Parser/bad-control.c +++ b/test/Parser/bad-control.c @@ -1,4 +1,4 @@ -/* RUN: clang -parse-ast-check %s +/* RUN: clang -parse-ast -verify %s */ int foo() { break; /* expected-error {{'break' statement not in loop or switch statement}} */ diff --git a/test/Parser/builtin_classify_type.c b/test/Parser/builtin_classify_type.c index 87b8bb64de..500c16adc3 100644 --- a/test/Parser/builtin_classify_type.c +++ b/test/Parser/builtin_classify_type.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s struct foo { int a; }; diff --git a/test/Parser/builtin_types_compatible.c b/test/Parser/builtin_types_compatible.c index ed7ea2cc5d..096b400697 100644 --- a/test/Parser/builtin_types_compatible.c +++ b/test/Parser/builtin_types_compatible.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s extern int funcInt(int); extern float funcFloat(float); diff --git a/test/Parser/check_cast.c b/test/Parser/check_cast.c index 806cb800fc..8c329fcc99 100644 --- a/test/Parser/check_cast.c +++ b/test/Parser/check_cast.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s struct foo { int a; }; diff --git a/test/Parser/compound_literal.c b/test/Parser/compound_literal.c index ef4576d18f..a5383cc40f 100644 --- a/test/Parser/compound_literal.c +++ b/test/Parser/compound_literal.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int main() { char *s; s = (char []){"whatever"}; diff --git a/test/Parser/cxx-reference.cpp b/test/Parser/cxx-reference.cpp index 44a2a03c9c..955437916e 100644 --- a/test/Parser/cxx-reference.cpp +++ b/test/Parser/cxx-reference.cpp @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s extern char *bork; char *& bar = bork; diff --git a/test/Parser/goto-ident.c b/test/Parser/goto-ident.c index 0dc7f4ec40..7231445c79 100644 --- a/test/Parser/goto-ident.c +++ b/test/Parser/goto-ident.c @@ -1,4 +1,4 @@ -/* RUN: clang -parse-ast-check %s +/* RUN: clang -parse-ast -verify %s */ void foo() { diff --git a/test/Parser/if-scope-c90.c b/test/Parser/if-scope-c90.c index 6040281cb0..1623eb0009 100644 --- a/test/Parser/if-scope-c90.c +++ b/test/Parser/if-scope-c90.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check --std=c90 %s +// RUN: clang -parse-ast -verify --std=c90 %s int f (int z) { diff --git a/test/Parser/if-scope-c99.c b/test/Parser/if-scope-c99.c index 6547e6f09f..c6ce9b6873 100644 --- a/test/Parser/if-scope-c99.c +++ b/test/Parser/if-scope-c99.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check --std=c99 %s +// RUN: clang -parse-ast -verify --std=c99 %s int f (int z) { diff --git a/test/Parser/implicit-casts.c b/test/Parser/implicit-casts.c index 4ba56e4191..320370dbfc 100644 --- a/test/Parser/implicit-casts.c +++ b/test/Parser/implicit-casts.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s _Complex double X; void test1(int c) { X = 5; diff --git a/test/Parser/ocu_vector_components.c b/test/Parser/ocu_vector_components.c index 26627b85e8..a47b9a8c96 100644 --- a/test/Parser/ocu_vector_components.c +++ b/test/Parser/ocu_vector_components.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s typedef __attribute__(( ocu_vector_type(2) )) float float2; typedef __attribute__(( ocu_vector_type(3) )) float float3; diff --git a/test/Parser/parmvardecl_conversion.c b/test/Parser/parmvardecl_conversion.c index 5fb95280ff..a3e2499b2e 100644 --- a/test/Parser/parmvardecl_conversion.c +++ b/test/Parser/parmvardecl_conversion.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s void f (int p[]) { p++; } diff --git a/test/Parser/pointer-arithmetic.c b/test/Parser/pointer-arithmetic.c index 7c7e3ad042..4403d20c11 100644 --- a/test/Parser/pointer-arithmetic.c +++ b/test/Parser/pointer-arithmetic.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int *test1(int *a) { return a + 1; } int *test2(int *a) { return 1 + a; } diff --git a/test/Parser/pointer_promotion.c b/test/Parser/pointer_promotion.c index 18cd9687b7..9d9a526567 100644 --- a/test/Parser/pointer_promotion.c +++ b/test/Parser/pointer_promotion.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int test() { void *vp; diff --git a/test/Parser/recovery-1.c b/test/Parser/recovery-1.c index f40eb6278a..a098aecfc9 100644 --- a/test/Parser/recovery-1.c +++ b/test/Parser/recovery-1.c @@ -1,5 +1,5 @@ // RUN: clang -fsyntax-only -fno-caret-diagnostics -pedantic %s 2>&1 | grep warning | wc -l | grep 1 -// RUN: clang -parse-ast-check -pedantic %s +// RUN: clang -parse-ast -verify -pedantic %s char (((( /* expected-error {{to match this '('}} */ *X x ] )))); /* expected-error {{expected ')'}} */ diff --git a/test/Parser/typeof.c b/test/Parser/typeof.c index 14025e5809..e1fd6e4edb 100644 --- a/test/Parser/typeof.c +++ b/test/Parser/typeof.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s typedef int TInt; diff --git a/test/Sema/arg-duplicate.c b/test/Sema/arg-duplicate.c index 5d44a72ecb..324e9fa271 100644 --- a/test/Sema/arg-duplicate.c +++ b/test/Sema/arg-duplicate.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s typedef int x; int f3(y, x, diff --git a/test/Sema/arg-invalid.c b/test/Sema/arg-invalid.c index 1eae26c5ae..29b51f4d88 100644 --- a/test/Sema/arg-invalid.c +++ b/test/Sema/arg-invalid.c @@ -1,4 +1,4 @@ -// RUN: clang %s -parse-ast-check +// RUN: clang %s -parse-ast -verify void bar (void *); void f11 (z) // expected-error {{may not have 'void' type}} diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c index 867d4e7cbf..0533a8407e 100644 --- a/test/Sema/array-constraint.c +++ b/test/Sema/array-constraint.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check -pedantic %s +// RUN: clang -parse-ast -verify -pedantic %s struct s; struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}} diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c index 5eed259dff..0986354e27 100644 --- a/test/Sema/array-init.c +++ b/test/Sema/array-init.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check -pedantic %s +// RUN: clang -parse-ast -verify -pedantic %s extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}} diff --git a/test/Sema/assign.c b/test/Sema/assign.c index 47fee3e38e..efeaffbee8 100644 --- a/test/Sema/assign.c +++ b/test/Sema/assign.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s void *test1(void) { return 0; } diff --git a/test/Sema/c89.c b/test/Sema/c89.c index fc38909a51..87ac4fbb4a 100644 --- a/test/Sema/c89.c +++ b/test/Sema/c89.c @@ -1,4 +1,4 @@ -/* RUN: clang %s -std=c89 -pedantic -parse-ast-check +/* RUN: clang %s -std=c89 -pedantic -parse-ast -verify */ void test1() { { diff --git a/test/Sema/cfstring.c b/test/Sema/cfstring.c index 41181eaa8b..f9fdf3ac43 100644 --- a/test/Sema/cfstring.c +++ b/test/Sema/cfstring.c @@ -1,6 +1,6 @@ #define CFSTR __builtin___CFStringMakeConstantString -// RUN: clang %s -parse-ast-check +// RUN: clang %s -parse-ast -verify void f() { CFSTR("\242"); // expected-warning { CFString literal contains non-ASCII character } CFSTR("\0"); // expected-warning { CFString literal contains NUL character } diff --git a/test/Sema/compare.c b/test/Sema/compare.c index d4e29e8674..b31ace62bd 100644 --- a/test/Sema/compare.c +++ b/test/Sema/compare.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int test(char *C) { // nothing here should warn. return C != ((void*)0); diff --git a/test/Sema/decl-invalid.c b/test/Sema/decl-invalid.c index dda6601dc9..61ad861fa8 100644 --- a/test/Sema/decl-invalid.c +++ b/test/Sema/decl-invalid.c @@ -1,3 +1,3 @@ -// RUN: clang %s -parse-ast-check +// RUN: clang %s -parse-ast -verify typedef union <anonymous> __mbstate_t; // expected-error: {{expected identifier or}} diff --git a/test/Sema/default.c b/test/Sema/default.c index e714effde2..b51ab9a55c 100644 --- a/test/Sema/default.c +++ b/test/Sema/default.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s void f5 (int z) { if (z) diff --git a/test/Sema/enum.c b/test/Sema/enum.c index 1ba3977a78..1787c4b6f8 100644 --- a/test/Sema/enum.c +++ b/test/Sema/enum.c @@ -1,4 +1,4 @@ -// RUN: clang %s -parse-ast-check -pedantic +// RUN: clang %s -parse-ast -verify -pedantic enum e {A, B = 42LL << 32, // expected-warning {{ISO C restricts enumerator values to range of 'int'}} diff --git a/test/Sema/floating-point-compare.c b/test/Sema/floating-point-compare.c index 008bedf977..0c84da26b0 100644 --- a/test/Sema/floating-point-compare.c +++ b/test/Sema/floating-point-compare.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int foo(float x, float y) { return x == y; // expected-warning {{comparing floating point with ==}} @@ -6,4 +6,4 @@ int foo(float x, float y) { int bar(float x, float y) { return x != y; // expected-warning {{comparing floating point with ==}} -}
\ No newline at end of file +} diff --git a/test/Sema/for.c b/test/Sema/for.c index 9004d9f41c..42932f6e14 100644 --- a/test/Sema/for.c +++ b/test/Sema/for.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s // Check C99 6.8.5p3 void b1 (void) { for (void (*f) (void);;); } diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index 403da07b0f..be2706e4aa 100644 --- a/test/Sema/format-strings.c +++ b/test/Sema/format-strings.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s #include <stdio.h> #include <stdarg.h> diff --git a/test/Sema/offsetof.c b/test/Sema/offsetof.c index 5848ba4083..14b1440f5e 100644 --- a/test/Sema/offsetof.c +++ b/test/Sema/offsetof.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) diff --git a/test/Sema/return-stack-addr.cpp b/test/Sema/return-stack-addr.cpp index ce4c41bf7a..2e384a1bca 100644 --- a/test/Sema/return-stack-addr.cpp +++ b/test/Sema/return-stack-addr.cpp @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int* ret_local() { @@ -110,4 +110,4 @@ int* ret_cpp_const_cast(const x) { } // TODO: test case for dynamic_cast. clang does not yet have -// support for C++ classes to write such a test case.
\ No newline at end of file +// support for C++ classes to write such a test case. diff --git a/test/Sema/switch-duplicate-defaults.c b/test/Sema/switch-duplicate-defaults.c index 31d46a1bbc..d552c54d57 100644 --- a/test/Sema/switch-duplicate-defaults.c +++ b/test/Sema/switch-duplicate-defaults.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s void f (int z) { switch(z) { diff --git a/test/Sema/switch.c b/test/Sema/switch.c index eacd3c2850..b66695bc72 100644 --- a/test/Sema/switch.c +++ b/test/Sema/switch.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s void f (int z) { while (z) { diff --git a/test/Sema/typedef-retain.c b/test/Sema/typedef-retain.c index 341252ff65..121e716844 100644 --- a/test/Sema/typedef-retain.c +++ b/test/Sema/typedef-retain.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s typedef float float4 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); diff --git a/test/Sema/unused-expr.c b/test/Sema/unused-expr.c index e9e2992d0a..d398e74d2b 100644 --- a/test/Sema/unused-expr.c +++ b/test/Sema/unused-expr.c @@ -1,4 +1,4 @@ -// RUN: clang -parse-ast-check %s +// RUN: clang -parse-ast -verify %s int foo(int X, int Y); |