]> granicus.if.org Git - clang/log
clang
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

15 years agoFixup codegen for nested blocks that use copy/dispose in the inner
Mike Stump [Fri, 10 Apr 2009 18:52:28 +0000 (18:52 +0000)]
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

15 years agoPatch to generate meta-data for prtocol used
Fariborz Jahanian [Fri, 10 Apr 2009 18:47:34 +0000 (18:47 +0000)]
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

15 years agoDriver: CCC_ADD_ARGS could end up using dangling pointers.
Daniel Dunbar [Fri, 10 Apr 2009 18:32:59 +0000 (18:32 +0000)]
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

15 years agoUse getDeclName() instead of getIdentifier() (safe against null pointers)
Ted Kremenek [Fri, 10 Apr 2009 18:25:37 +0000 (18:25 +0000)]
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

15 years agoadd a new PP_MACRO_NAME hack so that I can test object-like macros.
Chris Lattner [Fri, 10 Apr 2009 18:22:18 +0000 (18:22 +0000)]
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

15 years agoMove a few more NonLoc static functions to ValueManager.
Ted Kremenek [Fri, 10 Apr 2009 18:11:44 +0000 (18:11 +0000)]
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

15 years agoDefault initialize 'code' instance variable to NULL.
Ted Kremenek [Fri, 10 Apr 2009 18:11:14 +0000 (18:11 +0000)]
Default initialize 'code' instance variable to NULL.

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

15 years agoemit tokens, constify the Preprocessor passed down into PCH writer.
Chris Lattner [Fri, 10 Apr 2009 18:08:30 +0000 (18:08 +0000)]
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

15 years agoemit function-like and object-like macros to the PCH file.
Chris Lattner [Fri, 10 Apr 2009 18:00:12 +0000 (18:00 +0000)]
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

15 years agoAdd PCH sources to CMake build files
Douglas Gregor [Fri, 10 Apr 2009 17:28:42 +0000 (17:28 +0000)]
Add PCH sources to CMake build files

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

15 years agoVarious minor fixes to PCH reading and writing, with general
Douglas Gregor [Fri, 10 Apr 2009 17:25:41 +0000 (17:25 +0000)]
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

15 years agoimprove punctuation
Chris Lattner [Fri, 10 Apr 2009 17:16:57 +0000 (17:16 +0000)]
improve punctuation

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

15 years agoArrange for the preprocessor to be passed down into the PCH writer.
Chris Lattner [Fri, 10 Apr 2009 17:15:23 +0000 (17:15 +0000)]
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

15 years agoadd PCH stuff to project
Chris Lattner [Fri, 10 Apr 2009 17:09:28 +0000 (17:09 +0000)]
add PCH stuff to project

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

15 years agouse doug's new %S thing to make this work when run from different locations.
Chris Lattner [Fri, 10 Apr 2009 16:51:32 +0000 (16:51 +0000)]
use doug's new %S thing to make this work when run from different locations.

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

15 years agoFix typo.
Ted Kremenek [Fri, 10 Apr 2009 14:30:24 +0000 (14:30 +0000)]
Fix typo.

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

15 years agoUpdate analyzer build.
Ted Kremenek [Fri, 10 Apr 2009 14:29:25 +0000 (14:29 +0000)]
Update analyzer build.

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

15 years agoAdd prototype for CodeTextRegion.
Zhongxing Xu [Fri, 10 Apr 2009 08:45:10 +0000 (08:45 +0000)]
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

15 years agoupdate analyzer doc.
Zhongxing Xu [Fri, 10 Apr 2009 06:52:49 +0000 (06:52 +0000)]
update analyzer doc.

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

15 years agoFinally nuke loc::SymbolVal.
Zhongxing Xu [Fri, 10 Apr 2009 06:06:13 +0000 (06:06 +0000)]
Finally nuke loc::SymbolVal.

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

