]> granicus.if.org Git - clang/log
clang
15 years agoPut compiler headers in <prefix>/lib/clang/1.0/include (vs
Daniel Dunbar [Sat, 21 Feb 2009 20:52:41 +0000 (20:52 +0000)]
Put compiler headers in <prefix>/lib/clang/1.0/include (vs
<prefix>/Headers, gross).

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

15 years agoAdd support for GCC ObjC extension "Class<protocol>". Sigh.
Steve Naroff [Sat, 21 Feb 2009 20:17:11 +0000 (20:17 +0000)]
Add support for GCC ObjC extension "Class<protocol>". Sigh.

Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's.

Will never be seen in user code. Needed to pass dejagnu testsuite.

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

15 years agoThe blocks ABI is wrong, add a FIXME.
Mike Stump [Sat, 21 Feb 2009 20:07:44 +0000 (20:07 +0000)]
The blocks ABI is wrong, add a FIXME.

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

15 years agoAdd CodeGen support for the helper for BlockDeclRefExprs. The easier
Mike Stump [Sat, 21 Feb 2009 20:00:35 +0000 (20:00 +0000)]
Add CodeGen support for the helper for BlockDeclRefExprs.  The easier
stuff is mostly done.  Move BlockHasCopyDispose up.

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

15 years agoWarn about bogus protocol qualifiers.
Steve Naroff [Sat, 21 Feb 2009 19:50:43 +0000 (19:50 +0000)]
Warn about bogus protocol qualifiers.

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

15 years agoWarn on use of __weak attribute on local
Fariborz Jahanian [Sat, 21 Feb 2009 19:44:02 +0000 (19:44 +0000)]
Warn on use of __weak attribute on local
variable (objc2 gc specific).

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

15 years agoFix a bug whereby a pointer to a __weak was not recognized
Fariborz Jahanian [Sat, 21 Feb 2009 19:08:45 +0000 (19:08 +0000)]
Fix a bug whereby a pointer to a __weak was not recognized
as __weak (objc2 gc specific).

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

15 years agoUse llvm::StringsEqualNoCase instead of strncasecmp.
Ted Kremenek [Sat, 21 Feb 2009 18:26:02 +0000 (18:26 +0000)]
Use llvm::StringsEqualNoCase instead of strncasecmp.

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

15 years agoFixed an ICE in meta-data generation of __weak/__strong ivars.
Fariborz Jahanian [Sat, 21 Feb 2009 18:23:24 +0000 (18:23 +0000)]
Fixed an ICE in meta-data generation of __weak/__strong ivars.

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

15 years agoEvaluation of unary deref could call integer evaluator on non-integral
Daniel Dunbar [Sat, 21 Feb 2009 18:14:20 +0000 (18:14 +0000)]
Evaluation of unary deref could call integer evaluator on non-integral
expr; hilarity ensued.
 - PR3640.

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

15 years agoFix build on windows.
Cedric Venet [Sat, 21 Feb 2009 17:14:49 +0000 (17:14 +0000)]
Fix build on windows.

Should clang have a config.h or should we use the config.h of llvm or using the preprocessor is OK?  I did a quick fix here, but having a guideline on how to handle non portable function would be great (or ask ted to stop breaking the windows build :)).

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

