]> granicus.if.org Git - clang/log
clang
15 years agoUse the new guard variable mangling function and get rid of the old code.
Anders Carlsson [Mon, 13 Apr 2009 18:03:33 +0000 (18:03 +0000)]
Use the new guard variable mangling function and get rid of the old code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68971 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for mangling guard variables.
Anders Carlsson [Mon, 13 Apr 2009 18:02:10 +0000 (18:02 +0000)]
Add support for mangling guard variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68969 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange diagnostic as a result of researching <rdar://problem/6779809> missing interfa...
Steve Naroff [Mon, 13 Apr 2009 17:58:46 +0000 (17:58 +0000)]
Change diagnostic as a result of researching <rdar://problem/6779809> missing interface name in "error: cannot declare variable inside a class, protocol or category ''.

Since ObjC 2.0 class "extensions" have a null name, the diagnostic above is actually "correct". Nevertheless, it is confusing. Decided to remove the name entirely (from my perspective, it didn't add any value). Also simplified the text of the diagnostic a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68967 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix assertion failure in PTH when tokens followed a closing #endif.
Daniel Dunbar [Mon, 13 Apr 2009 17:57:49 +0000 (17:57 +0000)]
Fix assertion failure in PTH when tokens followed a closing #endif.
 - Ted, please check.

 - Missing test case because PTH won't reliably cache the tokens in a
   test case. *cough*

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68966 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake the reading of the line table from a PCH file more robust against
Douglas Gregor [Mon, 13 Apr 2009 17:12:42 +0000 (17:12 +0000)]
Make the reading of the line table from a PCH file more robust against
the unlikely event that the filename IDs in the stored line table end
up being different from the filename IDs in the newly-created line
table.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68965 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInclude the SourceManager's line table in the PCH file. We can now
Douglas Gregor [Mon, 13 Apr 2009 16:31:14 +0000 (16:31 +0000)]
Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68963 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFactor the internals of SourceManager (specially, LineTableInfo) into a separate...
Douglas Gregor [Mon, 13 Apr 2009 15:31:25 +0000 (15:31 +0000)]
Factor the internals of SourceManager (specially, LineTableInfo) into a separate Internals header. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68960 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake the selection of type declarations in Sema::getTypeName
Douglas Gregor [Mon, 13 Apr 2009 15:14:38 +0000 (15:14 +0000)]
Make the selection of type declarations in Sema::getTypeName
deterministic when faced with an ambiguity. This eliminates the
annoying test/SemaCXX/using-directive.cpp failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68952 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothe driver caught up. This makes -msse3 correctly set __SSE3__ etc.
Chris Lattner [Mon, 13 Apr 2009 06:33:49 +0000 (06:33 +0000)]
the driver caught up.  This makes -msse3 correctly set __SSE3__ etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68943 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix rdar://6774906, a crash handling implicit conversions between pointers
Chris Lattner [Mon, 13 Apr 2009 06:04:39 +0000 (06:04 +0000)]
fix rdar://6774906, a crash handling implicit conversions between pointers
in different address spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68941 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnable debug info generation while optimizing.
Devang Patel [Mon, 13 Apr 2009 04:22:59 +0000 (04:22 +0000)]
Enable debug info generation while optimizing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68936 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomention the non-standard builtin macros we support.
Chris Lattner [Mon, 13 Apr 2009 02:45:46 +0000 (02:45 +0000)]
mention the non-standard builtin macros we support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68935 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement the microsoft/gnu "__COUNTER__" macro: rdar://4329310
Chris Lattner [Mon, 13 Apr 2009 01:29:17 +0000 (01:29 +0000)]
implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68933 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove error recovery for calls, fixing:
Chris Lattner [Mon, 13 Apr 2009 00:10:38 +0000 (00:10 +0000)]
Improve error recovery for calls, fixing:
PR3972: Poor diagnostic with missing ')'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68932 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.
Chris Lattner [Sun, 12 Apr 2009 23:51:02 +0000 (23:51 +0000)]
fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.
by making ASTContext::isObjCObjectPointerType accept typedefs of id.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68931 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sun, 12 Apr 2009 23:49:38 +0000 (23:49 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68930 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd some more coverage.
Chris Lattner [Sun, 12 Apr 2009 23:29:27 +0000 (23:29 +0000)]
add some more coverage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68928 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up test.
Chris Lattner [Sun, 12 Apr 2009 23:27:53 +0000 (23:27 +0000)]
clean up test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68927 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sun, 12 Apr 2009 23:27:31 +0000 (23:27 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68926 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoif we already know that a decl is invalid in an @catch, don't verify its type.
Chris Lattner [Sun, 12 Apr 2009 23:26:56 +0000 (23:26 +0000)]
if we already know that a decl is invalid in an @catch, don't verify its type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68925 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix some out of date comments pointed out by Sebastian
Chris Lattner [Sun, 12 Apr 2009 22:37:57 +0000 (22:37 +0000)]
fix some out of date comments pointed out by Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68923 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a comment typo Sebastian noticed.
Chris Lattner [Sun, 12 Apr 2009 22:30:22 +0000 (22:30 +0000)]
fix a comment typo Sebastian noticed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68921 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd support for handling C++'0x unified initializer syntax
Chris Lattner [Sun, 12 Apr 2009 22:29:43 +0000 (22:29 +0000)]
add support for handling C++'0x unified initializer syntax
to isValidAfterIdentifierInDeclarator, as suggested by Sebastian.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68920 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix some C++ error recovery problems in init declarator parsing
Chris Lattner [Sun, 12 Apr 2009 22:23:27 +0000 (22:23 +0000)]
Fix some C++ error recovery problems in init declarator parsing
that I noticed working on other things.

Instead of emitting:

t2.cc:1:8: error: use of undeclared identifier 'g'
int x(*g);
       ^
t2.cc:1:10: error: expected ')'
int x(*g);
         ^
t2.cc:1:6: note: to match this '('
int x(*g);
     ^

We now only emit:

t2.cc:1:7: warning: type specifier missing, defaults to 'int'
int x(*g);
      ^

Note that the example in SemaCXX/nested-name-spec.cpp:f4 is still
not great, we now produce both of:

void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \
                      expected-error {{variable has incomplete type 'void'}}

The second diagnostic should be silenced by something getting marked invalid.
I don't plan to fix this though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68919 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix another case that assumed that GetTypeForDeclarator would never return null.
Chris Lattner [Sun, 12 Apr 2009 22:15:02 +0000 (22:15 +0000)]
fix another case that assumed that GetTypeForDeclarator would never return null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68918 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomark the declspec as invalid when we recover instead of forcing to int,
Chris Lattner [Sun, 12 Apr 2009 22:12:26 +0000 (22:12 +0000)]
mark the declspec as invalid when we recover instead of forcing to int,
this allows downstream diags to be properly silenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68917 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix code that incorrectly assumed that GetTypeForDeclarator cannot
Chris Lattner [Sun, 12 Apr 2009 22:12:06 +0000 (22:12 +0000)]
fix code that incorrectly assumed that GetTypeForDeclarator cannot
return null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68916 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDiagnose invalid uses of tagged types with a missing tag. For example, in:
Chris Lattner [Sun, 12 Apr 2009 21:49:30 +0000 (21:49 +0000)]
Diagnose invalid uses of tagged types with a missing tag.  For example, in:

struct xyz { int y; };
enum abc { ZZZ };

static xyz b;
abc c;

we used to produce:

t2.c:4:8: error: unknown type name 'xyz'
static xyz b;
       ^
t2.c:5:1: error: unknown type name 'abc'
abc c;
^

we now produce:

t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
static xyz b;
       ^
       struct
t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
abc c;
^
enum

GCC produces the normal:
t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’

rdar://6783347

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68914 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a valgrind problem I noticed while developing another patch,
Chris Lattner [Sun, 12 Apr 2009 20:51:10 +0000 (20:51 +0000)]
fix a valgrind problem I noticed while developing another patch,
if a decl is invalid, it isn't added to the Decls array, so we
need to pass in Decls.size() to avoid reading uninit memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68913 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement the first set of changes for PR3963 and rdar://6759604,
Chris Lattner [Sun, 12 Apr 2009 20:42:31 +0000 (20:42 +0000)]
Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename.  In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful.  For example, we now produce:

t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
       ^

instead of:

t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
             ^

Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:

t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
                   ^

I'd really appreciate any scrutiny possible on this, it
is a tricky area.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68911 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new isNull() method to DeclGroupRef.
Chris Lattner [Sun, 12 Apr 2009 20:13:14 +0000 (20:13 +0000)]
add a new isNull() method to DeclGroupRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68909 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoa few cleanups to StatementCreatesScope: unnest the whole thing,
Chris Lattner [Sun, 12 Apr 2009 20:09:42 +0000 (20:09 +0000)]
a few cleanups to StatementCreatesScope: unnest the whole thing,
exit at the first decl found that creates a scope, don't evaluate
decl_end() every iteration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68908 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new Decl::hasAttr<T>() predicate.
Chris Lattner [Sun, 12 Apr 2009 20:07:59 +0000 (20:07 +0000)]
add a new Decl::hasAttr<T>() predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68907 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOS dependent code removed.
Fariborz Jahanian [Sun, 12 Apr 2009 17:43:53 +0000 (17:43 +0000)]
OS dependent code removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68904 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd deleted functions and rvalue references to C++ status.
Sebastian Redl [Sun, 12 Apr 2009 17:41:24 +0000 (17:41 +0000)]
Add deleted functions and rvalue references to C++ status.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68903 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoParse deleted member functions. Parsing member declarations goes through a different...
Sebastian Redl [Sun, 12 Apr 2009 17:16:29 +0000 (17:16 +0000)]
Parse deleted member functions. Parsing member declarations goes through a different code path that I forgot previously.
Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now.
The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68902 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sun, 12 Apr 2009 09:04:18 +0000 (09:04 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68900 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix rdar://6770142 - Class and qualified id's are compatible, just like
Chris Lattner [Sun, 12 Apr 2009 09:02:39 +0000 (09:02 +0000)]
Fix rdar://6770142 - Class and qualified id's are compatible, just like
Class and unqualified id's are.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68899 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sun, 12 Apr 2009 08:47:09 +0000 (08:47 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68898 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomerge protocol-test-1.m -> protocol-test-2.m
Chris Lattner [Sun, 12 Apr 2009 08:46:44 +0000 (08:46 +0000)]
merge protocol-test-1.m -> protocol-test-2.m

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68897 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMerge forward-circular into protocol-test-2
Chris Lattner [Sun, 12 Apr 2009 08:45:55 +0000 (08:45 +0000)]
Merge forward-circular into protocol-test-2

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68896 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothis test is subsumed by protocol-test-2.m
Chris Lattner [Sun, 12 Apr 2009 08:44:47 +0000 (08:44 +0000)]
this test is subsumed by protocol-test-2.m

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68895 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix rdar://6771034: don't warn on use of forward declared protocol in protocol
Chris Lattner [Sun, 12 Apr 2009 08:43:13 +0000 (08:43 +0000)]
Fix rdar://6771034: don't warn on use of forward declared protocol in protocol
list of another protocol definition.  This warning is very noisy and GCC doesn't
produce it so existing code doesn't expect it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68894 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix typo in test name.
Chris Lattner [Sun, 12 Apr 2009 08:37:16 +0000 (08:37 +0000)]
fix typo in test name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68893 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agocall objc interfaces just "interfaces" in diagnostics, not "Objective-C types"
Chris Lattner [Sun, 12 Apr 2009 08:25:48 +0000 (08:25 +0000)]
call objc interfaces just "interfaces" in diagnostics, not "Objective-C types"
or "Objective-C interface types" etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68892 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement rdar://6780761, making sema reject some code that otherwise
Chris Lattner [Sun, 12 Apr 2009 08:11:20 +0000 (08:11 +0000)]
implement rdar://6780761, making sema reject some code that otherwise
crashes codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68891 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement support for GCC's -dD mode, which dumps -E output *and*
Chris Lattner [Sun, 12 Apr 2009 01:56:53 +0000 (01:56 +0000)]
Implement support for GCC's -dD mode, which dumps -E output *and*
macro definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68884 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a ppcallback hook for macro definitions.
Chris Lattner [Sun, 12 Apr 2009 01:39:54 +0000 (01:39 +0000)]
add a ppcallback hook for macro definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68883 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agonow that we have an identifier table in the PCH file, finish hooking up
Chris Lattner [Sat, 11 Apr 2009 21:15:38 +0000 (21:15 +0000)]
now that we have an identifier table in the PCH file, finish hooking up
macro deserialization.  We now correctly install II's in tokens, handle
function-like macros, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68882 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotest this in non-pch mode as well as in pch mode.
Chris Lattner [Sat, 11 Apr 2009 20:52:19 +0000 (20:52 +0000)]
test this in non-pch mode as well as in pch mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68881 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove location info for property stuff. In a property like this:
Chris Lattner [Sat, 11 Apr 2009 20:14:49 +0000 (20:14 +0000)]
improve location info for property stuff.  In a property like this:
@property int x;

associate the location of X with the property decl, not the location
of the @.  Also, pass this info along to the synthesized ParmVarDecls
so that redefinition and other diagnostics can use it.  This eliminates
a fixme.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68880 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove the 'conflicting types' diagnostics to include correct location info, now
Chris Lattner [Sat, 11 Apr 2009 19:58:42 +0000 (19:58 +0000)]
improve the 'conflicting types' diagnostics to include correct location info, now
that it is plumbed through Sema.  On a file from growl, we used to emit:

t.mi:107059:1: warning: conflicting types for 'removePluginHandler:forPluginTypes:'
- (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions {
^
t.mi:105280:1: note: previous definition is here
- (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types;
^

now we produce:

t.mi:107059:55: warning: conflicting parameter types in implementation of 'removePluginHandler:forPluginTypes:': 'id<NSObject>' vs 'id<GrowlPluginHandler>'
- (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions {
                                                      ^
t.mi:105280:45: note: previous definition is here
- (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types;
                                            ^

We still don't have proper loc info for properties, hence the FIXME.

rdar://6782494

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68879 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agopass -fblocks
Chris Lattner [Sat, 11 Apr 2009 19:49:49 +0000 (19:49 +0000)]
pass -fblocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68878 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet proper location info on objc method arguments.
Chris Lattner [Sat, 11 Apr 2009 19:42:43 +0000 (19:42 +0000)]
Set proper location info on objc method arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68877 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify code to use adjustParameterType, apply objc arg attributes
Chris Lattner [Sat, 11 Apr 2009 19:34:56 +0000 (19:34 +0000)]
simplify code to use adjustParameterType, apply objc arg attributes
to their arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68876 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix blocks to reject objc interfaces returned by value. Also,
Chris Lattner [Sat, 11 Apr 2009 19:27:54 +0000 (19:27 +0000)]
fix blocks to reject objc interfaces returned by value.  Also,
a block without a prototype should still coerce a return in it to
use the declared return type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68875 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix test
Chris Lattner [Sat, 11 Apr 2009 19:18:22 +0000 (19:18 +0000)]
fix test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68874 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodiagnose attempts to return objc interfaces by-value from C functions.
Chris Lattner [Sat, 11 Apr 2009 19:17:25 +0000 (19:17 +0000)]
diagnose attempts to return objc interfaces by-value from C functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68873 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove the 'cannot pass objc interface by value' diagnostic:
Chris Lattner [Sat, 11 Apr 2009 19:08:56 +0000 (19:08 +0000)]
Improve the 'cannot pass objc interface by value' diagnostic:
1) improve localizability by not passing english strings in.
2) improve location for arguments.
3) print the objc type being passed.

Before:
method-bad-param.m:15:1: error: Objective-C type cannot be passed by value
-(void) my_method:(foo) my_param
^

after:
method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value
-(void) my_method:(foo) my_param
                        ^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68872 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agochange the interface to ActOnMethodDeclaration to pass down argument
Chris Lattner [Sat, 11 Apr 2009 18:57:04 +0000 (18:57 +0000)]
change the interface to ActOnMethodDeclaration to pass down argument
information in a little struct instead of individually.  While we're
at it, add per-argument loc info and attribute info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68871 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor refactoring of my last patch.
Fariborz Jahanian [Sat, 11 Apr 2009 18:54:57 +0000 (18:54 +0000)]
Minor refactoring of my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68870 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosink abstract typedefs like Action::ExprTy from the Action class
Chris Lattner [Sat, 11 Apr 2009 18:48:18 +0000 (18:48 +0000)]
sink abstract typedefs like Action::ExprTy from the Action class
down to the ActionBase class.  This eliminates dependencies of (e.g.)
DeclSpec.h on Action.h, meaning that action.h can now include these
headers and use their types directly in the actions interfaces.

This is a refactoring to support a future change, no functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68869 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd some #includes for better compatibility with gcc 4.4,
Chris Lattner [Sat, 11 Apr 2009 18:40:46 +0000 (18:40 +0000)]
add some #includes for better compatibility with gcc 4.4,
thanks to Tobias Stadler for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68868 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename Parser::ParseObjCSelector -> Parser::ParseObjCSelectorPiece,
Chris Lattner [Sat, 11 Apr 2009 18:13:45 +0000 (18:13 +0000)]
rename Parser::ParseObjCSelector -> Parser::ParseObjCSelectorPiece,
since it only parses one identifier out of the selector, not the
whole thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68867 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify this code to not bother stripping to canonical types, and
Chris Lattner [Sat, 11 Apr 2009 18:01:59 +0000 (18:01 +0000)]
simplify this code to not bother stripping to canonical types, and
indent code properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68866 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixes a ir-gen crash for K&R style blocks.
Fariborz Jahanian [Sat, 11 Apr 2009 17:55:15 +0000 (17:55 +0000)]
Fixes a ir-gen crash for K&R style blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68865 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd radar number
Chris Lattner [Sat, 11 Apr 2009 17:26:58 +0000 (17:26 +0000)]
add radar number

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68864 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate analyzer build.
Ted Kremenek [Sat, 11 Apr 2009 04:57:08 +0000 (04:57 +0000)]
Update analyzer build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68860 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoanalyzer: We cannot bind values to CodeTextRegions.
Ted Kremenek [Sat, 11 Apr 2009 02:32:27 +0000 (02:32 +0000)]
analyzer: We cannot bind values to CodeTextRegions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68857 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweak wording, input argument isn't necessarily a "file", things like
Daniel Dunbar [Sat, 11 Apr 2009 02:06:32 +0000 (02:06 +0000)]
Tweak wording, input argument isn't necessarily a "file", things like
-lstdc++ are inputs too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68854 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't mangle variables that are at translation unit scope.
Anders Carlsson [Sat, 11 Apr 2009 01:19:45 +0000 (01:19 +0000)]
Don't mangle variables that are at translation unit scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68853 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for generating reference initialization code.
Anders Carlsson [Sat, 11 Apr 2009 01:08:03 +0000 (01:08 +0000)]
Add support for generating reference initialization code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68852 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd analyzer support for objc_atomicCompareAndSwap()
Ted Kremenek [Sat, 11 Apr 2009 00:54:13 +0000 (00:54 +0000)]
Add analyzer support for objc_atomicCompareAndSwap()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68849 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStore unique IDs for identifiers in the PCH file. Use some bitmangling
Douglas Gregor [Sat, 11 Apr 2009 00:14:32 +0000 (00:14 +0000)]
Store unique IDs for identifiers in the PCH file. Use some bitmangling
so that we only need to perform the lookup and identifier resolution
once per identifier in the PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68846 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement analyzer support for OSCompareAndSwap. This required pushing "tagged"
Ted Kremenek [Sat, 11 Apr 2009 00:11:10 +0000 (00:11 +0000)]
Implement analyzer support for OSCompareAndSwap. This required pushing "tagged"
ProgramPoints all the way through to GRCoreEngine.

NSString.m now fails with RegionStoreManager because of the void** cast.
Disabling use of region store for that test for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68845 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNon-pointer objects are none gc'able regardles of
Fariborz Jahanian [Sat, 11 Apr 2009 00:00:54 +0000 (00:00 +0000)]
Non-pointer objects are none gc'able regardles of
the attribute set on them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68844 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCompare the predefines buffer in the PCH file with the predefines
Douglas Gregor [Fri, 10 Apr 2009 23:10:45 +0000 (23:10 +0000)]
Compare the predefines buffer in the PCH file with the predefines
buffer generated for the current translation unit. If they are
different, complain and then ignore the PCH file. This effectively
checks for all compilation options that somehow would affect
preprocessor state (-D, -U, -include, the dreaded -imacros, etc.).

When we do accept the PCH file, throw away the contents of the
predefines buffer rather than parsing them, since all of the results
of that parsing are already stored in the PCH file. This eliminates
the ugliness with the redefinition of __builtin_va_list, among other
things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68838 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixup copy/dispose helpers for Objective-C. Radar 6756504
Mike Stump [Fri, 10 Apr 2009 23:09:55 +0000 (23:09 +0000)]
Fixup copy/dispose helpers for Objective-C.  Radar 6756504

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68837 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoForce driver triple.
Daniel Dunbar [Fri, 10 Apr 2009 22:53:25 +0000 (22:53 +0000)]
Force driver triple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68836 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove asserts that weren't really useful, and that would fire in case the CleanupEnt...
Anders Carlsson [Fri, 10 Apr 2009 22:49:13 +0000 (22:49 +0000)]
Remove asserts that weren't really useful, and that would fire in case the CleanupEntries vector needed to be reallocated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68835 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix another fallout from defining __weak unconditionally.
Fariborz Jahanian [Fri, 10 Apr 2009 22:42:54 +0000 (22:42 +0000)]
Fix another fallout from defining __weak unconditionally.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68834 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't set both readnone and readonly.
Daniel Dunbar [Fri, 10 Apr 2009 22:14:52 +0000 (22:14 +0000)]
Don't set both readnone and readonly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68833 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodo a dance with predefines, and finally enable reading of macros from
Chris Lattner [Fri, 10 Apr 2009 22:13:17 +0000 (22:13 +0000)]
do a dance with predefines, and finally enable reading of macros from
PCH.  This works now, except for limitations not being able to do things
with identifiers.  The basic example in the testcase works though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68832 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed the test.
Fariborz Jahanian [Fri, 10 Apr 2009 22:09:52 +0000 (22:09 +0000)]
Fixed the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68831 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove a bunch of code for initializing the predefines buffer out of Preprocessor.cpp
Chris Lattner [Fri, 10 Apr 2009 21:58:23 +0000 (21:58 +0000)]
move a bunch of code for initializing the predefines buffer out of Preprocessor.cpp
into clang-cc.cpp.  This makes it so clang-cc constructs the *entire* predefines
buffer, not just half of it.  A bonus of this is that we get to kill a copy
of DefineBuiltinMacro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68830 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a test case for my last patch.
Fariborz Jahanian [Fri, 10 Apr 2009 21:43:13 +0000 (21:43 +0000)]
Add a test case for my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68829 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd support for reading macros. This does all the reading (with a bunch of
Chris Lattner [Fri, 10 Apr 2009 21:41:48 +0000 (21:41 +0000)]
add support for reading macros.  This does all the reading (with a bunch of
fixme's, e.g. for tokens with identifiers) but does not actually install
them.  Some details with the predefines buffer needs to be sorted out first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68828 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake a method public
Chris Lattner [Fri, 10 Apr 2009 21:40:09 +0000 (21:40 +0000)]
make a method public

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68827 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoForce triple for a number of tests that rely on __weak.
Daniel Dunbar [Fri, 10 Apr 2009 21:23:20 +0000 (21:23 +0000)]
Force triple for a number of tests that rely on __weak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68826 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify code.
Chris Lattner [Fri, 10 Apr 2009 21:17:07 +0000 (21:17 +0000)]
simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68825 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEncode the target triple in the PCH file, and check that target triple when using...
Douglas Gregor [Fri, 10 Apr 2009 21:16:55 +0000 (21:16 +0000)]
Encode the target triple in the PCH file, and check that target triple when using the PCH file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68824 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd arbitrary "tags" to ProgramPoints. While this fattens up ProgramPoint even
Ted Kremenek [Fri, 10 Apr 2009 21:06:25 +0000 (21:06 +0000)]
Add arbitrary "tags" to ProgramPoints. While this fattens up ProgramPoint even
more, it gives us a tremendous amount of flexibility for extending the analyzer
to handle arbitrary program points.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68823 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHonor MACOSX_DEPLOYMENT_TARGET environment variable.
Daniel Dunbar [Fri, 10 Apr 2009 21:00:07 +0000 (21:00 +0000)]
Honor MACOSX_DEPLOYMENT_TARGET environment variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68822 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement serialization/deserialization of LangOptions in the PCH
Douglas Gregor [Fri, 10 Apr 2009 20:39:37 +0000 (20:39 +0000)]
Implement serialization/deserialization of LangOptions in the PCH
file. When de-serializing LangOptions, we check that the
currently-provided language options are consistent with the options
used to compile the PCH file. If they are not, we emit a diagnostic
and ignore the PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68820 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReject compiles for x86_64 target for MacOS versions which
Fariborz Jahanian [Fri, 10 Apr 2009 20:33:45 +0000 (20:33 +0000)]
Reject compiles for x86_64 target for MacOS versions which
do not support it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68819 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInternal variables could mistakenly have "hidden" visibility when
Daniel Dunbar [Fri, 10 Apr 2009 20:26:50 +0000 (20:26 +0000)]
Internal variables could mistakenly have "hidden" visibility when
their emission was deferred.
 - <rdar://problem/6775234> variables with internal linkage should not
   be exposed with -fvisibility=hidden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68818 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest case for -miphoneos-version-min, also part of Shantonu's patch!
Daniel Dunbar [Fri, 10 Apr 2009 20:13:51 +0000 (20:13 +0000)]
Test case for -miphoneos-version-min, also part of Shantonu's patch!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68817 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Forward -miphoneos-version-min to clang.
Daniel Dunbar [Fri, 10 Apr 2009 20:11:50 +0000 (20:11 +0000)]
Driver: Forward -miphoneos-version-min to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68816 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSupport -miphoneos-version-min in clang-cc.
Daniel Dunbar [Fri, 10 Apr 2009 19:52:24 +0000 (19:52 +0000)]
Support -miphoneos-version-min in clang-cc.
 - Patch by Shantonu Sen (with a minor tweak to split out
   getDarwin{OSX,IPhoneOS}Defines)!

 - <rdar://problem/6776277> Need clang-cc/ccc-analyzer support for
   -miphoneos-version-min

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68815 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSupport %S in Python TestRunner
Daniel Dunbar [Fri, 10 Apr 2009 19:49:21 +0000 (19:49 +0000)]
Support %S in Python TestRunner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68814 91177308-0d34-0410-b5e6-96231b3b80d8