]> granicus.if.org Git - clang/log
clang
15 years agoChange dyn_cast<> to isa<>. Pointed out by Anders (thanks).
Steve Naroff [Tue, 14 Apr 2009 00:40:09 +0000 (00:40 +0000)]
Change dyn_cast<> to isa<>. Pointed out by Anders (thanks).

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

15 years agoWhen writing a PCH file, keep track of all of the non-static,
Douglas Gregor [Tue, 14 Apr 2009 00:24:19 +0000 (00:24 +0000)]
When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.

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

15 years agoFix crasher in ASTContext::getObjCEncodingForMethodDecl().
Steve Naroff [Tue, 14 Apr 2009 00:03:58 +0000 (00:03 +0000)]
Fix crasher in ASTContext::getObjCEncodingForMethodDecl().

This was exposed as a result of something else that was recently fixed.

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

15 years agoPartial PCH support for FileScopeAsmDecl and BlockDecl. Both require
Douglas Gregor [Mon, 13 Apr 2009 22:49:25 +0000 (22:49 +0000)]
Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
expression or statement serialization before we can test them.

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

15 years agoPCH support for functions and their parameters.
Douglas Gregor [Mon, 13 Apr 2009 22:18:37 +0000 (22:18 +0000)]
PCH support for functions and their parameters.

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

15 years agoMinor work related to removing the assumption that value initialization
Eli Friedman [Mon, 13 Apr 2009 21:47:26 +0000 (21:47 +0000)]
Minor work related to removing the assumption that value initialization
implies an all-zero bit pattern.

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

15 years agoMinor simplification.
Eli Friedman [Mon, 13 Apr 2009 21:41:57 +0000 (21:41 +0000)]
Minor simplification.

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

15 years agoPR3461: reject initializer for incomplete type. Based on patch by Tim
Eli Friedman [Mon, 13 Apr 2009 21:28:54 +0000 (21:28 +0000)]
PR3461: reject initializer for incomplete type.  Based on patch by Tim
Northover.

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

15 years agoRemove CheckBuiltinMacros script, obsoleted since we support -dM now.
Daniel Dunbar [Mon, 13 Apr 2009 21:26:41 +0000 (21:26 +0000)]
Remove CheckBuiltinMacros script, obsoleted since we support -dM now.

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

15 years agoIgnore Output directory
Daniel Dunbar [Mon, 13 Apr 2009 21:25:25 +0000 (21:25 +0000)]
Ignore Output directory

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

15 years agoPCH support for record decls/types and their fields. Now that we can
Douglas Gregor [Mon, 13 Apr 2009 21:20:57 +0000 (21:20 +0000)]
PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.

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

15 years agoUpdate to use hasAttr() instead of getAttr().
Daniel Dunbar [Mon, 13 Apr 2009 21:08:27 +0000 (21:08 +0000)]
Update to use hasAttr() instead of getAttr().
 - No functionality change.

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

15 years agoPrint the number (and percentage) of identifiers read from the PCH file as part of...
Douglas Gregor [Mon, 13 Apr 2009 20:50:16 +0000 (20:50 +0000)]
Print the number (and percentage) of identifiers read from the PCH file as part of its statistics

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

15 years agoIntroduce PCH (de-)serialization for most compound types, excluding
Douglas Gregor [Mon, 13 Apr 2009 20:46:52 +0000 (20:46 +0000)]
Introduce PCH (de-)serialization for most compound types, excluding
Objective-C types and record types for the moment.

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

15 years agoReapply 68936, turned out to that clang's better debug info exposed a
Daniel Dunbar [Mon, 13 Apr 2009 20:46:33 +0000 (20:46 +0000)]
Reapply 68936, turned out to that clang's better debug info exposed a
codegenerator bug.

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

15 years agoMove/update recent FIXME (wrt UTF-8 checking for ObjC @-strings).
Steve Naroff [Mon, 13 Apr 2009 20:26:29 +0000 (20:26 +0000)]
Move/update recent FIXME (wrt UTF-8 checking for ObjC @-strings).

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

15 years agoupgrade "extra tokens at end of directive" to warn by default.
Chris Lattner [Mon, 13 Apr 2009 20:19:36 +0000 (20:19 +0000)]
upgrade "extra tokens at end of directive" to warn by default.

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

15 years agoIn objc2's None-Fragile ABI, one cannot use the super class ivar for
Fariborz Jahanian [Mon, 13 Apr 2009 19:30:37 +0000 (19:30 +0000)]
In objc2's None-Fragile ABI, one cannot use the super class ivar for
setter/getter synthesis.

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

15 years agoFixed crasher in <rdar://problem/6780904> [irgen] Assertion failed: (Result == conver...
Steve Naroff [Mon, 13 Apr 2009 19:08:08 +0000 (19:08 +0000)]
Fixed crasher in <rdar://problem/6780904> [irgen] Assertion failed: (Result == conversionOK && "UTF-8 to UTF-16 conversion failed"), function GetAddrOfConstantCFString, file CodeGenModule.cpp, line 1063.

Still a diagnostic related FIXME (will discuss with Daniel/Fariborz offline).

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

15 years agoAdd PCH support for enumerations and enumerators.
Douglas Gregor [Mon, 13 Apr 2009 18:14:40 +0000 (18:14 +0000)]
Add PCH support for enumerations and enumerators.

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

15 years agoRevert 68936, LLVM still isn't ready to handle debug info + optimization.
Daniel Dunbar [Mon, 13 Apr 2009 18:03:39 +0000 (18:03 +0000)]
Revert 68936, LLVM still isn't ready to handle debug info + optimization.

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

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