15 years agoAdd test case to record a couple inconsistencies with GCC (found in <rdar://problem...
Steve Naroff [Sat, 21 Feb 2009 17:03:43 +0000 (17:03 +0000)]
Add test case to record a couple inconsistencies with GCC (found in <rdar://problem/6561076> [clang on Xcode] warning: cannot find protocol definition for 'OzzyP').

Removing the "cannot find protocol" warning is trivial if necessary (but I don't think it's the right thing to do).

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

15 years agoThis fixes <rdar://problem/6497650> More type mismatches issues with clang.
Steve Naroff [Sat, 21 Feb 2009 16:18:07 +0000 (16:18 +0000)]
This fixes <rdar://problem/6497650> More type mismatches issues with clang.

Move two key ObjC typechecks from Sema::CheckPointerTypesForAssignment() to ASTContext::mergeTypes().

This allows us to take advantage of the recursion in ASTContext::mergeTypes(), removing some bogus warnings.

This test case I've added includes an example where we still warn (and GCC doesn't). Need to talk with folks and decide what to do. At this point, the major bogosities should be fixed.

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

15 years agoUpdate checker build.
Ted Kremenek [Sat, 21 Feb 2009 06:58:08 +0000 (06:58 +0000)]
Update checker build.

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

15 years agoImproved naming convention heuristics in the retain/release checker to better
Ted Kremenek [Sat, 21 Feb 2009 05:13:43 +0000 (05:13 +0000)]
Improved naming convention heuristics in the retain/release checker to better
handle method names that contain 'new', 'copy', etc., but those words might be
the substring of larger words such as 'newsgroup' and 'photocopy' that do not
indicate the allocation of objects. This should address the issues discussed in
<rdar://problem/6552389>.

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

15 years agoUpdate scan-build help diagnostic.
Ted Kremenek [Sat, 21 Feb 2009 04:46:41 +0000 (04:46 +0000)]
Update scan-build help diagnostic.

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

15 years agoOnly create a preprocessed file for an ignored attribute if there currently does...
Ted Kremenek [Sat, 21 Feb 2009 04:46:20 +0000 (04:46 +0000)]
Only create a preprocessed file for an ignored attribute if there currently does not exist an 'attribute_ignored_XXX.txt' file for that attribute.

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

15 years agoSlight tweak to last commit: make sure to copy CVR qualifiers for fixed
Eli Friedman [Sat, 21 Feb 2009 00:58:02 +0000 (00:58 +0000)]
Slight tweak to last commit: make sure to copy CVR qualifiers for fixed
pointer types.

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

15 years agoRe-fix r65140 correctly.
Eli Friedman [Sat, 21 Feb 2009 00:44:51 +0000 (00:44 +0000)]
Re-fix r65140 correctly.

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

15 years agoHandle case of none gc'able objects regardless of their
Fariborz Jahanian [Sat, 21 Feb 2009 00:30:43 +0000 (00:30 +0000)]
Handle case of none gc'able objects regardless of their
type.

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

15 years agoEmit extern_weak when needed.
Daniel Dunbar [Sat, 21 Feb 2009 00:24:10 +0000 (00:24 +0000)]
Emit extern_weak when needed.
 - PR3629.

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

15 years agoWe must always mangle attribute overloadable functions; even if in a
Daniel Dunbar [Fri, 20 Feb 2009 23:09:27 +0000 (23:09 +0000)]
We must always mangle attribute overloadable functions; even if in a
system header.
 - Prevents a codegen crash when anything used anything in tgmath! :)

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

15 years agoFix <rdar://problem/6500554> missing objc error message.
Steve Naroff [Fri, 20 Feb 2009 22:59:16 +0000 (22:59 +0000)]
Fix <rdar://problem/6500554> missing objc error message.

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

15 years agoswitch the macroinfo argument lists from being allocated off the heap
Chris Lattner [Fri, 20 Feb 2009 22:46:43 +0000 (22:46 +0000)]
switch the macroinfo argument lists from being allocated off the heap
to being allocated from the same bumpptr that the MacroInfo objects
themselves are.

This speeds up -Eonly cocoa.h pth by ~4%, fsyntax-only is barely measurable.

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

15 years agodetemplatify setArgumentList and some other cleanups.
Chris Lattner [Fri, 20 Feb 2009 22:31:31 +0000 (22:31 +0000)]
detemplatify setArgumentList and some other cleanups.

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

15 years agorequire the MAcroInfo objects are explcitly destroyed.
Chris Lattner [Fri, 20 Feb 2009 22:19:20 +0000 (22:19 +0000)]
require the MAcroInfo objects are explcitly destroyed.

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