15 years agotypos
Chris Lattner [Fri, 10 Apr 2009 05:54:56 +0000 (05:54 +0000)]
typos

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

15 years agoUse correct alignment and size for references in records as well.
Anders Carlsson [Fri, 10 Apr 2009 05:31:15 +0000 (05:31 +0000)]
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

15 years agoWording changes.
Ted Kremenek [Fri, 10 Apr 2009 05:04:22 +0000 (05:04 +0000)]
Wording changes.

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

15 years agoAdd blurb about attribute "analyzer_noreturn"
Ted Kremenek [Fri, 10 Apr 2009 05:03:33 +0000 (05:03 +0000)]
Add blurb about attribute "analyzer_noreturn"

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

15 years agoRename variables to avoid conflict.
Anders Carlsson [Fri, 10 Apr 2009 04:59:59 +0000 (04:59 +0000)]
Rename variables to avoid conflict.

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

15 years agoAdd Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr...
Anders Carlsson [Fri, 10 Apr 2009 04:54:13 +0000 (04:54 +0000)]
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

15 years agoFix thinko noticed by Chris.
Anders Carlsson [Fri, 10 Apr 2009 04:52:36 +0000 (04:52 +0000)]
Fix thinko noticed by Chris.

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

15 years agoUse the same alignment for reference declarations as for pointer declarations.
Anders Carlsson [Fri, 10 Apr 2009 04:47:03 +0000 (04:47 +0000)]
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

15 years agofix indentation
Chris Lattner [Fri, 10 Apr 2009 04:42:25 +0000 (04:42 +0000)]
fix indentation

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

15 years agoSplit failing test case from misc-ps.m to misc-ps-ranges.m (which tests
Ted Kremenek [Fri, 10 Apr 2009 04:02:38 +0000 (04:02 +0000)]
Split failing test case from misc-ps.m to misc-ps-ranges.m (which tests
functionality specific to RangeConstraintManager).

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

15 years agoPCH serialization/deserialization of the source manager. With this
Douglas Gregor [Fri, 10 Apr 2009 03:52:48 +0000 (03:52 +0000)]
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

15 years agoFix: <rdar://problem/6776949> Branch condition evaluates to an uninitialized value...
Ted Kremenek [Fri, 10 Apr 2009 00:59:50 +0000 (00:59 +0000)]
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

15 years agoMake messages consistent.
Chris Lattner [Fri, 10 Apr 2009 00:37:08 +0000 (00:37 +0000)]
Make messages consistent.

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

15 years agoreject codegen of __thread variables as unimplemented, rdar://6775265
Chris Lattner [Fri, 10 Apr 2009 00:35:59 +0000 (00:35 +0000)]
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

15 years agoImplement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
Ted Kremenek [Fri, 10 Apr 2009 00:01:14 +0000 (00:01 +0000)]
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

15 years agoImplementation of pre-compiled headers (PCH) based on lazy
Douglas Gregor [Thu, 9 Apr 2009 22:27:44 +0000 (22:27 +0000)]
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

15 years ago- Move ownership of MemRegionManager into ValueManager.
Ted Kremenek [Thu, 9 Apr 2009 22:22:44 +0000 (22:22 +0000)]
- 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

15 years agoAdd @encode support for complex types.
Anders Carlsson [Thu, 9 Apr 2009 21:55:45 +0000 (21:55 +0000)]
Add @encode support for complex types.

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

15 years agoPropagate the ASTContext to various AST traversal and lookup functions.
Douglas Gregor [Thu, 9 Apr 2009 21:40:53 +0000 (21:40 +0000)]
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

15 years agoAdd some FIXMEs for missing checks.
Eli Friedman [Thu, 9 Apr 2009 21:26:42 +0000 (21:26 +0000)]
Add some FIXMEs for missing checks.

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

15 years agodocument the x86 address space extension for GS.
Chris Lattner [Thu, 9 Apr 2009 19:58:15 +0000 (19:58 +0000)]
document the x86 address space extension for GS.

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