Граф коммитов

5417 Коммитов

Автор SHA1 Сообщение Дата
Steve Naroff fd942628ab 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
2009-04-13 20:26:29 +00:00
Fariborz Jahanian 29da66ec56 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
2009-04-13 19:30:37 +00:00
Steve Naroff aa4a756185 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
2009-04-13 19:08:08 +00:00
Douglas Gregor 0a2b45e588 Add PCH support for enumerations and enumerators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 18:14:40 +00:00
Anders Carlsson 283a062a63 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
2009-04-13 18:03:33 +00:00
Anders Carlsson 41aa8c1e40 Add support for mangling guard variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 18:02:10 +00:00
Steve Naroff 87454161a6 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
2009-04-13 17:58:46 +00:00
Daniel Dunbar 8533bd5a32 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
2009-04-13 17:57:49 +00:00
Douglas Gregor ff0a9872aa 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
2009-04-13 17:12:42 +00:00
Douglas Gregor bd94500d3a 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
2009-04-13 16:31:14 +00:00
Douglas Gregor d4f77aa7c2 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
2009-04-13 15:31:25 +00:00
Douglas Gregor 841b53c502 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
2009-04-13 15:14:38 +00:00
Chris Lattner c1f9d828c7 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
2009-04-13 01:29:17 +00:00
Chris Lattner 1721a2dfc0 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
2009-04-13 00:10:38 +00:00
Chris Lattner 16ede0ec39 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
2009-04-12 23:51:02 +00:00
Chris Lattner 93c4945c9e 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
2009-04-12 23:26:56 +00:00
Chris Lattner b6688e02d2 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
2009-04-12 22:37:57 +00:00
Chris Lattner 51172d12a5 fix a comment typo Sebastian noticed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 22:30:22 +00:00
Chris Lattner c83c27af68 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
2009-04-12 22:29:43 +00:00
Chris Lattner 8129edbb57 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
2009-04-12 22:23:27 +00:00
Chris Lattner 6491f47670 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
2009-04-12 22:15:02 +00:00
Chris Lattner 33c6ebef6f 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
2009-04-12 22:12:26 +00:00
Chris Lattner 798d5696ef 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
2009-04-12 22:12:06 +00:00
Chris Lattner 4c97d762d8 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
2009-04-12 21:49:30 +00:00
Chris Lattner 5186872629 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
2009-04-12 20:51:10 +00:00
Chris Lattner c199ab3ea1 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
2009-04-12 20:42:31 +00:00
Chris Lattner 20401698e3 add a new isNull() method to DeclGroupRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 20:13:14 +00:00
Chris Lattner bfc861e703 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
2009-04-12 20:09:42 +00:00
Sebastian Redl e2b6833d44 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
2009-04-12 17:16:29 +00:00
Chris Lattner 2c4463f744 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
2009-04-12 09:02:39 +00:00
Chris Lattner 58fe03bc80 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
2009-04-12 08:43:13 +00:00
Chris Lattner 312531a8cd 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
2009-04-12 08:11:20 +00:00
Chris Lattner d82df3ad43 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
2009-04-12 01:56:53 +00:00
Chris Lattner f4a72b0774 add a ppcallback hook for macro definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 01:39:54 +00:00
Chris Lattner 7356a31327 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
2009-04-11 21:15:38 +00:00
Chris Lattner d1e0f5a8ec 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
2009-04-11 20:14:49 +00:00
Chris Lattner 3aff919532 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
2009-04-11 19:58:42 +00:00
Chris Lattner 7db638d122 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
2009-04-11 19:42:43 +00:00
Chris Lattner f97e8fa296 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
2009-04-11 19:34:56 +00:00
Chris Lattner 9097af160e 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
2009-04-11 19:27:54 +00:00
Chris Lattner bb74982f30 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
2009-04-11 19:17:25 +00:00
Chris Lattner 2dd979fbd5 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
2009-04-11 19:08:56 +00:00
Chris Lattner e294d3fbaf 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
2009-04-11 18:57:04 +00:00
Fariborz Jahanian da0895d003 Minor refactoring of my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11 18:54:57 +00:00
Chris Lattner 8f823d2d3c 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
2009-04-11 18:48:18 +00:00
Chris Lattner 3c304bd9ec 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
2009-04-11 18:40:46 +00:00
Chris Lattner 2fc5c2428e 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
2009-04-11 18:13:45 +00:00
Chris Lattner 5272b7f6ac 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
2009-04-11 18:01:59 +00:00
Fariborz Jahanian 140fb26e74 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
2009-04-11 17:55:15 +00:00
Anders Carlsson 9ccb06598f 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
2009-04-11 01:19:45 +00:00
Anders Carlsson 1e5dc6e12c Add support for generating reference initialization code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11 01:08:03 +00:00
Ted Kremenek b3bf76fb24 Add analyzer support for objc_atomicCompareAndSwap()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11 00:54:13 +00:00
Douglas Gregor afaf308b77 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
2009-04-11 00:14:32 +00:00
Ted Kremenek 1670e403c4 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
2009-04-11 00:11:10 +00:00
Fariborz Jahanian c2112181b9 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
2009-04-11 00:00:54 +00:00
Douglas Gregor e1d918e9fe 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
2009-04-10 23:10:45 +00:00
Mike Stump c0c0ef061f 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
2009-04-10 23:09:55 +00:00
Anders Carlsson a6cd009e17 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
2009-04-10 22:49:13 +00:00
Fariborz Jahanian 0a9217f546 Fix another fallout from defining __weak unconditionally.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 22:42:54 +00:00
Daniel Dunbar 64c2e07626 Don't set both readnone and readonly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 22:14:52 +00:00
Chris Lattner 531cc83556 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
2009-04-10 22:13:17 +00:00
Chris Lattner 6bf0f4ce59 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
2009-04-10 21:58:23 +00:00
Chris Lattner 42d42b5b84 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
2009-04-10 21:41:48 +00:00
Chris Lattner 555589dd01 simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 21:17:07 +00:00
Douglas Gregor 2bec0410d2 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
2009-04-10 21:16:55 +00:00
Daniel Dunbar f36a06a958 Honor MACOSX_DEPLOYMENT_TARGET environment variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 21:00:07 +00:00
Douglas Gregor 0a0428e96c 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
2009-04-10 20:39:37 +00:00
Daniel Dunbar 7e714cd931 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
2009-04-10 20:26:50 +00:00
Daniel Dunbar ff8857a9e6 Driver: Forward -miphoneos-version-min to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 20:11:50 +00:00
Daniel Dunbar 8d33cd77dc 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
2009-04-10 19:52:24 +00:00
Mike Stump b7477cf6cf Fixup codegen for nested blocks that use copy/dispose in the inner
blocks, so that the outer blocks use it as well.  Radar 6762279


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:52:28 +00:00
Fariborz Jahanian 960cd06eab Patch to generate meta-data for prtocol used
in @protocol expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:47:34 +00:00
Daniel Dunbar a1e2fd9b58 Driver: CCC_ADD_ARGS could end up using dangling pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:32:59 +00:00
Ted Kremenek 5a11295a7d Use getDeclName() instead of getIdentifier() (safe against null pointers)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:25:37 +00:00
Chris Lattner d14f27053c add a new PP_MACRO_NAME hack so that I can test object-like macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:22:18 +00:00
Ted Kremenek fc3388dfdd Move a few more NonLoc static functions to ValueManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:11:44 +00:00
Chris Lattner df961c28f8 emit tokens, constify the Preprocessor passed down into PCH writer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:08:30 +00:00
Chris Lattner 7c5d24efcd emit function-like and object-like macros to the PCH file.
Note that we don't do anything useful with identifier infos yet
and don't emit the tokens that the macros are defined to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 18:00:12 +00:00
Douglas Gregor f1202511ee Add PCH sources to CMake build files
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 17:28:42 +00:00
Douglas Gregor 8038d5182b Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 17:25:41 +00:00
Chris Lattner f04ad69fed improve punctuation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 17:16:57 +00:00
Chris Lattner 0b1fb98801 Arrange for the preprocessor to be passed down into the PCH writer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 17:15:23 +00:00
Zhongxing Xu ec13d92066 Add prototype for CodeTextRegion.
A CodeTextRegion wraps two kinds of data: FunctionDecl* or SymbolRef. 
The latter comes from the symbolic function pointer that are generated from
function calls or input data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 08:45:10 +00:00
Zhongxing Xu 3330dcb0da Finally nuke loc::SymbolVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 06:06:13 +00:00
Anders Carlsson 2f1169f45b Use correct alignment and size for references in records as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68769 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 05:31:15 +00:00
Anders Carlsson 12e330c46a Rename variables to avoid conflict.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 04:59:59 +00:00
Anders Carlsson 1b78276a75 Add Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr as an LValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 04:54:13 +00:00
Anders Carlsson f0930235ce Fix thinko noticed by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 04:52:36 +00:00
Anders Carlsson 4cc2cfd48d Use the same alignment for reference declarations as for pointer declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 04:47:03 +00:00
Douglas Gregor 14f79002e5 PCH serialization/deserialization of the source manager. With this
improvement, source locations read from the PCH file will properly
resolve to the source files that were used to build the PCH file
itself.