15 years agoMake 'RangeConstraintManager' the default ConstraintManager.
Ted Kremenek [Fri, 20 Feb 2009 21:49:22 +0000 (21:49 +0000)]
Make 'RangeConstraintManager' the default ConstraintManager.

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

15 years agoallocate and dellocate objc decl list through AST Context instead of
Chris Lattner [Fri, 20 Feb 2009 21:44:01 +0000 (21:44 +0000)]
allocate and dellocate objc decl list through AST Context instead of
with new/delete.  With disable-free, this reduces the number of 4/8 byte
mallocs from 4793/1541 to 865/456 and also drops other sizes as well.

This is a very small perf win, nothing major.

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

15 years agofix indentation
Chris Lattner [Fri, 20 Feb 2009 21:38:52 +0000 (21:38 +0000)]
fix indentation

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

15 years agosilence some warnings in no asserts mode.
Chris Lattner [Fri, 20 Feb 2009 21:37:53 +0000 (21:37 +0000)]
silence some warnings in no asserts mode.

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

15 years agoadd plumbing to get ASTContext& down to allocation/deallocation points in ObjCList,
Chris Lattner [Fri, 20 Feb 2009 21:35:13 +0000 (21:35 +0000)]
add plumbing to get ASTContext& down to allocation/deallocation points in ObjCList,
but don't start using it yet.  Renamed some methods to be more consistent.

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

15 years agonewly factored, we can now move the set and destroy methods out of line.
Chris Lattner [Fri, 20 Feb 2009 21:16:26 +0000 (21:16 +0000)]
newly factored, we can now move the set and destroy methods out of line.

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

15 years agofactor a bunch of common code out of the ObjCList template class
Chris Lattner [Fri, 20 Feb 2009 21:14:14 +0000 (21:14 +0000)]
factor a bunch of common code out of the ObjCList template class
into a new shared ObjCListBase class.

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

15 years agoGreatly simplify the logic in ExplodedGraphImpl::TrimGraph. Now we just do a
Ted Kremenek [Fri, 20 Feb 2009 21:10:26 +0000 (21:10 +0000)]
Greatly simplify the logic in ExplodedGraphImpl::TrimGraph. Now we just do a
vanilla reverse-BFS followed by a forward-DFS instead of resulting to strange
histrionics (whose purpose I can no longer remember) in the reverse-BFS stage.
This fixes an assertion failure in BugReporter due to edge cases where no root
was being hit in the reverse-BFS phase.

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

15 years agoprune #includes
Chris Lattner [Fri, 20 Feb 2009 21:06:29 +0000 (21:06 +0000)]
prune #includes

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

15 years agorename ObjCList::clear() -> ObjCList::Destroy(). Require that destroy is called
Chris Lattner [Fri, 20 Feb 2009 21:02:11 +0000 (21:02 +0000)]
rename ObjCList::clear() -> ObjCList::Destroy().  Require that destroy is called
before the dtor.

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

15 years agorearrange the contents of DeclObjC to be by-class. Fix some 80 column issues
Chris Lattner [Fri, 20 Feb 2009 20:59:54 +0000 (20:59 +0000)]
rearrange the contents of DeclObjC to be by-class.  Fix some 80 column issues
and other non-semantic changes.

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

15 years agoUnbreak Darwin PIC handling; my refactoring yesterday was bogus.
Daniel Dunbar [Fri, 20 Feb 2009 20:52:47 +0000 (20:52 +0000)]
Unbreak Darwin PIC handling; my refactoring yesterday was bogus.

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

15 years agomore random cleanups, add some fixme's. ObjCCategoryImplDecl really
Chris Lattner [Fri, 20 Feb 2009 20:48:45 +0000 (20:48 +0000)]
more random cleanups, add some fixme's.  ObjCCategoryImplDecl really
shouldn't be a NamedDecl.

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

