[cfe-commits] r81346 [6/6] - in /cfe/trunk: include/clang/AST/ include/clang/Analysis/ include/clang/Analysis/Analyses/ include/clang/Analysis/FlowSensitive/ include/clang/Analysis/PathSensitive/ include/clang/Analysis/Support/ include/clang/Analysis/Visitors/ include/clang/Basic/ include/clang/CodeGen/ include/clang/Driver/ include/clang/Frontend/ include/clang/Index/ include/clang/Lex/ include/clang/Parse/ include/clang/Rewrite/ include/clang/Sema/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Front...
Mike Stump
mrs at apple.com
Wed Sep 9 08:08:16 PDT 2009
Modified: cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp Wed Sep 9 10:08:12 2009
@@ -7,9 +7,9 @@
struct C {
- C() : iC(6) {printf("C()\n"); }
- C(const C& c) { printf("C(const C& c)\n"); }
- int iC;
+ C() : iC(6) {printf("C()\n"); }
+ C(const C& c) { printf("C(const C& c)\n"); }
+ int iC;
};
C foo() {
@@ -18,10 +18,10 @@
class X { // ...
public:
- X(int) {}
- X(const X&, int i = 1, int j = 2, C c = foo()) {
- printf("X(const X&, %d, %d, %d)\n", i, j, c.iC);
- }
+ X(int) {}
+ X(const X&, int i = 1, int j = 2, C c = foo()) {
+ printf("X(const X&, %d, %d, %d)\n", i, j, c.iC);
+ }
};
@@ -33,12 +33,11 @@
void Call(S) {};
-int main()
-{
- X a(1);
- X b(a, 2);
- X c = b;
- X d(a, 5, 6);
- S s;
- Call(s);
+int main() {
+ X a(1);
+ X b(a, 2);
+ X c = b;
+ X d(a, 5, 6);
+ S s;
+ Call(s);
}
Modified: cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp Wed Sep 9 10:08:12 2009
@@ -26,35 +26,36 @@
struct X : M, N, P { // ...
- X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
- au_i1(1234), au1_4("MASKED") {}
- P p0;
- void pr() { printf("iM = %d iN = %d, m1.iM = %d\n", iM, iN, m1.iM);
- printf("im = %d p0.iP = %d, p1.iP = %d\n", iP, p0.iP, p1.iP);
- printf("f1 = %f d1 = %f i1 = %d name(%s) \n", f1, d1, i1, name);
- printf("bf1 = %x bf2 = %x\n", bf1, bf2);
- printf("au_i2 = %d\n", au_i2);
- printf("au1_1 = %s\n", au1_1);
- }
- M m1;
- P p1;
- float f1;
- double d1;
- int i1;
- const char *name;
- unsigned bf1 : 8;
- unsigned bf2 : 16;
-
- union {
- int au_i1;
- int au_i2;
- };
- union {
- const char * au1_1;
- float au1_2;
- int au1_3;
- const char * au1_4;
- };
+ X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
+ au_i1(1234), au1_4("MASKED") {}
+ P p0;
+ void pr() {
+ printf("iM = %d iN = %d, m1.iM = %d\n", iM, iN, m1.iM);
+ printf("im = %d p0.iP = %d, p1.iP = %d\n", iP, p0.iP, p1.iP);
+ printf("f1 = %f d1 = %f i1 = %d name(%s) \n", f1, d1, i1, name);
+ printf("bf1 = %x bf2 = %x\n", bf1, bf2);
+ printf("au_i2 = %d\n", au_i2);
+ printf("au1_1 = %s\n", au1_1);
+ }
+ M m1;
+ P p1;
+ float f1;
+ double d1;
+ int i1;
+ const char *name;
+ unsigned bf1 : 8;
+ unsigned bf2 : 16;
+
+ union {
+ int au_i1;
+ int au_i2;
+ };
+ union {
+ const char * au1_1;
+ float au1_2;
+ int au1_3;
+ const char * au1_4;
+ };
};
static int ix = 1;
@@ -87,19 +88,19 @@
I ARR_I[3][2];
};
-int main()
-{
- X a;
- X b(a);
- b.pr();
- X x;
- X c(x);
- c.pr();
-
- XM m0;
- XM m1 = m0;
- m1.pr();
+int main() {
+ X a;
+ X b(a);
+ b.pr();
+ X x;
+ X c(x);
+ c.pr();
+
+ XM m0;
+ XM m1 = m0;
+ m1.pr();
}
+
// CHECK-LP64: .globl __ZN1XC1ERK1X
// CHECK-LP64: .weak_definition __ZN1XC1ERK1X
// CHECK-LP64: __ZN1XC1ERK1X:
Modified: cfe/trunk/test/CodeGenCXX/default-constructor-for-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-constructor-for-members.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-constructor-for-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/default-constructor-for-members.cpp Wed Sep 9 10:08:12 2009
@@ -19,6 +19,6 @@
M m1;
}
-// CHECK-LP64: call __ZN1SC1Ev
+// CHECK-LP64: call __ZN1SC1Ev
-// CHECK-LP32: call L__ZN1SC1Ev
+// CHECK-LP32: call L__ZN1SC1Ev
Modified: cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp Wed Sep 9 10:08:12 2009
@@ -46,15 +46,15 @@
int main() {M m1;}
-// CHECK-LP64: call __ZN1MC1Ev
-// CHECK-LP64: call __ZN1MD1Ev
-// CHECK-LP64: .globl __ZN1MD1Ev
-// CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev
-// CHECK-LP64-NEXT: __ZN1MD1Ev:
+// CHECK-LP64: call __ZN1MC1Ev
+// CHECK-LP64: call __ZN1MD1Ev
+// CHECK-LP64: .globl __ZN1MD1Ev
+// CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev
+// CHECK-LP64-NEXT: __ZN1MD1Ev:
-// CHECK-LP32: call L__ZN1MC1Ev
-// CHECK-LP32: call L__ZN1MD1Ev
-// CHECK-LP32: .globl __ZN1MD1Ev
-// CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev
-// CHECK-LP32-NEXT: __ZN1MD1Ev:
+// CHECK-LP32: call L__ZN1MC1Ev
+// CHECK-LP32: call L__ZN1MD1Ev
+// CHECK-LP32: .globl __ZN1MD1Ev
+// CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev
+// CHECK-LP32-NEXT:__ZN1MD1Ev:
Modified: cfe/trunk/test/CodeGenCXX/nested-base-member-access.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/nested-base-member-access.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/nested-base-member-access.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/nested-base-member-access.cpp Wed Sep 9 10:08:12 2009
@@ -35,14 +35,15 @@
struct N : M,P {
N() : M(100), P(200) {}
- void PR() { this->MPR(); this->PPR(); this->QPR();
- IQPR();
- printf("iM = %d\n", iM);
- printf("iP = %d\n", iP);
- printf("iQ = %d\n", iQ);
- printf("iL = %d\n", iL);
- printf("iIQ = %d\n", iIQ);
- }
+ void PR() {
+ this->MPR(); this->PPR(); this->QPR();
+ IQPR();
+ printf("iM = %d\n", iM);
+ printf("iP = %d\n", iP);
+ printf("iQ = %d\n", iQ);
+ printf("iL = %d\n", iL);
+ printf("iIQ = %d\n", iIQ);
+ }
};
int main() {
Modified: cfe/trunk/test/CodeGenCXX/virt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virt.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virt.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virt.cpp Wed Sep 9 10:08:12 2009
@@ -308,7 +308,7 @@
// CHECK-LP32-NEXT: .space 4
// CHECK-LP32: .long 8
// CHECK-LP32 .space 4
-// CHECK-LP32 .space 4 FIXME
+// CHECK-LP32 .space 4 FIXME
// CHECK-LP32: .long 4
// CHECK-LP32-NEXT: .space 4
// CHECK-LP32-NEXT: .space 4
Modified: cfe/trunk/test/Lexer/comment-escape.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/comment-escape.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/comment-escape.c (original)
+++ cfe/trunk/test/Lexer/comment-escape.c Wed Sep 9 10:08:12 2009
@@ -2,5 +2,5 @@
// rdar://6757323
// foo \
-#define blork 32
+#define blork 32
Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.c Wed Sep 9 10:08:12 2009
@@ -9,22 +9,22 @@
typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR;
void * __ptr64 PtrToPtr64(const void *p)
{
- return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
+ return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
}
void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
{
- __asm {
- mov eax, Bit
- mov ecx, Base
- lock bts [ecx], eax
- setc al
- };
+ __asm {
+ mov eax, Bit
+ mov ecx, Base
+ lock bts [ecx], eax
+ setc al
+ };
}
void *_alloca(int);
void foo() {
- __declspec(align(16)) int *buffer = (int *)_alloca(9);
+ __declspec(align(16)) int *buffer = (int *)_alloca(9);
}
typedef bool (__stdcall __stdcall *blarg)(int);
Modified: cfe/trunk/test/Parser/cxx-friend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-friend.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-friend.cpp (original)
+++ cfe/trunk/test/Parser/cxx-friend.cpp Wed Sep 9 10:08:12 2009
@@ -6,7 +6,7 @@
class A {
public:
- void f();
+ void f();
};
friend int x; // expected-error {{'friend' used outside of class}}
Modified: cfe/trunk/test/Parser/cxx-template-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-template-decl.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-template-decl.cpp (original)
+++ cfe/trunk/test/Parser/cxx-template-decl.cpp Wed Sep 9 10:08:12 2009
@@ -50,7 +50,7 @@
// Template parameter shadowing
template<typename T, // expected-note{{template parameter is declared here}}
- typename T> // expected-error{{declaration of 'T' shadows template parameter}}
+ typename T> // expected-error{{declaration of 'T' shadows template parameter}}
void shadow1();
template<typename T> // expected-note{{template parameter is declared here}}
Modified: cfe/trunk/test/Preprocessor/assembler-with-cpp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/assembler-with-cpp.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/assembler-with-cpp.c (original)
+++ cfe/trunk/test/Preprocessor/assembler-with-cpp.c Wed Sep 9 10:08:12 2009
@@ -40,7 +40,7 @@
// rdar://6709206
// RUN: grep "5: expanded (" %t &&
#define M4 expanded
-#define M5() M4 ## (
+#define M5() M4 ## (
5: M5()
Modified: cfe/trunk/test/Sema/array-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/array-init.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/array-init.c (original)
+++ cfe/trunk/test/Sema/array-init.c Wed Sep 9 10:08:12 2009
@@ -144,12 +144,11 @@
static char const yy[5] = "test";
static char const zz[3] = "test"; // expected-warning{{initializer-string for char array is too long}}
-void charArrays()
-{
- static char const test[] = "test";
- int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1];
- static char const test2[] = { "weird stuff" };
- static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}}
+void charArrays() {
+ static char const test[] = "test";
+ int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1];
+ static char const test2[] = { "weird stuff" };
+ static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}}
char* cp[] = { "Hello" };
@@ -230,15 +229,15 @@
// ptrs are constant
struct soft_segment_descriptor {
- long ssd_base;
+ long ssd_base;
};
static int dblfault_tss;
union uniao { int ola; } xpto[1];
struct soft_segment_descriptor gdt_segs[] = {
- {(long) &dblfault_tss},
- { (long)xpto},
+ {(long) &dblfault_tss},
+ { (long)xpto},
};
static void sppp_ipv6cp_up();
Modified: cfe/trunk/test/Sema/attr-deprecated.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-deprecated.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-deprecated.c (original)
+++ cfe/trunk/test/Sema/attr-deprecated.c Wed Sep 9 10:08:12 2009
@@ -21,7 +21,7 @@
// test if attributes propagate to variables
extern int var;
int w() {
- return var; // expected-warning {{'var' is deprecated}}
+ return var; // expected-warning {{'var' is deprecated}}
}
int old_fn() __attribute__ ((deprecated));
Modified: cfe/trunk/test/Sema/block-call.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-call.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-call.c (original)
+++ cfe/trunk/test/Sema/block-call.c Wed Sep 9 10:08:12 2009
@@ -5,51 +5,47 @@
int (^II) (int);
int main() {
int (*FPL) (int) = FP; // C doesn't consider this an error.
-
+
// For Blocks, the ASTContext::typesAreBlockCompatible() makes sure this is an error.
int (^PFR) (int) = IFP; // OK
- PFR = II; // OK
-
- int (^IFP) () = PFR; // OK
-
+ PFR = II; // OK
- const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int (^)()', expected 'int const (^)()'}}
+ int (^IFP) () = PFR; // OK
- const int (^CICC) () = CIC;
+ const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int (^)()', expected 'int const (^)()'}}
- int * const (^IPCC) () = 0;
+ const int (^CICC) () = CIC;
- int * const (^IPCC1) () = IPCC;
+ int * const (^IPCC) () = 0;
- int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *const (^)()', expected 'int *(^)()'}}
+ int * const (^IPCC1) () = IPCC;
- int (^IPCC3) (const int) = PFR;
+ int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *const (^)()', expected 'int *(^)()'}}
+ int (^IPCC3) (const int) = PFR;
- int (^IPCC4) (int, char (^CArg) (double));
+ int (^IPCC4) (int, char (^CArg) (double));
+ int (^IPCC5) (int, char (^CArg) (double)) = IPCC4;
- int (^IPCC5) (int, char (^CArg) (double)) = IPCC4;
+ int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(double))', expected 'int (^)(int, char (^)(float))'}}
- int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(double))', expected 'int (^)(int, char (^)(float))'}}
-
- IPCC2 = 0;
- IPCC2 = 1; // expected-error {{invalid conversion assigning integer 'int', expected block pointer 'int *(^)()'}}
- int (^x)() = 0;
- int (^y)() = 3; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
- int a = 1;
- int (^z)() = a+4; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
+ IPCC2 = 0;
+ IPCC2 = 1; // expected-error {{invalid conversion assigning integer 'int', expected block pointer 'int *(^)()'}}
+ int (^x)() = 0;
+ int (^y)() = 3; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
+ int a = 1;
+ int (^z)() = a+4; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
}
int blah() {
- int (^IFP) (float);
- char (^PCP)(double, double, char);
+ int (^IFP) (float);
+ char (^PCP)(double, double, char);
- IFP(1.0);
- IFP (1.0, 2.0); // expected-error {{too many arguments to block call}}
+ IFP(1.0);
+ IFP (1.0, 2.0); // expected-error {{too many arguments to block call}}
- char ch = PCP(1.0, 2.0, 'a');
- return PCP(1.0, 2.0); // expected-error {{too few arguments to block}}
+ char ch = PCP(1.0, 2.0, 'a');
+ return PCP(1.0, 2.0); // expected-error {{too few arguments to block}}
}
-
Modified: cfe/trunk/test/Sema/block-explicit-return-type.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-explicit-return-type.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-explicit-return-type.c (original)
+++ cfe/trunk/test/Sema/block-explicit-return-type.c Wed Sep 9 10:08:12 2009
@@ -19,42 +19,39 @@
typedef double (^myblock)(int);
double test(myblock I);
-int main()
-{
- __block int x = 1;
- __block int y = 2;
-
- (void)^void *{ return 0; };
-
- (void)^float(float y){ return y; };
-
- (void)^double (float y, double d)
- {
- if (y)
- return d;
- else
- return y;
- };
-
- const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) {
- if (flag)
- return 0;
- if (flag == 1)
- return arg;
- else if (flag == 2)
- return "";
- return arg1;
- };
+int main() {
+ __block int x = 1;
+ __block int y = 2;
+
+ (void)^void *{ return 0; };
+
+ (void)^float(float y){ return y; };
+
+ (void)^double (float y, double d) {
+ if (y)
+ return d;
+ else
+ return y;
+ };
+
+ const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) {
+ if (flag)
+ return 0;
+ if (flag == 1)
+ return arg;
+ else if (flag == 2)
+ return "";
+ return arg1;
+ };
- (void)^PF { return &gf; };
+ (void)^PF { return &gf; };
- some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; });
+ some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; });
- double res = test(^(int z){x = y+z; return (double)z; });
+ double res = test(^(int z){x = y+z; return (double)z; });
}
-void func()
-{
+void func() {
completion_block_t X;
completion_block_t (^blockx)(dispatch_item_t) = ^completion_block_t (dispatch_item_t item) {
@@ -66,7 +63,6 @@
};
blockx = blocky;
-
}
Modified: cfe/trunk/test/Sema/block-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-literal.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-literal.c (original)
+++ cfe/trunk/test/Sema/block-literal.c Wed Sep 9 10:08:12 2009
@@ -12,34 +12,34 @@
int takeintint(int (^C)(int)) { return C(4); }
T somefunction() {
- if (^{ })
- nothing();
+ if (^{ })
+ nothing();
- noop = ^{};
+ noop = ^{};
- noop = ^{printf("\nClosure\n"); };
+ noop = ^{printf("\nClosure\n"); };
- I(^{ });
+ I(^{ });
- return ^{printf("\nClosure\n"); };
+ return ^{printf("\nClosure\n"); };
}
void test2() {
- int x = 4;
+ int x = 4;
- takeblock(^{ printf("%d\n", x); });
+ takeblock(^{ printf("%d\n", x); });
while (1) {
- takeblock(^{
- break; // expected-error {{'break' statement not in loop or switch statement}}
- continue; // expected-error {{'continue' statement not in loop statement}}
- while(1) break; // ok
- goto foo; // expected-error {{goto not allowed}}
- });
+ takeblock(^{
+ break; // expected-error {{'break' statement not in loop or switch statement}}
+ continue; // expected-error {{'continue' statement not in loop statement}}
+ while(1) break; // ok
+ goto foo; // expected-error {{goto not allowed}}
+ });
break;
- }
+ }
-foo:
- takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
+ foo:
+ takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
__block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}}
takeblock(^{ y = 8; });
}
@@ -59,11 +59,11 @@
void myfunc3(const int *x);
void test5() {
- int a;
+ int a;
- myfunc(^(int abcd) {
- myfunc3(&a);
- return 1;
+ myfunc(^(int abcd) {
+ myfunc3(&a);
+ return 1;
});
}
Modified: cfe/trunk/test/Sema/block-misc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-misc.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-misc.c (original)
+++ cfe/trunk/test/Sema/block-misc.c Wed Sep 9 10:08:12 2009
@@ -4,37 +4,37 @@
int (^IFP) ();
int (^II) (int);
int test1() {
- int (^PFR) (int) = 0; // OK
- PFR = II; // OK
+ int (^PFR) (int) = 0; // OK
+ PFR = II; // OK
- if (PFR == II) // OK
+ if (PFR == II) // OK
donotwarn();
- if (PFR == IFP) // OK
+ if (PFR == IFP) // OK
donotwarn();
if (PFR == (int (^) (int))IFP) // OK
donotwarn();
- if (PFR == 0) // OK
+ if (PFR == 0) // OK
donotwarn();
- if (PFR) // OK
+ if (PFR) // OK
donotwarn();
- if (!PFR) // OK
+ if (!PFR) // OK
donotwarn();
- return PFR != IFP; // OK
+ return PFR != IFP; // OK
}
int test2(double (^S)()) {
double (^I)(int) = (void*) S;
- (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
+ (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
void *pv = I;
- pv = S;
+ pv = S;
I(1);
@@ -114,7 +114,7 @@
void (^test12f)(void);
void test12() {
- test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
+ test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
}
// rdar://6808730
@@ -144,7 +144,7 @@
void (^test15f)(void);
void test15() {
- foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)', expected 'long (^)()'}}
+ foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)', expected 'long (^)()'}}
}
__block int test16i; // expected-error {{__block attribute not allowed, only allowed on local variables}}
Modified: cfe/trunk/test/Sema/block-printf-attribute-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-printf-attribute-1.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-printf-attribute-1.c (original)
+++ cfe/trunk/test/Sema/block-printf-attribute-1.c Wed Sep 9 10:08:12 2009
@@ -1,15 +1,12 @@
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-int main()
-{
- void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}}
- ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}}
+int main() {
+ void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}}
+ ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}}
- void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {};
-
- // FIXME: argument type poking not yet supportted.
- z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */
- z(1, "%s", "HELLO"); // OK
+ void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {};
+ // FIXME: argument type poking not yet supportted.
+ z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */
+ z(1, "%s", "HELLO"); // OK
}
-
Modified: cfe/trunk/test/Sema/block-return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-return.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-return.c (original)
+++ cfe/trunk/test/Sema/block-return.c Wed Sep 9 10:08:12 2009
@@ -31,7 +31,7 @@
return (float)1.0;
else
if (2)
- return (double)2.0;
+ return (double)2.0;
return 1;
};
char *(^B)(void) = ^{
@@ -66,7 +66,7 @@
Boolean (*value_equal)(uintptr_t, uintptr_t) = 0;
cb.isEqual = ^(const CFBasicHash *table, uintptr_t stack_value_or_key1, uintptr_t stack_value_or_key2, Boolean is_key) {
- return (Boolean)(uintptr_t)INVOKE_CALLBACK2(value_equal, (uintptr_t)stack_value_or_key1, (uintptr_t)stack_value_or_key2);
+ return (Boolean)(uintptr_t)INVOKE_CALLBACK2(value_equal, (uintptr_t)stack_value_or_key1, (uintptr_t)stack_value_or_key2);
};
}
Modified: cfe/trunk/test/Sema/block-sentinel-attribute.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-sentinel-attribute.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-sentinel-attribute.c (original)
+++ cfe/trunk/test/Sema/block-sentinel-attribute.c Wed Sep 9 10:08:12 2009
@@ -2,24 +2,23 @@
void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1)));
-int main()
-{
- void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}}
- void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = // expected-note {{block has been explicitly marked sentinel here}}
- ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {};
- void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
+int main() {
+ void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}}
+ void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = // expected-note {{block has been explicitly marked sentinel here}}
+ ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {};
+ void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
- void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
+ void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
- b(1, "%s", (void*)0); // OK
- b(1, "%s", 0); // expected-warning {{missing sentinel in block call}}
- z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in block call}}
- z(1, "%s", (void*)0, 1, 0); // OK
+ b(1, "%s", (void*)0); // OK
+ b(1, "%s", 0); // expected-warning {{missing sentinel in block call}}
+ z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in block call}}
+ z(1, "%s", (void*)0, 1, 0); // OK
- y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in block call}}
+ y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in block call}}
- y(1, "%s", (void*)0,3,4,5,6,7); // OK
+ y(1, "%s", (void*)0,3,4,5,6,7); // OK
}
Modified: cfe/trunk/test/Sema/c89-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/c89-2.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/c89-2.c (original)
+++ cfe/trunk/test/Sema/c89-2.c Wed Sep 9 10:08:12 2009
@@ -1,5 +1,5 @@
/* RUN: clang-cc %s -std=c89 -pedantic-errors -verify
*/
-#if 1LL /* expected-error {{long long}} */
+#if 1LL /* expected-error {{long long}} */
#endif
Modified: cfe/trunk/test/Sema/c89.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/c89.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/c89.c (original)
+++ cfe/trunk/test/Sema/c89.c Wed Sep 9 10:08:12 2009
@@ -25,7 +25,7 @@
int A[i]; /* expected-warning {{variable length array}} */
}
-int test4 = 0LL; /* expected-warning {{long long}} */
+int test4 = 0LL; /* expected-warning {{long long}} */
/* PR1999 */
void test5(register);
Modified: cfe/trunk/test/Sema/complex-int.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/complex-int.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/complex-int.c (original)
+++ cfe/trunk/test/Sema/complex-int.c Wed Sep 9 10:08:12 2009
@@ -44,9 +44,8 @@
// rdar://6097730
void test3(_Complex int *x) {
*x = ~*x;
-}
+}
void test4(_Complex float *x) {
*x = ~*x;
-}
-
+}
Modified: cfe/trunk/test/Sema/conditional.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/conditional.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/conditional.c (original)
+++ cfe/trunk/test/Sema/conditional.c Wed Sep 9 10:08:12 2009
@@ -4,12 +4,10 @@
void _efree(void *ptr);
-int _php_stream_free1()
-{
- return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
+int _php_stream_free1() {
+ return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
}
-int _php_stream_free2()
-{
- return (1 ? _efree(0) : free(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
+int _php_stream_free2() {
+ return (1 ? _efree(0) : free(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
}
Modified: cfe/trunk/test/Sema/darwin-align-cast.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/darwin-align-cast.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/darwin-align-cast.c (original)
+++ cfe/trunk/test/Sema/darwin-align-cast.c Wed Sep 9 10:08:12 2009
@@ -8,10 +8,10 @@
#if 0
This code below comes from the following system headers:
-sys/socket.h:#define CMSG_SPACE(l) (__DARWIN_ALIGN(sizeof(struct
+sys/socket.h:#define CMSG_SPACE(l) (__DARWIN_ALIGN(sizeof(struct
cmsghdr)) + __DARWIN_ALIGN(l))
-i386/_param.h:#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p)
+i386/_param.h:#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p)
+ __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
#endif
Modified: cfe/trunk/test/Sema/floating-point-compare.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/floating-point-compare.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/floating-point-compare.c (original)
+++ cfe/trunk/test/Sema/floating-point-compare.c Wed Sep 9 10:08:12 2009
@@ -13,11 +13,11 @@
}
int f4(float x) {
- return x == 0.0; // no-warning {{comparing}}
+ return x == 0.0; // no-warning {{comparing}}
}
int f5(float x) {
- return x == __builtin_inf(); // no-warning
+ return x == __builtin_inf(); // no-warning
}
int f7(float x) {
Modified: cfe/trunk/test/Sema/function-pointer-sentinel-attribute.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/function-pointer-sentinel-attribute.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/function-pointer-sentinel-attribute.c (original)
+++ cfe/trunk/test/Sema/function-pointer-sentinel-attribute.c Wed Sep 9 10:08:12 2009
@@ -2,22 +2,19 @@
void (*e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1)));
-int main()
-{
- void (*b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)); // expected-note {{function has been explicitly marked sentinel here}}
- void (*z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))); // expected-note {{function has been explicitly marked sentinel here}}
+int main() {
+ void (*b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)); // expected-note {{function has been explicitly marked sentinel here}}
+ void (*z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))); // expected-note {{function has been explicitly marked sentinel here}}
- void (*y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))); // expected-note {{function has been explicitly marked sentinel here}}
+ void (*y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))); // expected-note {{function has been explicitly marked sentinel here}}
- b(1, "%s", (void*)0); // OK
- b(1, "%s", 0); // expected-warning {{missing sentinel in function call}}
- z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in function call}}
- z(1, "%s", (void*)0, 1, 0); // OK
+ b(1, "%s", (void*)0); // OK
+ b(1, "%s", 0); // expected-warning {{missing sentinel in function call}}
+ z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in function call}}
+ z(1, "%s", (void*)0, 1, 0); // OK
- y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}}
-
- y(1, "%s", (void*)0,3,4,5,6,7); // OK
+ y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}}
+ y(1, "%s", (void*)0,3,4,5,6,7); // OK
}
-
Modified: cfe/trunk/test/Sema/function-sentinel-attr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/function-sentinel-attr.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/function-sentinel-attr.c (original)
+++ cfe/trunk/test/Sema/function-sentinel-attr.c Wed Sep 9 10:08:12 2009
@@ -18,7 +18,7 @@
foo1(1, 0) ; // expected-warning {{missing sentinel in function call}}
foo5(1, NULL, 2); // OK
foo5(1,2,NULL, 1); // OK
- foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}}
+ foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}}
foo6(1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}}
foo6(1,NULL,3,4,5,6,7); // OK
Modified: cfe/trunk/test/Sema/implicit-int.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/implicit-int.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/implicit-int.c (original)
+++ cfe/trunk/test/Sema/implicit-int.c Wed Sep 9 10:08:12 2009
@@ -12,15 +12,15 @@
// PR3702
#define PAD(ms10) { \
- register i; \
+ register i; \
}
-#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
+#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
void
h19_insline(n) // expected-warning {{parameter 'n' was not declared, defaulting to type 'int'}}
{
- ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}}
+ ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}}
}
struct foo {
Modified: cfe/trunk/test/Sema/predefined-function.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/predefined-function.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/predefined-function.c (original)
+++ cfe/trunk/test/Sema/predefined-function.c Wed Sep 9 10:08:12 2009
@@ -8,31 +8,30 @@
int b(int c) {return 1;}
int foo();
-int foo()
-{
- int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
- eli(b); // expected-error{{incompatible type passing}}
- return 0;
+int foo() {
+ int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
+ eli(b); // expected-error{{incompatible type passing}}
+ return 0;
}
int bar();
int bar(int i) // expected-note {{previous definition is here}}
{
- return 0;
+ return 0;
}
int bar() // expected-error {{redefinition of 'bar'}}
{
- return 0;
+ return 0;
}
int foobar(int); // note {{previous declaration is here}}
int foobar() // error {{conflicting types for 'foobar'}}
{
- return 0;
+ return 0;
}
int wibble(); // expected-note {{previous declaration is here}}
float wibble() // expected-error {{conflicting types for 'wibble'}}
{
- return 0.0f;
+ return 0.0f;
}
Modified: cfe/trunk/test/Sema/static-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/static-init.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/static-init.c (original)
+++ cfe/trunk/test/Sema/static-init.c Wed Sep 9 10:08:12 2009
@@ -11,11 +11,11 @@
union bar {
- int i;
+ int i;
};
struct foo {
- unsigned ptr;
+ unsigned ptr;
};
union bar u[1];
Modified: cfe/trunk/test/Sema/struct-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/struct-decl.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/struct-decl.c (original)
+++ cfe/trunk/test/Sema/struct-decl.c Wed Sep 9 10:08:12 2009
@@ -1,26 +1,26 @@
// RUN: clang-cc -fsyntax-only -verify %s
// PR3459
struct bar {
- char n[1];
+ char n[1];
};
struct foo {
- char name[(int)&((struct bar *)0)->n];
- char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
+ char name[(int)&((struct bar *)0)->n];
+ char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
};
// PR3430
struct s {
- struct st {
- int v;
- } *ts;
+ struct st {
+ int v;
+ } *ts;
};
struct st;
int foo() {
- struct st *f;
- return f->v + f[0].v;
+ struct st *f;
+ return f->v + f[0].v;
}
// PR3642, PR3671
@@ -29,8 +29,8 @@
char tag_data[];
};
struct datatag {
- struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}}
- char data;
+ struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}}
+ char data;
};
Modified: cfe/trunk/test/Sema/transparent-union-pointer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/transparent-union-pointer.c?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/transparent-union-pointer.c (original)
+++ cfe/trunk/test/Sema/transparent-union-pointer.c Wed Sep 9 10:08:12 2009
@@ -1,14 +1,14 @@
// RUN: clang-cc %s -fsyntax-only -verify
typedef union {
- union wait *__uptr;
- int *__iptr;
+ union wait *__uptr;
+ int *__iptr;
} __WAIT_STATUS __attribute__ ((__transparent_union__));
extern int wait (__WAIT_STATUS __stat_loc);
void fastcgi_cleanup() {
- int status = 0;
- wait(&status);
+ int status = 0;
+ wait(&status);
}
Modified: cfe/trunk/test/SemaCXX/abstract.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/abstract.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/abstract.cpp (original)
+++ cfe/trunk/test/SemaCXX/abstract.cpp Wed Sep 9 10:08:12 2009
@@ -9,7 +9,7 @@
#endif
class C {
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
static_assert(__is_abstract(C), "C has a pure virtual function");
@@ -20,7 +20,7 @@
static_assert(__is_abstract(D), "D inherits from an abstract class");
class E : D {
- virtual void f();
+ virtual void f();
};
static_assert(!__is_abstract(E), "E inherits from an abstract class but implements f");
@@ -38,8 +38,8 @@
void t3(const C&);
void f() {
- C(); // expected-error {{allocation of an object of abstract type 'C'}}
- t3(C()); // expected-error {{allocation of an object of abstract type 'C'}}
+ C(); // expected-error {{allocation of an object of abstract type 'C'}}
+ t3(C()); // expected-error {{allocation of an object of abstract type 'C'}}
}
C e1[2]; // expected-error {{variable type 'C' is an abstract class}}
@@ -54,17 +54,17 @@
void t6(Func);
class F {
- F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}}
+ F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}}
- class D {
- void f(F c); // expected-error {{parameter type 'F' is an abstract class}}
- };
-
- union U {
- void u(F c); // expected-error {{parameter type 'F' is an abstract class}}
- };
+ class D {
+ void f(F c); // expected-error {{parameter type 'F' is an abstract class}}
+ };
+
+ union U {
+ void u(F c); // expected-error {{parameter type 'F' is an abstract class}}
+ };
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
class Abstract;
@@ -72,50 +72,47 @@
void t7(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
void t8() {
- void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+ void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
}
namespace N {
- void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
}
class Abstract {
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
// <rdar://problem/6854087>
class foo {
public:
- virtual foo *getFoo() = 0;
+ virtual foo *getFoo() = 0;
};
class bar : public foo {
public:
- virtual bar *getFoo();
+ virtual bar *getFoo();
};
bar x;
// <rdar://problem/6902298>
-class A
-{
+class A {
public:
- virtual void release() = 0;
- virtual void release(int count) = 0;
- virtual void retain() = 0;
+ virtual void release() = 0;
+ virtual void release(int count) = 0;
+ virtual void retain() = 0;
};
-class B : public A
-{
+class B : public A {
public:
- virtual void release();
- virtual void release(int count);
- virtual void retain();
+ virtual void release();
+ virtual void release(int count);
+ virtual void retain();
};
-void foo(void)
-{
- B b;
+void foo(void) {
+ B b;
}
struct K {
Modified: cfe/trunk/test/SemaCXX/access-control-check.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/access-control-check.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/access-control-check.cpp (original)
+++ cfe/trunk/test/SemaCXX/access-control-check.cpp Wed Sep 9 10:08:12 2009
@@ -11,6 +11,6 @@
class N : M,P {
N() {}
- // FIXME. No access violation is reported in method call or member access.
+ // FIXME. No access violation is reported in method call or member access.
int PR() { return iP + PPR(); }
};
Modified: cfe/trunk/test/SemaCXX/attr-format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-format.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-format.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-format.cpp Wed Sep 9 10:08:12 2009
@@ -1,8 +1,8 @@
// RUN: clang-cc -fsyntax-only -verify %s
struct S {
- static void f(const char*, ...) __attribute__((format(printf, 1, 2)));
-
- // GCC has a hidden 'this' argument in member functions which is why
- // the format argument is argument 2 here.
- void g(const char*, ...) __attribute__((format(printf, 2, 3)));
-};
\ No newline at end of file
+ static void f(const char*, ...) __attribute__((format(printf, 1, 2)));
+
+ // GCC has a hidden 'this' argument in member functions which is why
+ // the format argument is argument 2 here.
+ void g(const char*, ...) __attribute__((format(printf, 2, 3)));
+};
Modified: cfe/trunk/test/SemaCXX/class-base-member-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/class-base-member-init.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/class-base-member-init.cpp (original)
+++ cfe/trunk/test/SemaCXX/class-base-member-init.cpp Wed Sep 9 10:08:12 2009
@@ -7,9 +7,9 @@
struct D : S {
D() : b1(0), b2(1), b1(0), S(), S() {} // expected-error {{multiple initializations given for non-static member 'b1'}} \
- // expected-note {{previous initialization is here}} \
- // expected-error {{multiple initializations given for base 'class S'}} \
- // expected-note {{previous initialization is here}}
+ // expected-note {{previous initialization is here}} \
+ // expected-error {{multiple initializations given for base 'class S'}} \
+ // expected-note {{previous initialization is here}}
int b1;
int b2;
Modified: cfe/trunk/test/SemaCXX/constructor-initializer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constructor-initializer.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/constructor-initializer.cpp (original)
+++ cfe/trunk/test/SemaCXX/constructor-initializer.cpp Wed Sep 9 10:08:12 2009
@@ -94,18 +94,18 @@
Derived::V(), // expected-note {{base 'Derived::V'}}
::NonExisting(), // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
INT::NonExisting() {} // expected-error {{expected a class or namespace}} \
- // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
+ // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
};
// FIXME. This is bad message!
-struct M { // expected-note {{candidate function}} \
- // expected-note {{candidate function}}
- M(int i, int j); // expected-note {{candidate function}} \
- // // expected-note {{candidate function}}
+struct M { // expected-note {{candidate function}} \
+ // expected-note {{candidate function}}
+ M(int i, int j); // expected-note {{candidate function}} \
+ // // expected-note {{candidate function}}
};
struct N : M {
- N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}}
+ N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}}
m1(100) { } // expected-error {{no matching constructor for initialization of 'm1'}}
M m1;
};
@@ -116,7 +116,7 @@
};
struct Q {
- Q() : f1(1,2), // expected-error {{Too many arguments for member initializer 'f1'}}
+ Q() : f1(1,2), // expected-error {{Too many arguments for member initializer 'f1'}}
pf(0.0) { } // expected-error {{incompatible type passing 'double', expected 'float *'}}
float f1;
Modified: cfe/trunk/test/SemaCXX/copy-constructor-error.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/copy-constructor-error.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/copy-constructor-error.cpp (original)
+++ cfe/trunk/test/SemaCXX/copy-constructor-error.cpp Wed Sep 9 10:08:12 2009
@@ -1,8 +1,8 @@
// RUN: clang-cc -fsyntax-only -verify %s
-struct S { // expected-note {{candidate function}}
- S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\
- // expected-note {{candidate function}}
+struct S { // expected-note {{candidate function}}
+ S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\
+ // expected-note {{candidate function}}
};
S f();
Modified: cfe/trunk/test/SemaCXX/default-assignment-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/default-assignment-operator.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/default-assignment-operator.cpp (original)
+++ cfe/trunk/test/SemaCXX/default-assignment-operator.cpp Wed Sep 9 10:08:12 2009
@@ -26,7 +26,7 @@
// Test1
void f(X x, const X cx) {
- x = cx; // expected-note {{synthesized method is first required here}}
+ x = cx; // expected-note {{synthesized method is first required here}}
x = cx;
z1 = z2;
}
@@ -36,8 +36,7 @@
T t1;
T t2;
-void g()
-{
+void g() {
t1 = t2;
}
@@ -51,8 +50,7 @@
class W : V {};
W w1, w2;
-void h()
-{
+void h() {
w1 = w2;
}
@@ -67,9 +65,8 @@
class D1 : B1 {};
D1 d1, d2;
-void i()
-{
- d1 = d2;
+void i() {
+ d1 = d2;
}
// Test5
@@ -83,8 +80,7 @@
E1 e1, e2;
-void j()
-{
+void j() {
e1 = e2; // expected-note{{synthesized method is first required here}}
}
Modified: cfe/trunk/test/SemaCXX/default-constructor-initializers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/default-constructor-initializers.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/default-constructor-initializers.cpp (original)
+++ cfe/trunk/test/SemaCXX/default-constructor-initializers.cpp Wed Sep 9 10:08:12 2009
@@ -46,9 +46,9 @@
struct Z1 {
- int& z; // expected-note {{declared at}}
- const int c1; // expected-note {{declared at}}
- volatile int v1;
+ int& z; // expected-note {{declared at}}
+ const int c1; // expected-note {{declared at}}
+ volatile int v1;
};
Z1 z1; // expected-error {{cannot define the implicit default constructor for 'struct Z1', because reference member 'z' cannot be default-initialized}} \
Modified: cfe/trunk/test/SemaCXX/enum.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/enum.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/enum.cpp (original)
+++ cfe/trunk/test/SemaCXX/enum.cpp Wed Sep 9 10:08:12 2009
@@ -14,14 +14,13 @@
// <rdar://problem/6502934>
typedef enum Foo {
- A = 0,
- B = 1
+ A = 0,
+ B = 1
} Foo;
-
-
+
void bar() {
- Foo myvar = A;
- myvar = B;
+ Foo myvar = A;
+ myvar = B;
}
/// PR3688
Modified: cfe/trunk/test/SemaCXX/illegal-member-initialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/illegal-member-initialization.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/illegal-member-initialization.cpp (original)
+++ cfe/trunk/test/SemaCXX/illegal-member-initialization.cpp Wed Sep 9 10:08:12 2009
@@ -3,7 +3,7 @@
struct A {
A() : value(), cvalue() { } // expected-error {{cannot initialize the member to null in default constructor because reference member 'value' cannot be null-initialized}} \
// expected-error {{constructor for 'struct A' must explicitly initialize the reference member 'value'}}
- int &value; // expected-note{{declared at}} {{expected-note{{declared at}}
+ int &value; // expected-note{{declared at}} {{expected-note{{declared at}}
const int cvalue;
};
@@ -11,10 +11,10 @@
};
struct X {
- X() { } // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \
- // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \
- // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \
- // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}}
+ X() { } // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \
+ // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \
+ // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \
+ // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}}
int &value; // expected-note{{declared at}}
const int cvalue; // expected-note{{declared at}}
B& b; // expected-note{{declared at}}
Modified: cfe/trunk/test/SemaCXX/inherit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/inherit.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/inherit.cpp (original)
+++ cfe/trunk/test/SemaCXX/inherit.cpp Wed Sep 9 10:08:12 2009
@@ -10,7 +10,7 @@
class C : public B1, private B2 { };
-class D; // expected-note {{forward declaration of 'class D'}}
+class D; // expected-note {{forward declaration of 'class D'}}
class E : public D { }; // expected-error{{base class has incomplete type}}
Modified: cfe/trunk/test/SemaCXX/member-expr-static.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/member-expr-static.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/member-expr-static.cpp (original)
+++ cfe/trunk/test/SemaCXX/member-expr-static.cpp Wed Sep 9 10:08:12 2009
@@ -2,20 +2,18 @@
typedef void (*thread_continue_t)();
extern "C" {
-extern void kernel_thread_start(thread_continue_t continuation);
-extern void pure_c(void);
+ extern void kernel_thread_start(thread_continue_t continuation);
+ extern void pure_c(void);
}
-class _IOConfigThread
-{
+class _IOConfigThread {
public:
- static void main( void );
+ static void main( void );
};
-void foo( void )
-{
- kernel_thread_start(&_IOConfigThread::main);
- kernel_thread_start((thread_continue_t)&_IOConfigThread::main);
- kernel_thread_start(&pure_c);
+void foo( void ) {
+ kernel_thread_start(&_IOConfigThread::main);
+ kernel_thread_start((thread_continue_t)&_IOConfigThread::main);
+ kernel_thread_start(&pure_c);
}
Modified: cfe/trunk/test/SemaCXX/static-initializers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/static-initializers.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/static-initializers.cpp (original)
+++ cfe/trunk/test/SemaCXX/static-initializers.cpp Wed Sep 9 10:08:12 2009
@@ -1,12 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
-int f()
-{
- return 10;
+int f() {
+ return 10;
}
-void g()
-{
- static int a = f();
+void g() {
+ static int a = f();
}
static int b = f();
Modified: cfe/trunk/test/SemaCXX/warn-reorder-ctor-initialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-reorder-ctor-initialization.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-reorder-ctor-initialization.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-reorder-ctor-initialization.cpp Wed Sep 9 10:08:12 2009
@@ -64,13 +64,13 @@
};
struct F : public A1, public B1, private virtual V {
- F() : A1(), V() { } // expected-warning {{base class 'struct A1' will be initialized after}} \
- // expected-note {{base 'struct V'}}
+ F() : A1(), V() { } // expected-warning {{base class 'struct A1' will be initialized after}} \
+ // expected-note {{base 'struct V'}}
};
struct X : public virtual A, virtual V, public virtual B {
- X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \
- // expected-note {{base 'struct V'}}
+ X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \
+ // expected-note {{base 'struct V'}}
};
class Anon {
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Sep 9 10:08:12 2009
@@ -109,14 +109,14 @@
static llvm::cl::opt<bool>
Verbose("v", llvm::cl::desc("Enable verbose output"));
static llvm::cl::opt<bool>
-Stats("print-stats",
+Stats("print-stats",
llvm::cl::desc("Print performance metrics and statistics"));
static llvm::cl::opt<bool>
DisableFree("disable-free",
llvm::cl::desc("Disable freeing of memory on exit"),
llvm::cl::init(false));
static llvm::cl::opt<bool>
-EmptyInputOnly("empty-input-only",
+EmptyInputOnly("empty-input-only",
llvm::cl::desc("Force running on an empty input file"));
enum ProgActions {
@@ -129,7 +129,7 @@
EmitAssembly, // Emit a .s file.
EmitLLVM, // Emit a .ll file.
EmitBC, // Emit a .bc file.
- EmitLLVMOnly, // Generate LLVM IR, but do not
+ EmitLLVMOnly, // Generate LLVM IR, but do not
EmitHTML, // Translate input source into HTML.
ASTPrint, // Parse ASTs and print them.
ASTPrintXML, // Parse ASTs and print them in XML.
@@ -143,13 +143,13 @@
PrintPreprocessedInput, // -E mode.
DumpTokens, // Dump out preprocessed tokens.
DumpRawTokens, // Dump out raw tokens.
- RunAnalysis, // Run one or more source code analyses.
+ RunAnalysis, // Run one or more source code analyses.
GeneratePTH, // Generate pre-tokenized header.
GeneratePCH, // Generate pre-compiled header.
InheritanceView // View C++ inheritance for a specified class.
};
-static llvm::cl::opt<ProgActions>
+static llvm::cl::opt<ProgActions>
ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore,
llvm::cl::init(ParseSyntaxOnly),
llvm::cl::values(
@@ -262,13 +262,13 @@
static llvm::cl::opt<unsigned>
MessageLength("fmessage-length",
- llvm::cl::desc("Format message diagnostics so that they fit "
- "within N columns or fewer, when possible."),
- llvm::cl::value_desc("N"));
+ llvm::cl::desc("Format message diagnostics so that they fit "
+ "within N columns or fewer, when possible."),
+ llvm::cl::value_desc("N"));
static llvm::cl::opt<bool>
NoColorDiagnostic("fno-color-diagnostics",
- llvm::cl::desc("Don't use colors when showing diagnostics "
+ llvm::cl::desc("Don't use colors when showing diagnostics "
"(automatically turned off if output is not a "
"terminal)."));
//===----------------------------------------------------------------------===//
@@ -402,8 +402,9 @@
static llvm::cl::opt<bool>
ObjCSenderDispatch("fobjc-sender-dependent-dispatch",
- llvm::cl::desc("Enable sender-dependent dispatch for"
- "Objective-C messages"), llvm::cl::init(false));
+ llvm::cl::desc("Enable sender-dependent dispatch for"
+ "Objective-C messages"),
+ llvm::cl::init(false));
/// InitializeBaseLanguage - Handle the -x foo options.
static void InitializeBaseLanguage() {
@@ -416,14 +417,14 @@
static LangKind GetLanguage(const std::string &Filename) {
if (BaseLang != langkind_unspecified)
return BaseLang;
-
+
std::string::size_type DotPos = Filename.rfind('.');
if (DotPos == std::string::npos) {
BaseLang = langkind_c; // Default to C if no extension.
return langkind_c;
}
-
+
std::string Ext = std::string(Filename.begin()+DotPos+1, Filename.end());
// C header: .h
// C++ header: .hh or .H;
@@ -464,12 +465,12 @@
static void InitializeObjCOptions(LangOptions &Options) {
Options.ObjC1 = Options.ObjC2 = 1;
}
-
+
static void InitializeLangOptions(LangOptions &Options, LangKind LK){
// FIXME: implement -fpreprocessed mode.
bool NoPreprocess = false;
-
+
switch (LK) {
default: assert(0 && "Unknown language kind!");
case langkind_asm_cpp:
@@ -507,28 +508,28 @@
Options.LaxVectorConversions = 1;
break;
}
-
+
if (ObjCExclusiveGC)
Options.setGCMode(LangOptions::GCOnly);
else if (ObjCEnableGC)
Options.setGCMode(LangOptions::HybridGC);
-
+
if (ObjCEnableGCBitmapPrint)
Options.ObjCGCBitmapPrint = 1;
-
+
if (AltiVec)
Options.AltiVec = 1;
if (PThread)
Options.POSIXThreads = 1;
-
+
Options.setVisibilityMode(SymbolVisibility);
Options.OverflowChecking = OverflowChecking;
}
/// LangStds - Language standards we support.
enum LangStds {
- lang_unspecified,
+ lang_unspecified,
lang_c89, lang_c94, lang_c99,
lang_gnu_START,
lang_gnu89 = lang_gnu_START, lang_gnu99,
@@ -575,7 +576,7 @@
PascalStrings("fpascal-strings",
llvm::cl::desc("Recognize and construct Pascal-style "
"string literals"));
-
+
static llvm::cl::opt<bool>
MSExtensions("fms-extensions",
llvm::cl::desc("Accept some non-standard constructs used in "
@@ -647,7 +648,7 @@
OptSize("Os", llvm::cl::desc("Optimize for size"));
static llvm::cl::opt<bool>
-DisableLLVMOptimizations("disable-llvm-optzns",
+DisableLLVMOptimizations("disable-llvm-optzns",
llvm::cl::desc("Don't run LLVM optimization passes"));
static llvm::cl::opt<bool>
@@ -661,7 +662,7 @@
// FIXME: Also add an "-fno-access-control" option.
static llvm::cl::opt<bool>
-AccessControl("faccess-control",
+AccessControl("faccess-control",
llvm::cl::desc("Enable C++ access control"));
static llvm::cl::opt<bool>
@@ -705,7 +706,7 @@
// Pass the map of target features to the target for validation and
// processing.
Target->HandleTargetFeatures(Features);
-
+
if (LangStd == lang_unspecified) {
// Based on the base language, pick one.
switch (LK) {
@@ -728,7 +729,7 @@
break;
}
}
-
+
switch (LangStd) {
default: assert(0 && "Unknown language standard!");
@@ -760,17 +761,17 @@
// GNUMode - Set if we're in gnu99, gnu89, gnucxx98, etc.
Options.GNUMode = LangStd >= lang_gnu_START;
-
+
if (Options.CPlusPlus) {
Options.C99 = 0;
Options.HexFloats = 0;
}
-
+
if (LangStd == lang_c89 || LangStd == lang_c94 || LangStd == lang_gnu89)
Options.ImplicitInt = 1;
else
Options.ImplicitInt = 0;
-
+
// Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs
// is specified, or -std is set to a conforming mode.
Options.Trigraphs = !Options.GNUMode;
@@ -783,14 +784,14 @@
// However, blocks are not turned off when compiling Obj-C or Obj-C++ code.
if (!Options.ObjC1 && !Options.GNUMode)
Options.Blocks = 0;
-
+
// Default to not accepting '$' in identifiers when preprocessing assembler,
// but do accept when preprocessing C. FIXME: these defaults are right for
// darwin, are they right everywhere?
Options.DollarIdents = LK != langkind_asm_cpp;
if (DollarsInIdents.getPosition()) // Explicit setting overrides default.
Options.DollarIdents = DollarsInIdents;
-
+
if (PascalStrings.getPosition())
Options.PascalStrings = PascalStrings;
if (MSExtensions.getPosition())
@@ -809,18 +810,18 @@
Options.NoBuiltin = 1;
if (Freestanding)
Options.Freestanding = Options.NoBuiltin = 1;
-
+
if (EnableHeinousExtensions)
Options.HeinousExtensions = 1;
if (AccessControl)
Options.AccessControl = 1;
-
+
Options.ElideConstructors = !NoElideConstructors;
-
+
// OpenCL and C++ both have bool, true, false keywords.
Options.Bool = Options.OpenCL | Options.CPlusPlus;
-
+
Options.MathErrno = MathErrno;
Options.InstantiationDepth = TemplateDepth;
@@ -838,14 +839,14 @@
Options.ObjCNonFragileABI = 1;
Options.ObjCSenderDispatch = ObjCSenderDispatch;
-
+
if (EmitAllDecls)
Options.EmitAllDecls = 1;
// The __OPTIMIZE_SIZE__ define is tied to -Oz, which we don't
// support.
Options.OptimizeSize = 0;
-
+
// -Os implies -O2
if (OptSize || OptLevel)
Options.Optimize = 1;
@@ -854,7 +855,7 @@
Options.PICLevel = PICLevel;
Options.GNUInline = !Options.C99;
- // FIXME: This is affected by other options (-fno-inline).
+ // FIXME: This is affected by other options (-fno-inline).
Options.NoInline = !OptSize && !OptLevel;
Options.Static = StaticDefine;
@@ -881,7 +882,7 @@
llvm::cl::desc("Specify target triple (e.g. i686-apple-darwin9)"));
static llvm::cl::opt<std::string>
-MacOSVersionMin("mmacosx-version-min",
+MacOSVersionMin("mmacosx-version-min",
llvm::cl::desc("Specify target Mac OS X version (e.g. 10.5)"));
// If -mmacosx-version-min=10.3.9 is specified, change the triple from being
@@ -891,12 +892,12 @@
static void HandleMacOSVersionMin(std::string &Triple) {
std::string::size_type DarwinDashIdx = Triple.find("-darwin");
if (DarwinDashIdx == std::string::npos) {
- fprintf(stderr,
+ fprintf(stderr,
"-mmacosx-version-min only valid for darwin (Mac OS X) targets\n");
exit(1);
}
unsigned DarwinNumIdx = DarwinDashIdx + strlen("-darwin");
-
+
// Remove the number.
Triple.resize(DarwinNumIdx);
@@ -914,10 +915,10 @@
// The version number must be in the range 0-9.
MacOSVersionMinIsInvalid = (unsigned)VersionNum > 9;
-
+
// Turn MacOSVersionMin into a darwin number: e.g. 10.3.9 is 3 -> 7.
Triple += llvm::itostr(VersionNum+4);
-
+
if (End[0] == '.' && isdigit(End[1]) && End[2] == '\0') { // 10.4.7 is ok.
// Add the period piece (.7) to the end of the triple. This gives us
// something like ...-darwin8.7
@@ -926,16 +927,16 @@
MacOSVersionMinIsInvalid = true;
}
}
-
+
if (MacOSVersionMinIsInvalid) {
- fprintf(stderr,
+ fprintf(stderr,
"-mmacosx-version-min=%s is invalid, expected something like '10.4'.\n",
MacOSVersionMin.c_str());
exit(1);
}
- else if (VersionNum <= 4 &&
+ else if (VersionNum <= 4 &&
!strncmp(Triple.c_str(), "x86_64", strlen("x86_64"))) {
- fprintf(stderr,
+ fprintf(stderr,
"-mmacosx-version-min=%s is invalid with -arch x86_64.\n",
MacOSVersionMin.c_str());
exit(1);
@@ -944,7 +945,7 @@
}
static llvm::cl::opt<std::string>
-IPhoneOSVersionMin("miphoneos-version-min",
+IPhoneOSVersionMin("miphoneos-version-min",
llvm::cl::desc("Specify target iPhone OS version (e.g. 2.0)"));
// If -miphoneos-version-min=2.2 is specified, change the triple from being
@@ -956,15 +957,15 @@
static void HandleIPhoneOSVersionMin(std::string &Triple) {
std::string::size_type DarwinDashIdx = Triple.find("-darwin");
if (DarwinDashIdx == std::string::npos) {
- fprintf(stderr,
+ fprintf(stderr,
"-miphoneos-version-min only valid for darwin (Mac OS X) targets\n");
exit(1);
}
unsigned DarwinNumIdx = DarwinDashIdx + strlen("-darwin");
-
+
// Remove the number.
Triple.resize(DarwinNumIdx);
-
+
// Validate that IPhoneOSVersionMin is a 'version number', starting with [2-9].[0-9]
bool IPhoneOSVersionMinIsInvalid = false;
int VersionNum = 0;
@@ -975,13 +976,13 @@
const char *Start = IPhoneOSVersionMin.c_str();
char *End = 0;
VersionNum = (int)strtol(Start, &End, 10);
-
+
// The version number must be in the range 0-9.
IPhoneOSVersionMinIsInvalid = (unsigned)VersionNum > 9;
-
+
// Turn IPhoneOSVersionMin into a darwin number: e.g. 2.0 is 2 -> 9.2.
Triple += "9." + llvm::itostr(VersionNum);
-
+
if (End[0] == '.' && isdigit(End[1]) && End[2] == '\0') { // 2.2 is ok.
// Add the period piece (.2) to the end of the triple. This gives us
// something like ...-darwin9.2.2
@@ -990,9 +991,9 @@
IPhoneOSVersionMinIsInvalid = true;
}
}
-
+
if (IPhoneOSVersionMinIsInvalid) {
- fprintf(stderr,
+ fprintf(stderr,
"-miphoneos-version-min=%s is invalid, expected something like '2.0'.\n",
IPhoneOSVersionMin.c_str());
exit(1);
@@ -1014,7 +1015,7 @@
HandleMacOSVersionMin(Triple);
else if (!IPhoneOSVersionMin.empty())
HandleIPhoneOSVersionMin(Triple);;
-
+
return Triple;
}
@@ -1030,14 +1031,14 @@
if (EmptyInputOnly) {
const char *EmptyStr = "";
- llvm::MemoryBuffer *SB =
+ llvm::MemoryBuffer *SB =
llvm::MemoryBuffer::getMemBuffer(EmptyStr, EmptyStr, "<empty input>");
SourceMgr.createMainFileIDForMemBuffer(SB);
} else if (InFile != "-") {
const FileEntry *File = FileMgr.getFile(InFile);
if (File) SourceMgr.createMainFileID(File, SourceLocation());
if (SourceMgr.getMainFileID().isInvalid()) {
- PP.getDiagnostics().Report(FullSourceLoc(), diag::err_fe_error_reading)
+ PP.getDiagnostics().Report(FullSourceLoc(), diag::err_fe_error_reading)
<< InFile.c_str();
return true;
}
@@ -1053,7 +1054,7 @@
SourceMgr.createMainFileIDForMemBuffer(SB);
if (SourceMgr.getMainFileID().isInvalid()) {
- PP.getDiagnostics().Report(FullSourceLoc(),
+ PP.getDiagnostics().Report(FullSourceLoc(),
diag::err_fe_error_reading_stdin);
return true;
}
@@ -1094,7 +1095,7 @@
llvm::cl::desc("Include file before parsing"));
static llvm::cl::opt<bool>
-RelocatablePCH("relocatable-pch",
+RelocatablePCH("relocatable-pch",
llvm::cl::desc("Whether to build a relocatable precompiled "
"header"));
@@ -1105,7 +1106,7 @@
// This tool exports a large number of command line options to control how the
// preprocessor searches for header files. At root, however, the Preprocessor
// object takes a very simple interface: a list of directories to search for
-//
+//
// FIXME: -nostdinc++
// FIXME: -imultilib
//
@@ -1165,22 +1166,22 @@
++Fidx;
}
}
-
+
// Consume what's left from whatever list was longer.
for (; Iidx != I_dirs.size(); ++Iidx)
Init.AddPath(I_dirs[Iidx], InitHeaderSearch::Angled, false, true, false);
for (; Fidx != F_dirs.size(); ++Fidx)
Init.AddPath(F_dirs[Fidx], InitHeaderSearch::Angled, false, true, true);
-
+
// Handle -idirafter... options.
for (unsigned i = 0, e = idirafter_dirs.size(); i != e; ++i)
Init.AddPath(idirafter_dirs[i], InitHeaderSearch::After,
false, true, false);
-
+
// Handle -iquote... options.
for (unsigned i = 0, e = iquote_dirs.size(); i != e; ++i)
Init.AddPath(iquote_dirs[i], InitHeaderSearch::Quoted, false, true, false);
-
+
// Handle -isystem... options.
for (unsigned i = 0, e = isystem_dirs.size(); i != e; ++i)
Init.AddPath(isystem_dirs[i], InitHeaderSearch::System, false, true, false);
@@ -1198,28 +1199,28 @@
bool iwithprefixbefore_done = iwithprefixbefore_vals.empty();
while (!iprefix_done || !iwithprefix_done || !iwithprefixbefore_done) {
if (!iprefix_done &&
- (iwithprefix_done ||
- iprefix_vals.getPosition(iprefix_idx) <
+ (iwithprefix_done ||
+ iprefix_vals.getPosition(iprefix_idx) <
iwithprefix_vals.getPosition(iwithprefix_idx)) &&
- (iwithprefixbefore_done ||
- iprefix_vals.getPosition(iprefix_idx) <
+ (iwithprefixbefore_done ||
+ iprefix_vals.getPosition(iprefix_idx) <
iwithprefixbefore_vals.getPosition(iwithprefixbefore_idx))) {
Prefix = iprefix_vals[iprefix_idx];
++iprefix_idx;
iprefix_done = iprefix_idx == iprefix_vals.size();
} else if (!iwithprefix_done &&
- (iwithprefixbefore_done ||
- iwithprefix_vals.getPosition(iwithprefix_idx) <
+ (iwithprefixbefore_done ||
+ iwithprefix_vals.getPosition(iwithprefix_idx) <
iwithprefixbefore_vals.getPosition(iwithprefixbefore_idx))) {
- Init.AddPath(Prefix+iwithprefix_vals[iwithprefix_idx],
+ Init.AddPath(Prefix+iwithprefix_vals[iwithprefix_idx],
InitHeaderSearch::System, false, false, false);
++iwithprefix_idx;
iwithprefix_done = iwithprefix_idx == iwithprefix_vals.size();
} else {
- Init.AddPath(Prefix+iwithprefixbefore_vals[iwithprefixbefore_idx],
+ Init.AddPath(Prefix+iwithprefixbefore_vals[iwithprefixbefore_idx],
InitHeaderSearch::Angled, false, false, false);
++iwithprefixbefore_idx;
- iwithprefixbefore_done =
+ iwithprefixbefore_done =
iwithprefixbefore_idx == iwithprefixbefore_vals.size();
}
}
@@ -1228,36 +1229,35 @@
Init.AddDefaultEnvVarPaths(Lang);
// Add the clang headers, which are relative to the clang binary.
- llvm::sys::Path MainExecutablePath =
+ llvm::sys::Path MainExecutablePath =
llvm::sys::Path::GetMainExecutable(Argv0,
(void*)(intptr_t)InitializeIncludePaths);
if (!MainExecutablePath.isEmpty()) {
MainExecutablePath.eraseComponent(); // Remove /clang from foo/bin/clang
MainExecutablePath.eraseComponent(); // Remove /bin from foo/bin
- // Get foo/lib/clang/<version>/include
+ // Get foo/lib/clang/<version>/include
MainExecutablePath.appendComponent("lib");
MainExecutablePath.appendComponent("clang");
MainExecutablePath.appendComponent(CLANG_VERSION_STRING);
MainExecutablePath.appendComponent("include");
-
+
// We pass true to ignore sysroot so that we *always* look for clang headers
// relative to our executable, never relative to -isysroot.
Init.AddPath(MainExecutablePath.c_str(), InitHeaderSearch::System,
false, false, false, true /*ignore sysroot*/);
}
-
- if (!nostdinc)
+
+ if (!nostdinc)
Init.AddDefaultSystemIncludePaths(Lang);
// Now that we have collected all of the include paths, merge them all
// together and tell the preprocessor about them.
-
+
Init.Realize();
}
-void InitializePreprocessorInitOptions(PreprocessorInitOptions &InitOpts)
-{
+void InitializePreprocessorInitOptions(PreprocessorInitOptions &InitOpts) {
// Add macros from the command line.
unsigned d = 0, D = D_macros.size();
unsigned u = 0, U = U_macros.size();
@@ -1326,17 +1326,17 @@
TargetInfo &Target;
SourceManager &SourceMgr;
HeaderSearch &HeaderInfo;
-
+
public:
DriverPreprocessorFactory(Diagnostic &diags, const LangOptions &opts,
TargetInfo &target, SourceManager &SM,
- HeaderSearch &Headers)
+ HeaderSearch &Headers)
: Diags(diags), LangInfo(opts), Target(target),
SourceMgr(SM), HeaderInfo(Headers) {}
-
-
+
+
virtual ~DriverPreprocessorFactory() {}
-
+
virtual Preprocessor* CreatePreprocessor() {
llvm::OwningPtr<PTHManager> PTHMgr;
@@ -1345,23 +1345,23 @@
"options\n");
exit(1);
}
-
+
// Use PTH?
if (!TokenCache.empty() || !ImplicitIncludePTH.empty()) {
const std::string& x = TokenCache.empty() ? ImplicitIncludePTH:TokenCache;
- PTHMgr.reset(PTHManager::Create(x, &Diags,
+ PTHMgr.reset(PTHManager::Create(x, &Diags,
TokenCache.empty() ? Diagnostic::Error
: Diagnostic::Warning));
}
-
+
if (Diags.hasErrorOccurred())
exit(1);
-
+
// Create the Preprocessor.
llvm::OwningPtr<Preprocessor> PP(new Preprocessor(Diags, LangInfo, Target,
SourceMgr, HeaderInfo,
PTHMgr.get()));
-
+
// Note that this is different then passing PTHMgr to Preprocessor's ctor.
// That argument is used as the IdentifierInfoLookup argument to
// IdentifierTable's ctor.
@@ -1387,7 +1387,7 @@
static void ParseFile(Preprocessor &PP, MinimalAction *PA) {
Parser P(PP, *PA);
PP.EnterMainSourceFile();
-
+
// Parsing the specified input file.
P.ParseTranslationUnit();
delete PA;
@@ -1424,24 +1424,24 @@
/// and feature list.
static void ComputeFeatureMap(TargetInfo *Target,
llvm::StringMap<bool> &Features) {
- assert(Features.empty() && "invalid map");
+ assert(Features.empty() && "invalid map");
// Initialize the feature map based on the target.
Target->getDefaultFeatures(TargetCPU, Features);
// Apply the user specified deltas.
- for (llvm::cl::list<std::string>::iterator it = TargetFeatures.begin(),
+ for (llvm::cl::list<std::string>::iterator it = TargetFeatures.begin(),
ie = TargetFeatures.end(); it != ie; ++it) {
const char *Name = it->c_str();
-
+
// FIXME: Don't handle errors like this.
if (Name[0] != '-' && Name[0] != '+') {
- fprintf(stderr, "error: clang-cc: invalid target feature string: %s\n",
+ fprintf(stderr, "error: clang-cc: invalid target feature string: %s\n",
Name);
exit(1);
}
if (!Target->setFeatureEnabled(Features, Name + 1, (Name[0] == '+'))) {
- fprintf(stderr, "error: clang-cc: invalid target feature name: %s\n",
+ fprintf(stderr, "error: clang-cc: invalid target feature name: %s\n",
Name + 1);
exit(1);
}
@@ -1482,7 +1482,7 @@
Opts.CPU = TargetCPU;
Opts.Features.clear();
- for (llvm::StringMap<bool>::const_iterator it = Features.begin(),
+ for (llvm::StringMap<bool>::const_iterator it = Features.begin(),
ie = Features.end(); it != ie; ++it) {
// FIXME: If we are completely confident that we have the right
// set, we only need to pass the minuses.
@@ -1490,9 +1490,9 @@
Name += it->first();
Opts.Features.push_back(Name);
}
-
+
Opts.NoCommon = NoCommon | LangOpts.CPlusPlus;
-
+
// Handle -ftime-report.
Opts.TimePasses = TimeReport;
@@ -1579,7 +1579,7 @@
#include "clang/Frontend/Analyses.def"
clEnumValEnd));
-static llvm::cl::opt<AnalysisStores>
+static llvm::cl::opt<AnalysisStores>
AnalysisStoreOpt("analyzer-store",
llvm::cl::desc("Source Code Analysis - Abstract Memory Store Models"),
llvm::cl::init(BasicStoreModel),
@@ -1589,7 +1589,7 @@
#include "clang/Frontend/Analyses.def"
clEnumValEnd));
-static llvm::cl::opt<AnalysisConstraints>
+static llvm::cl::opt<AnalysisConstraints>
AnalysisConstraintsOpt("analyzer-constraints",
llvm::cl::desc("Source Code Analysis - Symbolic Constraint Engines"),
llvm::cl::init(RangeConstraintsModel),
@@ -1681,7 +1681,7 @@
llvm::OwningPtr<DiagnosticClient> Chain1;
llvm::OwningPtr<DiagnosticClient> Chain2;
public:
-
+
LoggingDiagnosticClient(DiagnosticClient *Normal) {
// Output diags both where requested...
Chain1.reset(Normal);
@@ -1695,12 +1695,12 @@
!NoDiagnosticsFixIt,
MessageLength));
}
-
+
virtual void setLangOptions(const LangOptions *LO) {
Chain1->setLangOptions(LO);
Chain2->setLangOptions(LO);
}
-
+
virtual bool IncludeInDiagnosticCounts() const {
return Chain1->IncludeInDiagnosticCounts();
}
@@ -1715,11 +1715,11 @@
static void SetUpBuildDumpLog(unsigned argc, char **argv,
llvm::OwningPtr<DiagnosticClient> &DiagClient) {
-
+
std::string ErrorInfo;
BuildLogFile = new llvm::raw_fd_ostream(DumpBuildInformation.c_str(),
ErrorInfo);
-
+
if (!ErrorInfo.empty()) {
llvm::errs() << "error opening -dump-build-information file '"
<< DumpBuildInformation << "', option ignored!\n";
@@ -1733,7 +1733,7 @@
for (unsigned i = 0; i != argc; ++i)
(*BuildLogFile) << argv[i] << ' ';
(*BuildLogFile) << '\n';
-
+
// LoggingDiagnosticClient - Insert a new logging diagnostic client in between
// the diagnostic producers and the normal receiver.
DiagClient.reset(new LoggingDiagnosticClient(DiagClient.take()));
@@ -1772,7 +1772,7 @@
llvm::errs() << "ERROR: " << Error << "\n";
::exit(1);
}
-
+
if (OutFile != "-")
OutPath = OutFile;
@@ -1802,7 +1802,7 @@
OS.reset(ComputeOutFile(InFile, 0, false, OutPath));
Consumer.reset(CreateASTPrinter(OS.get()));
break;
-
+
case ASTPrintXML:
OS.reset(ComputeOutFile(InFile, "xml", false, OutPath));
Consumer.reset(CreateASTPrinterXML(OS.get()));
@@ -1831,7 +1831,7 @@
case EmitAssembly:
case EmitLLVM:
- case EmitBC:
+ case EmitBC:
case EmitLLVMOnly: {
BackendAction Act;
if (ProgAction == EmitAssembly) {
@@ -1860,7 +1860,7 @@
PP.Diag(SourceLocation(), diag::err_relocatable_without_without_isysroot);
RelocatablePCH.setValue(false);
}
-
+
OS.reset(ComputeOutFile(InFile, 0, true, OutPath));
if (RelocatablePCH.getValue())
Consumer.reset(CreatePCHGenerator(PP, OS.get(), isysroot.c_str()));
@@ -1920,7 +1920,7 @@
}
case RunPreprocessorOnly:
break;
-
+
case GeneratePTH: {
llvm::TimeRegion Timer(ClangFrontendTimer);
if (OutputFile.empty() || OutputFile == "-") {
@@ -1933,15 +1933,15 @@
CacheTokens(PP, static_cast<llvm::raw_fd_ostream*>(OS.get()));
ClearSourceMgr = true;
break;
- }
+ }
case PrintPreprocessedInput:
OS.reset(ComputeOutFile(InFile, 0, true, OutPath));
break;
-
+
case ParseNoop:
break;
-
+
case ParsePrintCallbacks: {
llvm::TimeRegion Timer(ClangFrontendTimer);
OS.reset(ComputeOutFile(InFile, 0, true, OutPath));
@@ -1955,13 +1955,13 @@
Consumer.reset(new ASTConsumer());
break;
}
-
+
case RewriteMacros:
OS.reset(ComputeOutFile(InFile, 0, true, OutPath));
RewriteMacrosInInput(PP, OS.get());
ClearSourceMgr = true;
break;
-
+
case RewriteTest:
OS.reset(ComputeOutFile(InFile, 0, true, OutPath));
DoRewriteTest(PP, OS.get());
@@ -1987,7 +1987,7 @@
PP.getLangOptions());
bool AddedFixitLocation = false;
- for (unsigned Idx = 0, Last = FixItAtLocations.size();
+ for (unsigned Idx = 0, Last = FixItAtLocations.size();
Idx != Last; ++Idx) {
RequestedSourceLocation Requested;
if (ResolveParsedLocation(FixItAtLocations[Idx],
@@ -2017,19 +2017,19 @@
PP.getBuiltinInfo(),
/* FreeMemory = */ !DisableFree,
/* size_reserve = */0));
-
+
llvm::OwningPtr<PCHReader> Reader;
llvm::OwningPtr<ExternalASTSource> Source;
-
+
if (!ImplicitIncludePCH.empty()) {
// If the user specified -isysroot, it will be used for relocatable PCH
// files.
const char *isysrootPCH = 0;
if (isysroot.getNumOccurrences() != 0)
isysrootPCH = isysroot.c_str();
-
+
Reader.reset(new PCHReader(PP, ContextOwner.get(), isysrootPCH));
-
+
// The user has asked us to include a precompiled header. Load
// the precompiled header into the AST context.
switch (Reader->ReadPCH(ImplicitIncludePCH)) {
@@ -2080,7 +2080,7 @@
// If we have an ASTConsumer, run the parser with it.
if (Consumer)
- ParseAST(PP, Consumer.get(), *ContextOwner.get(), Stats,
+ ParseAST(PP, Consumer.get(), *ContextOwner.get(), Stats,
CompleteTranslationUnit);
if (PA == RunPreprocessorOnly) { // Just lex as fast as we can, no output.
@@ -2106,7 +2106,7 @@
DisableLineMarkers, DumpDefines);
ClearSourceMgr = true;
}
-
+
if (FixItRewrite)
FixItRewrite->WriteFixedFile(InFile, OutputFile);
@@ -2116,7 +2116,7 @@
Consumer.take();
else
Consumer.reset();
-
+
// If in -disable-free mode, don't deallocate ASTContext.
if (DisableFree)
ContextOwner.take();
@@ -2136,7 +2136,7 @@
fprintf(stderr, "\n");
}
- // For a multi-file compilation, some things are ok with nuking the source
+ // For a multi-file compilation, some things are ok with nuking the source
// manager tables, other require stable fileid/macroid's across multiple
// files.
if (ClearSourceMgr)
@@ -2176,14 +2176,14 @@
llvm::cl::ParseCommandLineOptions(argc, argv,
"LLVM 'Clang' Compiler: http://clang.llvm.org\n");
-
+
if (TimeReport)
ClangFrontendTimer = new llvm::Timer("Clang front-end time");
-
+
if (Verbose)
llvm::errs() << "clang-cc version 1.0 based upon " << PACKAGE_STRING
<< " hosted on " << llvm::sys::getHostTriple() << "\n";
-
+
// If no input was specified, read from stdin.
if (InputFilenames.empty())
InputFilenames.push_back("-");
@@ -2227,17 +2227,17 @@
} else {
DiagClient.reset(CreateHTMLDiagnosticClient(HTMLDiag));
}
-
+
if (!DumpBuildInformation.empty()) {
if (!HTMLDiag.empty()) {
fprintf(stderr,
"-dump-build-information and -html-diags don't work together\n");
return 1;
}
-
+
SetUpBuildDumpLog(argc, argv, DiagClient);
}
-
+
// Configure our handling of diagnostics.
Diagnostic Diags(DiagClient.get());
@@ -2253,7 +2253,7 @@
// -I- is a deprecated GCC feature, scan for it and reject it.
for (unsigned i = 0, e = I_dirs.size(); i != e; ++i) {
if (I_dirs[i] == "-") {
- Diags.Report(FullSourceLoc(), diag::err_pp_I_dash_not_supported);
+ Diags.Report(FullSourceLoc(), diag::err_pp_I_dash_not_supported);
I_dirs.erase(I_dirs.begin()+i);
--i;
}
@@ -2262,18 +2262,18 @@
// Get information about the target being compiled for.
std::string Triple = CreateTargetTriple();
llvm::OwningPtr<TargetInfo> Target(TargetInfo::CreateTargetInfo(Triple));
-
+
if (Target == 0) {
- Diags.Report(FullSourceLoc(), diag::err_fe_unknown_triple)
+ Diags.Report(FullSourceLoc(), diag::err_fe_unknown_triple)
<< Triple.c_str();
return 1;
}
-
+
if (!InheritanceViewCls.empty()) // C++ visualization?
ProgAction = InheritanceView;
-
+
llvm::OwningPtr<SourceManager> SourceMgr;
-
+
// Create a file manager object to provide access to and cache the filesystem.
FileManager FileMgr;
@@ -2283,35 +2283,35 @@
for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
const std::string &InFile = InputFilenames[i];
-
+
/// Create a SourceManager object. This tracks and owns all the file
/// buffers allocated to a translation unit.
if (!SourceMgr)
SourceMgr.reset(new SourceManager());
else
SourceMgr->clearIDTables();
-
+
// Initialize language options, inferring file types from input filenames.
LangOptions LangInfo;
DiagClient->setLangOptions(&LangInfo);
-
+
InitializeBaseLanguage();
LangKind LK = GetLanguage(InFile);
InitializeLangOptions(LangInfo, LK);
InitializeLanguageStandard(LangInfo, LK, Target.get(), Features);
-
+
// Process the -I options and set them in the HeaderInfo.
HeaderSearch HeaderInfo(FileMgr);
-
-
+
+
InitializeIncludePaths(argv[0], HeaderInfo, FileMgr, LangInfo);
-
+
// Set up the preprocessor with these options.
DriverPreprocessorFactory PPFactory(Diags, LangInfo, *Target,
*SourceMgr.get(), HeaderInfo);
-
+
llvm::OwningPtr<Preprocessor> PP(PPFactory.CreatePreprocessor());
-
+
if (!PP)
continue;
@@ -2342,7 +2342,7 @@
if (ImplicitIncludePCH.empty()) {
if (InitializeSourceManager(*PP.get(), InFile))
continue;
-
+
// Initialize builtin info.
PP->getBuiltinInfo().InitializeBuiltins(PP->getIdentifierTable(),
PP->getLangOptions().NoBuiltin);
@@ -2353,7 +2353,7 @@
// Process the source file.
ProcessInputFile(*PP, PPFactory, InFile, ProgAction, Features, Context);
-
+
HeaderInfo.ClearFileInfo();
DiagClient->setLangOptions(0);
}
@@ -2362,7 +2362,7 @@
if (unsigned NumDiagnostics = Diags.getNumDiagnostics())
fprintf(stderr, "%d diagnostic%s generated.\n", NumDiagnostics,
(NumDiagnostics == 1 ? "" : "s"));
-
+
if (Stats) {
FileMgr.PrintStats();
fprintf(stderr, "\n");
@@ -2370,11 +2370,11 @@
delete ClangFrontendTimer;
delete BuildLogFile;
-
+
// If verifying diagnostics and we reached here, all is well.
if (VerifyDiagnostics)
return 0;
-
+
// Managed static deconstruction. Useful for making things like
// -time-passes usable.
llvm::llvm_shutdown();
Modified: cfe/trunk/tools/index-test/index-test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/index-test/index-test.cpp?rev=81346&r1=81345&r2=81346&view=diff
==============================================================================
--- cfe/trunk/tools/index-test/index-test.cpp (original)
+++ cfe/trunk/tools/index-test/index-test.cpp Wed Sep 9 10:08:12 2009
@@ -62,11 +62,11 @@
: AST(ast), Filename(filename),
DeclRefMap(ast->getASTContext()),
SelMap(ast->getASTContext()) { }
-
+
virtual ASTContext &getASTContext() { return AST->getASTContext(); }
virtual DeclReferenceMap &getDeclReferenceMap() { return DeclRefMap; }
virtual SelectorMap &getSelectorMap() { return SelMap; }
-
+
llvm::OwningPtr<ASTUnit> AST;
std::string Filename;
DeclReferenceMap DeclRefMap;
@@ -85,7 +85,7 @@
PrintDecls // Print declarations of the point-at node
};
-static llvm::cl::opt<ProgActions>
+static llvm::cl::opt<ProgActions>
ProgAction(
llvm::cl::desc("Choose action to perform on the pointed-at AST node:"),
llvm::cl::ZeroOrMore,
@@ -119,7 +119,7 @@
llvm::errs() << "Error: Cannot -print-refs on a ObjC message expression\n";
HadErrors = true;
return;
-
+
case PrintDecls: {
Analyz.FindObjCMethods(Msg, Results);
for (ResultsTy::iterator
@@ -144,7 +144,7 @@
static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) {
assert(ASTLoc.isValid());
-
+
if (ObjCMessageExpr *Msg =
dyn_cast_or_null<ObjCMessageExpr>(ASTLoc.getStmt()))
return ProcessObjCMessage(Msg, Idxer);
@@ -210,20 +210,20 @@
llvm::PrettyStackTraceProgram X(argc, argv);
llvm::cl::ParseCommandLineOptions(argc, argv,
"LLVM 'Clang' Indexing Test Bed: http://clang.llvm.org\n");
-
+
FileManager FileMgr;
Program Prog;
Indexer Idxer(Prog, FileMgr);
llvm::SmallVector<TUnit*, 4> TUnits;
-
+
// If no input was specified, read from stdin.
if (InputFilenames.empty())
InputFilenames.push_back("-");
for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
const std::string &InFile = InputFilenames[i];
-
+
std::string ErrMsg;
llvm::OwningPtr<ASTUnit> AST;
@@ -235,7 +235,7 @@
TUnit *TU = new TUnit(AST.take(), InFile);
TUnits.push_back(TU);
-
+
Idxer.IndexAST(TU);
}
@@ -272,7 +272,7 @@
"Couldn't resolve source location (invalid location)\n";
return 1;
}
-
+
ASTLoc = ResolveLocationInAST(FirstAST->getASTContext(), Loc);
if (ASTLoc.isInvalid()) {
llvm::errs() << "[" << FirstFile << "] Error: " <<
@@ -280,7 +280,7 @@
return 1;
}
}
-
+
if (ASTLoc.isValid()) {
if (ProgAction == PrintPoint) {
llvm::raw_ostream &OS = llvm::outs();
@@ -292,7 +292,7 @@
ProcessASTLocation(ASTLoc, Idxer);
}
}
-
+
if (HadErrors)
return 1;
@@ -304,6 +304,6 @@
// Managed static deconstruction. Useful for making things like
// -time-passes usable.
llvm::llvm_shutdown();
-
+
return 0;
}
More information about the cfe-commits
mailing list