Once we have the preprocessor state stored in the PCH file, source
locations that refer to macro instantiations that occur in the PCH
file should have the appropriate instantiation information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 03:52:48 +00:00
Ted Kremenek 52e5602056 Fix: <rdar://problem/6776949> Branch condition evaluates to an uninitialized value (argc is guaranteed to be >= 1)
The analyzer now adds the precondition that the first argument of 'main' is > 0.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 00:59:50 +00:00
Chris Lattner 11c7d32ac2 Make messages consistent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 00:37:08 +00:00
Chris Lattner b75863d53b reject codegen of __thread variables as unimplemented, rdar://6775265
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 00:35:59 +00:00
Ted Kremenek b725232b46 Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
clients of the analyzer to designate custom assertion routines as "noreturn"
functions from the analyzer's perspective but not the compiler's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 00:01:14 +00:00
Douglas Gregor 2cf2634ffd Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 22:27:44 +00:00
Ted Kremenek 8d7f5481a0 - Move ownership of MemRegionManager into ValueManager.
- Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly
simplifies the calling interface to clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 22:22:44 +00:00
Anders Carlsson c612f7bc9a Add @encode support for complex types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 21:55:45 +00:00
Douglas Gregor 6ab3524f72 Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 21:40:53 +00:00
Eli Friedman d296836d0d Add some FIXMEs for missing checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 21:26:42 +00:00
Douglas Gregor c36c540c5b Simple DeclContext's internal representation by always storing a
StoredDeclsMap, instead of using the it's-an-array-or-its-a-map
trick. I'll verify that performance isn't impacted later; for now, I
need the common representation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 17:29:08 +00:00
Ted Kremenek 8e5fb2849d Remove SVal::MakeZero and replace it with ValueManager::makeZeroVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 16:46:55 +00:00
Ted Kremenek 044b6f0417 analyzer: Introduce a new class, ValueManager, that serves as an aggregate
"manager of symbolic values", wrapping BasicValueFactory, SymbolManager, and
MemRegionManager. While these individual managers nicely separate functionality
in the analyzer, constructing symbolic values can sometimes be cumbersome
because it requires using multiple managers at once. The goal of this class is
to create some factory methods to create SVals that require the use of these
different managers, thus (hopefully) simplifying the analyzer API for clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 16:13:17 +00:00
Zhongxing Xu c565b63a79 stop using loc::SymbolVal and clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 07:39:46 +00:00
Zhongxing Xu 021887efe6 clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 07:04:45 +00:00
Zhongxing Xu caf8ce1de6 clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 07:01:16 +00:00
Zhongxing Xu 9cafcd5ce5 clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:56:25 +00:00
Zhongxing Xu cfe2991306 clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:53:24 +00:00
Zhongxing Xu ea7c5ce477 stop using loc::SymbolVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:49:52 +00:00
Zhongxing Xu 8944c49287 stop using loc::SymbolVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:43:44 +00:00
Zhongxing Xu f97c070628 stop using loc::SymbolVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:41:51 +00:00
Zhongxing Xu bd41db927a clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:35:30 +00:00
Zhongxing Xu 6782f75fd0 clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:32:20 +00:00
Zhongxing Xu fe1635bb27 Add a new method because sometimes the type of the conjured symbol is not the
type of the expression where we create the symbol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:30:17 +00:00
Zhongxing Xu 9e82acb49d make a conjured symbol as the original code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:18:05 +00:00
Zhongxing Xu 51ae79044d clean up code with new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:03:54 +00:00
Ted Kremenek f8769c8c1b Fix a null pointer dereference error due to state caching in a loop involving
sending a message to a nil receiver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 06:02:06 +00:00
Zhongxing Xu 867418fdb5 Create a symbolic region instead of a loc::SymbolVal. This is a continued step
to eliminate the use of loc::SymbolVal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 05:57:11 +00:00
Ted Kremenek fe630b943e GRExprEngine: Don't try to reason about the size of 'void' for the return type
of messages sent to nil.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 05:45:56 +00:00
Ted Kremenek 24ae89a5a2 Another ParentMap bug: only the right side of a comma expression is consumed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 05:34:31 +00:00
Ted Kremenek e644939bf8 Fix another regression introduced by changes to the analyzer's reasoning about
nil receivers in message expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 04:06:51 +00:00
Ted Kremenek e8dbf06c2b Refactor/cleanup reasoning of nil receivers in message expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 00:00:02 +00:00
Daniel Dunbar c21c485b4f Driver: Split out CPP specific options for clang so that we don't end
up adding them twice when running with -no-integrated-cpp or
-save-temps.
 - <rdar://problem/6766636> -save-temps falls over with prefix headers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 23:54:23 +00:00