15 years agodestroy should forward to base class.
Chris Lattner [Fri, 20 Feb 2009 20:42:28 +0000 (20:42 +0000)]
destroy should forward to base class.

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

15 years agomove the @implementation ivar list to being an ObjCList, which prevents
Chris Lattner [Fri, 20 Feb 2009 20:41:34 +0000 (20:41 +0000)]
move the @implementation ivar list to being an ObjCList, which prevents
it from being leaked, among other things.

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

15 years agoPTH generation: Clear the cleaning bit for literals (whose spellings are cached).
Ted Kremenek [Fri, 20 Feb 2009 20:32:39 +0000 (20:32 +0000)]
PTH generation: Clear the cleaning bit for literals (whose spellings are cached).

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

15 years agoAdd some IRgen improvement notes.
Daniel Dunbar [Fri, 20 Feb 2009 19:34:45 +0000 (19:34 +0000)]
Add some IRgen improvement notes.

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

15 years agoShorten; no functionality change.
Daniel Dunbar [Fri, 20 Feb 2009 19:34:33 +0000 (19:34 +0000)]
Shorten; no functionality change.

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

15 years agoremove dead list.
Chris Lattner [Fri, 20 Feb 2009 18:57:29 +0000 (18:57 +0000)]
remove dead list.

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

15 years agoTake advantage of noreturn attribute to add unreachable instruction &
Daniel Dunbar [Fri, 20 Feb 2009 18:54:31 +0000 (18:54 +0000)]
Take advantage of noreturn attribute to add unreachable instruction &
clear insertion point. The rest of IRgen should theoretically take
advantage of this to avoid emitting dead code. Theory != Practice.

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

15 years agoAlways try to fold array sizes, and warn if we could fold something that isn't an...
Anders Carlsson [Fri, 20 Feb 2009 18:53:20 +0000 (18:53 +0000)]
Always try to fold array sizes, and warn if we could fold something that isn't an ICE. This makes us compatible with GCC.

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

15 years agoFix test case.
Daniel Dunbar [Fri, 20 Feb 2009 18:53:07 +0000 (18:53 +0000)]
Fix test case.

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

15 years agoremove some more methods from objc decls, using the iterator
Chris Lattner [Fri, 20 Feb 2009 18:43:26 +0000 (18:43 +0000)]
remove some more methods from objc decls, using the iterator
interfaces more consistently.

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

15 years agoHandle constant int -> ptr casts of lvalue results.
Daniel Dunbar [Fri, 20 Feb 2009 18:22:23 +0000 (18:22 +0000)]
Handle constant int -> ptr casts of lvalue results.
 - PR3463 (again).

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

15 years agoremove some slow O(n) methods.
Chris Lattner [Fri, 20 Feb 2009 18:18:36 +0000 (18:18 +0000)]
remove some slow O(n) methods.

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

15 years agoChange ObjCForwardProtocolDecl to use an ObjCList.
Chris Lattner [Fri, 20 Feb 2009 18:10:37 +0000 (18:10 +0000)]
Change ObjCForwardProtocolDecl to use an ObjCList.

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

15 years agoSet call attribute for direct calls (i.e. noreturn).
Daniel Dunbar [Fri, 20 Feb 2009 18:06:48 +0000 (18:06 +0000)]
Set call attribute for direct calls (i.e. noreturn).
 - Remove an unused variant of EmitCallExpr overload.

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

15 years agomove the interace list of @class to use ObjCList.
Chris Lattner [Fri, 20 Feb 2009 18:04:31 +0000 (18:04 +0000)]
move the interace list of @class to use ObjCList.

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

15 years agoFix <rdar://problem/6586239> bitfield constraints not enforced (for ObjC)
Steve Naroff [Fri, 20 Feb 2009 17:57:11 +0000 (17:57 +0000)]
Fix <rdar://problem/6586239> bitfield constraints not enforced (for ObjC)

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

15 years agoremove a dead list.
Chris Lattner [Fri, 20 Feb 2009 17:53:35 +0000 (17:53 +0000)]
remove a dead list.

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

