зеркало из https://github.com/microsoft/clang-1.git
rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump remove -parse-ast, which is redundant with -fsyntax-only git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
22b73ba6c6
Коммит
3b427b3ba5
|
@ -50,10 +50,9 @@ Stats("stats", llvm::cl::desc("Print performance metrics and statistics"));
|
|||
|
||||
enum ProgActions {
|
||||
EmitLLVM, // Emit a .ll file.
|
||||
ParseASTPrint, // Parse ASTs and print them.
|
||||
ParseASTDump, // Parse ASTs and dump them.
|
||||
ParseASTView, // Parse ASTs and view them in Graphviz.
|
||||
BuildAST, // Parse ASTs.
|
||||
ASTPrint, // Parse ASTs and print them.
|
||||
ASTDump, // Parse ASTs and dump them.
|
||||
ASTView, // Parse ASTs and view them in Graphviz.
|
||||
ParseCFGDump, // Parse ASTS. Build CFGs. Print CFGs.
|
||||
ParseCFGView, // Parse ASTS. Build CFGs. View CFGs.
|
||||
AnalysisLiveVariables, // Print results of live-variable analysis.
|
||||
|
@ -84,14 +83,12 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore,
|
|||
"Run parser and perform semantic analysis"),
|
||||
clEnumValN(ParsePrintCallbacks, "parse-print-callbacks",
|
||||
"Run parser and print each callback invoked"),
|
||||
clEnumValN(BuildAST, "parse-ast",
|
||||
"Run parser and build ASTs"),
|
||||
clEnumValN(ParseASTPrint, "parse-ast-print",
|
||||
"Run parser, build ASTs, then print ASTs"),
|
||||
clEnumValN(ParseASTDump, "parse-ast-dump",
|
||||
"Run parser, build ASTs, then dump them"),
|
||||
clEnumValN(ParseASTView, "parse-ast-view",
|
||||
"Run parser, build ASTs, and view them with GraphViz."),
|
||||
clEnumValN(ASTPrint, "ast-print",
|
||||
"Build ASTs and then pretty-print them"),
|
||||
clEnumValN(ASTDump, "ast-dump",
|
||||
"Build ASTs and then debug dump them"),
|
||||
clEnumValN(ASTView, "parse-ast-view",
|
||||
"Build ASTs and view them with GraphViz."),
|
||||
clEnumValN(ParseCFGDump, "dump-cfg",
|
||||
"Run parser, then build and print CFGs."),
|
||||
clEnumValN(ParseCFGView, "view-cfg",
|
||||
|
@ -764,19 +761,18 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID,
|
|||
break;
|
||||
|
||||
case ParseSyntaxOnly: // -fsyntax-only
|
||||
case BuildAST:
|
||||
Consumer = new ASTConsumer();
|
||||
break;
|
||||
|
||||
case ParseASTPrint:
|
||||
case ASTPrint:
|
||||
Consumer = CreateASTPrinter();
|
||||
break;
|
||||
|
||||
case ParseASTDump:
|
||||
case ASTDump:
|
||||
Consumer = CreateASTDumper();
|
||||
break;
|
||||
|
||||
case ParseASTView:
|
||||
case ASTView:
|
||||
Consumer = CreateASTViewer();
|
||||
break;
|
||||
|
||||
|
|
|
@ -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 -verify %s
|
||||
RUN: clang -fsyntax-only -verify %s
|
||||
*/
|
||||
|
||||
// This is a simple comment, /*/ does not end a comment, the trailing */ does.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang -parse-ast -verify %s
|
||||
/* RUN: clang -fsyntax-only -verify %s
|
||||
*/
|
||||
|
||||
int x = 000000080; /* expected-error {{invalid digit}} */
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
// RUN: clang -parse-ast -verify -std=c++0x %s 2>&1
|
||||
// RUN: clang -fsyntax-only -verify -std=c++0x %s 2>&1
|
||||
int static_assert; /* expected-error {{expected identifier or '('}}} */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
int foo() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang -parse-ast -verify %s
|
||||
/* RUN: clang -fsyntax-only -verify %s
|
||||
*/
|
||||
|
||||
int foo(int A) { /* expected-error {{previous definition is here}} */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s -pedantic
|
||||
// RUN: clang -fsyntax-only -verify %s -pedantic
|
||||
|
||||
static __inline void __attribute__((__always_inline__, __nodebug__)) // expected-warning {{extension used}}
|
||||
foo (void)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang -parse-ast -verify %s
|
||||
/* RUN: clang -fsyntax-only -verify %s
|
||||
*/
|
||||
int foo() {
|
||||
break; /* expected-error {{'break' statement not in loop or switch statement}} */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
struct foo { int a; };
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
extern int funcInt(int);
|
||||
extern float funcFloat(float);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast-print %s
|
||||
// RUN: clang -ast-print %s
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
struct foo {
|
||||
int a;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
int main() {
|
||||
char *s;
|
||||
s = (char []){"whatever"};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
extern char *bork;
|
||||
char *& bar = bork;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang %s -parse-ast-print
|
||||
/* RUN: clang %s -ast-print
|
||||
*/
|
||||
|
||||
void foo() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang -parse-ast -verify %s
|
||||
/* RUN: clang -fsyntax-only -verify %s
|
||||
*/
|
||||
|
||||
void foo() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify --std=c90 %s
|
||||
// RUN: clang -fsyntax-only -verify --std=c90 %s
|
||||
|
||||
int f (int z)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify --std=c99 %s
|
||||
// RUN: clang -fsyntax-only -verify --std=c99 %s
|
||||
|
||||
int f (int z)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
_Complex double X;
|
||||
void test1(int c) {
|
||||
X = 5;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
typedef __attribute__(( ocu_vector_type(2) )) float float2;
|
||||
typedef __attribute__(( ocu_vector_type(3) )) float float3;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
void f (int p[]) { p++; }
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
int *test1(int *a) { return a + 1; }
|
||||
int *test2(int *a) { return 1 + a; }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
int test() {
|
||||
void *vp;
|
||||
|
|
|
@ -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 -verify -pedantic %s
|
||||
// RUN: clang -fsyntax-only -verify -pedantic %s
|
||||
|
||||
char (((( /* expected-error {{to match this '('}} */
|
||||
*X x ] )))); /* expected-error {{expected ')'}} */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
typedef int TInt;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
typedef int x;
|
||||
int f3(y, x,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang %s -parse-ast -verify
|
||||
// RUN: clang %s -fsyntax-only -verify
|
||||
|
||||
void bar (void *);
|
||||
void f11 (z) // expected-error {{may not have 'void' type}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify -pedantic %s
|
||||
// RUN: clang -fsyntax-only -verify -pedantic %s
|
||||
|
||||
struct s;
|
||||
struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify -pedantic %s
|
||||
// RUN: clang -fsyntax-only -verify -pedantic %s
|
||||
|
||||
extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
void *test1(void) { return 0; }
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang %s -std=c89 -pedantic -parse-ast -verify
|
||||
/* RUN: clang %s -std=c89 -pedantic -fsyntax-only -verify
|
||||
*/
|
||||
void test1() {
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define CFSTR __builtin___CFStringMakeConstantString
|
||||
|
||||
// RUN: clang %s -parse-ast -verify
|
||||
// RUN: clang %s -fsyntax-only -verify
|
||||
void f() {
|
||||
CFSTR("\242"); // expected-warning { CFString literal contains non-ASCII character }
|
||||
CFSTR("\0"); // expected-warning { CFString literal contains NUL character }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
int test(char *C) { // nothing here should warn.
|
||||
return C != ((void*)0);
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
// RUN: clang %s -parse-ast -verify
|
||||
// RUN: clang %s -fsyntax-only -verify
|
||||
|
||||
typedef union <anonymous> __mbstate_t; // expected-error: {{expected identifier or}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
void f5 (int z) {
|
||||
if (z)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang %s -parse-ast -verify -pedantic
|
||||
// RUN: clang %s -fsyntax-only -verify -pedantic
|
||||
|
||||
enum e {A,
|
||||
B = 42LL << 32, // expected-warning {{ISO C restricts enumerator values to range of 'int'}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
int foo(float x, float y) {
|
||||
return x == y; // expected-warning {{comparing floating point with ==}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
// Check C99 6.8.5p3
|
||||
void b1 (void) { for (void (*f) (void);;); }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang %s -parse-ast -verify
|
||||
// RUN: clang %s -fsyntax-only -verify
|
||||
|
||||
id obj; // expected-error{{expected '=', ',', ';', 'asm', or '__attribute__' after declarator}}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
void f1(int a) {
|
||||
if (a); // expected-warning {{if statement has empty body}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* RUN: clang -parse-ast %s -std=c89 &&
|
||||
* RUN: not clang -parse-ast %s -std=c99 -pedantic-errors
|
||||
/* RUN: clang -fsyntax-only %s -std=c89 &&
|
||||
* RUN: not clang -fsyntax-only %s -std=c99 -pedantic-errors
|
||||
*/
|
||||
|
||||
int A() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
|
||||
int* ret_local() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang %s -parse-ast
|
||||
// RUN: clang %s -fsyntax-only
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
struct D {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
void f (int z) {
|
||||
switch(z) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
void f (int z) {
|
||||
while (z) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
typedef float float4 __attribute__((vector_size(16)));
|
||||
typedef int int4 __attribute__((vector_size(16)));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang -parse-ast -verify %s
|
||||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
int foo(int X, int Y);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* RUN: clang -parse-ast %s 2>&1 | grep '6 diagnostics'
|
||||
/* RUN: clang -fsyntax-only %s 2>&1 | grep '6 diagnostics'
|
||||
*/
|
||||
|
||||
typedef void Void;
|
||||
|
|
Загрузка…
Ссылка в новой задаче