Steve Naroff a0c3e9cde1 Fix <rdar://problem/6770998> make cast of super illegal (again:-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68659 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 23:52:26 +00:00
Anders Carlsson 782f397c14 Use the new EmitCallArgs function. No indented functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 23:13:16 +00:00
Fariborz Jahanian 0c7ce5bcfa Added a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 21:54:52 +00:00
Chris Lattner fd10511b3e finish the implementation of -imacros. The driver still needs to be hooked up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 20:53:24 +00:00
Anders Carlsson 0139bb9649 Add code for emitting call arguments (not used yet).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 20:47:54 +00:00
Anders Carlsson e9918d2443 We weren't generating correct code for calls to variadic member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 20:31:57 +00:00
Daniel Dunbar 4af44129dd Fix buffer overrun when laying out synthesized ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 20:18:15 +00:00
Fariborz Jahanian d2869925b5 Fixed a problem using property syntax on a 'super'
used as receiver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 19:50:10 +00:00
Devang Patel 0f78feaecf Use presumed location to get line number info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 19:47:04 +00:00
Ted Kremenek da9ae6088b Enhance analyzer reasoning about sending messages to nil. A nil receiver returns 0 for scalars of size <= sizeof(void*).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:51:08 +00:00
Ted Kremenek e42ac98bc2 Fix bug in ParentMap::isConsumedExpr. A BinaryOperator always "consumes" the
value of its subexpressions unless it is a comma (in which case it doesn't
consume the left subexpression).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:49:36 +00:00
Chris Lattner de076650fa reject the #__include_macros directive unless it comes from the
predefines buffer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:46:40 +00:00
Chris Lattner b8e240ed8b Add initial support for -imacros. Right now it has the same semantics as
-include, but that will be fixed soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:24:34 +00:00
Daniel Dunbar 3bbc75302f More fixes to builtin preprocessor defines.
- Add -static-define option driver can use when __STATIC__ should be
   defined (instead of __DYNAMIC__).

 - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.

 - Set __NO_INLINE__ following GCC 4.2.

 - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.

 - Set __EXCEPTIONS for Objective-C NonFragile ABI.

 - Set __STRICT_ANSI__ for standard conforming modes.

 - I added a clang style test case in utils for this, but its not
   particularly portable and I don't think it belongs in the test
   suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:03:55 +00:00