15 years agoadd support for amd64-*, patch by Brooks Davis!
Chris Lattner [Fri, 20 Feb 2009 17:04:14 +0000 (17:04 +0000)]
add support for amd64-*, patch by Brooks Davis!

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

15 years agoccc: Spell mattr correctly.
Daniel Dunbar [Fri, 20 Feb 2009 07:47:48 +0000 (07:47 +0000)]
ccc: Spell mattr correctly.

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

15 years agoccc: Basic translation of gcc subtarget feature options to LLVM
Daniel Dunbar [Fri, 20 Feb 2009 07:35:04 +0000 (07:35 +0000)]
ccc: Basic translation of gcc subtarget feature options to LLVM
options (i.e., -mno-red-zone, -msoft-float, -mno-sse, etc.)
 - Also, make sure unwind tables default to on Darwin/x86_64.
 - PR3604.

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

15 years agoccc: Use toolchain hook for default relocation model value.
Daniel Dunbar [Fri, 20 Feb 2009 06:48:26 +0000 (06:48 +0000)]
ccc: Use toolchain hook for default relocation model value.

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

15 years agoAdd some stdlib builtins
Daniel Dunbar [Fri, 20 Feb 2009 06:36:40 +0000 (06:36 +0000)]
Add some stdlib builtins

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

15 years agoswitch ObjCMethodDecl's parameter list from being explicitly managed to an ObjCList.
Chris Lattner [Fri, 20 Feb 2009 06:23:21 +0000 (06:23 +0000)]
switch ObjCMethodDecl's parameter list from being explicitly managed to an ObjCList.

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

15 years agoswitch the interface ivar list from being explicitly managed to using ObjCList.
Chris Lattner [Fri, 20 Feb 2009 06:10:45 +0000 (06:10 +0000)]
switch the interface ivar list from being explicitly managed to using ObjCList.

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

15 years agomove more objc destruction out of dtors into Destroy.
Chris Lattner [Fri, 20 Feb 2009 06:03:09 +0000 (06:03 +0000)]
move more objc destruction out of dtors into Destroy.

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

15 years agomove some objc decl destruction out of dtors into Destroy method.
Chris Lattner [Fri, 20 Feb 2009 05:54:35 +0000 (05:54 +0000)]
move some objc decl destruction out of dtors into Destroy method.

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

15 years agoAdd an example in comments.
Zhongxing Xu [Fri, 20 Feb 2009 05:19:30 +0000 (05:19 +0000)]
Add an example in comments.

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

15 years agoFix potential use of uninitialized variable.
Ted Kremenek [Fri, 20 Feb 2009 04:34:29 +0000 (04:34 +0000)]
Fix potential use of uninitialized variable.

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

15 years agoA few small tweaks to isConstantInitializer. (No test because this
Eli Friedman [Fri, 20 Feb 2009 02:36:22 +0000 (02:36 +0000)]
A few small tweaks to isConstantInitializer. (No test because this
isn't getting used by Sema or CodeGen at the moment...)

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

15 years agoUse -verify for consistency.
Eli Friedman [Fri, 20 Feb 2009 02:03:47 +0000 (02:03 +0000)]
Use -verify for consistency.

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

15 years agoAdd support for * (unary dereference) operator to ExprConstant.
Eli Friedman [Fri, 20 Feb 2009 01:57:15 +0000 (01:57 +0000)]
Add support for * (unary dereference) operator to ExprConstant.

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

15 years agoccc: Use toolChain arch name instead of looking for arch command line
Daniel Dunbar [Fri, 20 Feb 2009 01:48:01 +0000 (01:48 +0000)]
ccc: Use toolChain arch name instead of looking for arch command line
argument; the toolchain should always know the arch.
 - Fixes: <rdar://problem/6582911> -ccc-clang-archs doesn't work for excluding ppc

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

15 years agooptimize the 'StoredDeclsMap' for the common case where there is
Chris Lattner [Fri, 20 Feb 2009 01:44:05 +0000 (01:44 +0000)]
optimize the 'StoredDeclsMap' for the common case where there is
exactly one decl with a specific name in a specific context.  This
avoids a bunch of malloc traffic and shrinks StoredDeclsMap to hold
one pointer instead of 3 words (for a std::vector).

This speeds up -fsyntax-only on cocoa.h with PTH by ~7.3%.

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

15 years agoccc: Store arch name in all toolchains.
Daniel Dunbar [Fri, 20 Feb 2009 01:36:35 +0000 (01:36 +0000)]
ccc: Store arch name in all toolchains.
 - No functionality change.

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

15 years agoSuppress constant initializer checking when the declaration isn't valid.
Eli Friedman [Fri, 20 Feb 2009 01:34:21 +0000 (01:34 +0000)]
Suppress constant initializer checking when the declaration isn't valid.
This prevents emitting diagnostics which are almost certainly useless.

(Note that the test is checking that we emit only one diagnostic.)

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

15 years agoccc: Give all tools access to the toolchain they are in.
Daniel Dunbar [Fri, 20 Feb 2009 01:30:38 +0000 (01:30 +0000)]
ccc: Give all tools access to the toolchain they are in.
 - No functionality change.

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

15 years agoInitialize the Init variable to something reasonable when we emit an
Eli Friedman [Fri, 20 Feb 2009 01:18:21 +0000 (01:18 +0000)]
Initialize the Init variable to something reasonable when we emit an
error, so we don't crash.

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

15 years agoExprConstant handling for a couple more cases of pointer-to-int casts
Eli Friedman [Fri, 20 Feb 2009 01:15:07 +0000 (01:15 +0000)]
ExprConstant handling for a couple more cases of pointer-to-int casts
from the testsuite.

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

15 years agoMore objc gc's ir-gen fixes.
Fariborz Jahanian [Fri, 20 Feb 2009 01:14:43 +0000 (01:14 +0000)]
More objc gc's ir-gen fixes.

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

15 years agomake the redeclaration case faster for the common instance of a redeclaration
Chris Lattner [Fri, 20 Feb 2009 01:10:07 +0000 (01:10 +0000)]
make the redeclaration case faster for the common instance of a redeclaration
where there is exactly one existing declaration.  This is common.

this speeds up clang about 3% on cocoa.h for me 0.165 -> 0.160s

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

15 years ago80 cols
Chris Lattner [Fri, 20 Feb 2009 00:56:18 +0000 (00:56 +0000)]
80 cols

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

15 years agoslight code simplifications.
Chris Lattner [Fri, 20 Feb 2009 00:55:03 +0000 (00:55 +0000)]
slight code simplifications.

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

15 years agoDeox and Capitolize.
Mike Stump [Fri, 20 Feb 2009 00:45:51 +0000 (00:45 +0000)]
Deox and Capitolize.

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

15 years agomap source ranges through macro expansions. Before:
Chris Lattner [Fri, 20 Feb 2009 00:25:28 +0000 (00:25 +0000)]
map source ranges through macro expansions.  Before:

t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

(no ranges on the second diagnostics)

After:

t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                         ~~~ ^ ~~~

(ranges!)

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

15 years agoFix spacing.
Mike Stump [Fri, 20 Feb 2009 00:19:45 +0000 (00:19 +0000)]
Fix spacing.

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

15 years agorefactor, pass ranges down instead of the whole
Chris Lattner [Fri, 20 Feb 2009 00:18:51 +0000 (00:18 +0000)]
refactor, pass ranges down instead of the whole
DiagnosticInfo.

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

15 years agoAdd test case for <rdar://problem/6562655>.
Ted Kremenek [Fri, 20 Feb 2009 00:10:09 +0000 (00:10 +0000)]
Add test case for <rdar://problem/6562655>.

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

15 years agoFix crash from <rdar://problem/6562655>: 'init' method only return a receiver alias...
Ted Kremenek [Fri, 20 Feb 2009 00:05:35 +0000 (00:05 +0000)]
Fix crash from <rdar://problem/6562655>: 'init' method only return a receiver alias if the return type is a location.

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

15 years agoreplace a dirty hack with a clean solution. Too bad we can't
Chris Lattner [Thu, 19 Feb 2009 23:53:20 +0000 (23:53 +0000)]
replace a dirty hack with a clean solution.  Too bad we can't
use Blocks for our callbacks ;-)

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

15 years agoretain/release checker: Generate an intermediate simulation node for "leak"
Ted Kremenek [Thu, 19 Feb 2009 23:47:02 +0000 (23:47 +0000)]
retain/release checker: Generate an intermediate simulation node for "leak"
transitions and then generate a subsequent node that removes the dead symbol
bindings. This should drastically improve caching in the simulation graph when
retain-counted objects are being tracked.

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

15 years agoFix a long standard problem with clang retaining "too much" sugar
Chris Lattner [Thu, 19 Feb 2009 23:45:49 +0000 (23:45 +0000)]
Fix a long standard problem with clang retaining "too much" sugar
information about types.  We often print diagnostics where we say
"foo_t" is bad, but the user doesn't know how foo_t is declared
(because it is a typedef).  Fix this by expanding sugar when present
in a diagnostic (and not one of a few special cases, like vectors).

Before:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

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

15 years agoAdded a new method to GRStmtNodeBuilder to build nodes using an arbitrary
Ted Kremenek [Thu, 19 Feb 2009 23:45:28 +0000 (23:45 +0000)]
Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.

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

15 years agoProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data...
Ted Kremenek [Thu, 19 Feb 2009 23:43:16 +0000 (23:43 +0000)]
ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data) so that clients don't need a unique address for the pair itself.

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