Steve Naroff 9158804749 Sema::CheckConditionalOperands(): Soften pointer/integer mismatch from error->warning.
Fixes <rdar://problem/6762239> [sema] gcc incompatibility; error on incompatible operand types in ?:.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 17:05:15 +00:00
Daniel Dunbar ab4eff620a Make sure value is initialized when built w/o asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 16:23:09 +00:00
Douglas Gregor 2c2d9dc382 -Wmissing-prototypes shouldn't complain about main() missing a prototype.
Fixes <rdar://problem/6759522>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 15:21:36 +00:00
Daniel Dunbar edfa02b85b Darwin ld: Unconditionally add -lstdc++ if we are pretending to be
g++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 06:06:21 +00:00
Daniel Dunbar c9abc043af Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 05:11:16 +00:00
Anders Carlsson e9352cc981 Add a destination type argument to EmitConstantExpr. This will be used for when the destination has a reference type. (No functionality change yet)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 04:48:15 +00:00
Daniel Dunbar 8158a2f78c Implementation definition of interfaces with __objc_exception attribute.
- Complete <rdar://problem/6635883> Support __objc_exception__
   attribute


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 04:21:03 +00:00
Sanjiv Gupta 75c47a5cdf Pointer width on targets like PIC16 is 16-bit, while the valid index size to GEP is only 32 or 64. So promote index to 32 in such cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 04:16:39 +00:00
Chris Lattner 837e897660 remove fixme!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:47:39 +00:00
Chris Lattner a27e5feaab improve compatibility with VC+, patch by John Thompson!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:33:43 +00:00
Ted Kremenek 899b3de7bc New static analyzer check by Nikita Zhuk!
"The attached patch generates warnings of cases where an ObjC message is sent to
a nil object and the size of return type of that message is larger than the size
of void pointer. This may result in undefined return values as described in PR
2718.  The patch also includes test cases."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:07:17 +00:00
Daniel Dunbar 9fd0b1f845 Set __PIC__ (more) correctly.
- Add -pic-level clang-cc option to specify the value for the define,
   updated driver to pass this.

 - Added __pic__

 - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:03:23 +00:00
Anders Carlsson a17d7ccc2e Don't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 02:55:55 +00:00
Mike Stump 437bb4b6ec Add basic support for arm static analysis checking. Radar 6699395
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 02:07:04 +00:00