15 years agopretty printing vector types should print the element type, not just the attribute.
Chris Lattner [Thu, 19 Feb 2009 23:42:29 +0000 (23:42 +0000)]
pretty printing vector types should print the element type, not just the attribute.

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

15 years agoMore objc's gc ir-gen stuff.
Fariborz Jahanian [Thu, 19 Feb 2009 23:36:06 +0000 (23:36 +0000)]
More objc's gc ir-gen stuff.

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

15 years agoGetTypeForDeclarator can return null on error now, handle this.
Chris Lattner [Thu, 19 Feb 2009 23:13:55 +0000 (23:13 +0000)]
GetTypeForDeclarator can return null on error now, handle this.

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

15 years agoccc: Give nicer error when spawning a subprocess fails.
Daniel Dunbar [Thu, 19 Feb 2009 22:59:57 +0000 (22:59 +0000)]
ccc: Give nicer error when spawning a subprocess fails.

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

15 years agoExtend Evaluate() to fold (int) <pointer type>.
Daniel Dunbar [Thu, 19 Feb 2009 22:24:01 +0000 (22:24 +0000)]
Extend Evaluate() to fold (int) <pointer type>.
 - PR3463, PR3398, <rdar://problem/6553401> crash on relocatable
   symbol addresses as constants in static locals.

 - There are many more scenarious we could handle (like arithmetic on
   such an int) but this is the main use case.

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

15 years agoSimplify, no functionality change.
Daniel Dunbar [Thu, 19 Feb 2009 22:16:29 +0000 (22:16 +0000)]
Simplify, no functionality change.

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

15 years agoFix another PTH warning that should not be a note.
Ted Kremenek [Thu, 19 Feb 2009 22:14:49 +0000 (22:14 +0000)]
Fix another PTH warning that should not be a note.

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

15 years agoMake PTH warnings actual warnings instead of 'notes'.
Ted Kremenek [Thu, 19 Feb 2009 22:13:40 +0000 (22:13 +0000)]
Make PTH warnings actual warnings instead of 'notes'.

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