Eli Friedman
c96d4963eb
Implement __is_empty. Patch by Sean Hunt.
...
llvm-svn: 79143
2009-08-15 21:55:26 +00:00
Eli Friedman
da8d4def72
Don't perform integer promotions on the operand to a cast; this
...
simplifies the AST, and can matter in some rare cases involving
casts to vector types. Patch by Enea Zaffanella.
llvm-svn: 79126
2009-08-15 19:02:19 +00:00
Fariborz Jahanian
0aed0225b4
Improved on ir-gen for synthesis of non-trivial default
...
constructor body whose class has non-static data-members which
required non-trivial construction.
llvm-svn: 79125
2009-08-15 18:55:17 +00:00
Eli Friedman
2be79b3608
Add an additional C++ hardcoded search path.
...
llvm-svn: 79075
2009-08-15 03:45:14 +00:00
Zhongxing Xu
e1190f73a9
Extend the ProgramPoint to include the context information LocationContext,
...
which is either a stack frame context of the function or a local scope
context.
llvm-svn: 79072
2009-08-15 03:17:38 +00:00
Eli Friedman
04fddf0d1f
Fix for PR4721: adjust CodeGen and ASTContext so that we have a
...
consistent model for handling size expressions for VLAs.
The model is essentially as follows: VLA types own their associated
expression. In some cases, we need to create multiple VLA types to
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging). If we need to create multiple types based off of
the same VLA declaration, we use the new refcounting functionality so they can
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.
I'm not particularly attached to the VLA types owning the expression,
but we're stuck with at least until someone comes up with a way
to walk the VLA expressions for a declaration.
I did the parallel fix in ASTContext for DependentSizedArrayType, but I
haven't really looked closely at it, so there might still be issues
there.
I'll clean up the code duplication in ASTContext in a followup commit.
llvm-svn: 79071
2009-08-15 02:50:32 +00:00
John McCall
deb8448690
Disable all recognition of main() in -ffreestanding. Addresses bug #4720 .
...
llvm-svn: 79070
2009-08-15 02:09:25 +00:00
Ted Kremenek
08479ae7fe
Change handling of attribute 'malloc' to only accept the attribute on function
...
declarations (and not function pointers). This is consistent with GCC. Accepting
this attribute on function pointers means that the attribute should be treated
as a type qualifier, which apparently is not what GCC does. We obviously can
change this later should we desire to enhance the 'malloc' attribute in this
way.
llvm-svn: 79060
2009-08-15 00:51:46 +00:00
Chris Lattner
8dc7626f9c
minor cleanups for VLA stuff.
...
llvm-svn: 79059
2009-08-15 00:03:43 +00:00
Chris Lattner
19efdd67dd
use GetVLASize instead of accessing VLASizeMap directly, this gets an assert if
...
VLASize isn't populated for the type yet.
llvm-svn: 79057
2009-08-14 23:43:22 +00:00
Ted Kremenek
f22c410efa
Per Eli Friedman's feedback, handle attribute 'malloc' being applied to
...
declarations of function pointers.
llvm-svn: 79053
2009-08-14 22:03:27 +00:00
Fariborz Jahanian
2e4a46b745
objc2's foreach statement's selector type can be
...
a block pointer too.
llvm-svn: 79050
2009-08-14 21:53:27 +00:00
Devang Patel
d4bbb08946
Do now overflow while calulating upper bound for zero sized array.
...
llvm-svn: 79043
2009-08-14 20:57:45 +00:00
Ted Kremenek
420d9a7a5e
Use 'dyn_cast' instead of a check for a function declaration followed by a
...
'cast'.
llvm-svn: 79041
2009-08-14 20:51:58 +00:00
Ted Kremenek
527042b5a9
Improve Sema's handling of attribute 'malloc' to reject the attribute when
...
attaching to Objective-C methods (which mirrors GCC's behavior) and to allow the
return type of the function to be an Objective-C pointer or Block pointer (which
GCC also accepts).
Along the way, add 'const' to some of the pointer arguments of various utility
functions...
llvm-svn: 79040
2009-08-14 20:49:40 +00:00
Fariborz Jahanian
42af5ba7b7
ir-gen for generation of trvial copy constructor
...
call.
llvm-svn: 79034
2009-08-14 20:11:43 +00:00
Anders Carlsson
e827123f08
Make the CXXDefaultArgExpr constructor protected and add a static Create function.
...
llvm-svn: 79013
2009-08-14 18:30:22 +00:00
Fariborz Jahanian
83b000c713
Fixed a regression in deciding when to issue warning on properties which
...
implement NSCopying protocol in GC mode.
llvm-svn: 79008
2009-08-14 18:06:25 +00:00
Shantonu Sen
4a7b937c4b
PR4715
...
-Wno-error disables WarningsAsErrors instead of
mistakenly being treated like -Werror
llvm-svn: 78987
2009-08-14 04:07:15 +00:00
Anders Carlsson
5d67a97513
Fix spacing
...
llvm-svn: 78981
2009-08-14 02:39:47 +00:00
John McCall
58de35804b
Support friend declarations in templates and test that argdep lookup
...
still works.
llvm-svn: 78979
2009-08-14 02:03:10 +00:00
Mike Stump
bcf756cbac
Deconflate virtual base offsets from non-virtual base offsets.
...
Deconflate a virtual base primary from a non-virtual base.
llvm-svn: 78971
2009-08-14 01:44:03 +00:00
Fariborz Jahanian
92b3f47de2
Fixed a bug in ir-gen for copy assignment synthesis.
...
Fixed a bug when evaluating those copy-assignments
which need by lazily syntheized. A test case
for these.
llvm-svn: 78965
2009-08-14 00:01:54 +00:00
Owen Anderson
c36edfede5
Update for LLVM API change.
...
llvm-svn: 78957
2009-08-13 23:27:53 +00:00
Mike Stump
590a7c780c
We can't avoid doing the work to find all the indirect primary virtual
...
base classes as we'll need that to layout the virtual bases...
llvm-svn: 78954
2009-08-13 23:26:06 +00:00
Mike Stump
c2f591b1e6
Refine vtable layout for virtual bases and keep better track of
...
primaries. WIP.
llvm-svn: 78950
2009-08-13 22:53:07 +00:00
Owen Anderson
41a750271b
Update for LLVM API change.
...
llvm-svn: 78946
2009-08-13 21:57:51 +00:00
Fariborz Jahanian
4985b33fd7
Patch to force synthesis of copy assignment operator
...
function in the order according to c++03. ir-gen
for copy assignment in the trivial case and the first
test case.
llvm-svn: 78938
2009-08-13 21:09:41 +00:00
Mike Stump
2631d8c517
Minor cleanups.
...
llvm-svn: 78927
2009-08-13 18:39:54 +00:00
Mike Stump
1300754fdd
Prep for vbase layout refinements. WIP.
...
llvm-svn: 78882
2009-08-13 02:02:14 +00:00
Ryan Flynn
90964523f6
change cast to dyn_cast because d may not be a FunctionDecl
...
llvm-svn: 78876
2009-08-13 01:19:23 +00:00
Fariborz Jahanian
9b630c3040
Minor refactoring of copy assign operator ir-gen. SWIP.
...
llvm-svn: 78875
2009-08-13 00:53:36 +00:00
Mike Stump
6bb66bbd06
Refine virtual base layout. WIP.
...
llvm-svn: 78873
2009-08-13 00:34:14 +00:00
Ryan Flynn
a8fae2ebf4
change a dyn_cast to cast
...
llvm-svn: 78862
2009-08-12 23:36:28 +00:00
Fariborz Jahanian
bbd5e8c2cf
More toward synthesizing copy assignments. SWIP.
...
llvm-svn: 78861
2009-08-12 23:34:46 +00:00
Mike Stump
b661738203
Cleanup.
...
llvm-svn: 78858
2009-08-12 23:25:18 +00:00
Mike Stump
938f15b033
Refactor. WIP. Eventually, this will all go into a vtable builder class.
...
llvm-svn: 78857
2009-08-12 23:14:12 +00:00
Mike Stump
480212253a
Cleanup.
...
llvm-svn: 78855
2009-08-12 23:03:28 +00:00
Mike Stump
82165efbc4
Refactor.
...
llvm-svn: 78854
2009-08-12 23:00:59 +00:00
Mike Stump
dc94d3fd27
Refactor.
...
llvm-svn: 78851
2009-08-12 22:34:12 +00:00
Mike Stump
cb2752bb5d
Remove another done audit FIXME.
...
llvm-svn: 78847
2009-08-12 22:10:00 +00:00
Mike Stump
aa08da7906
Refactor a bit and remove some FIXME audit markers, now that the code
...
has been audited for correctness.
llvm-svn: 78846
2009-08-12 22:06:55 +00:00
Mike Stump
6f3793b406
Refine primary vbase selection ordering. WIP.
...
llvm-svn: 78844
2009-08-12 21:50:08 +00:00
Fariborz Jahanian
de7d4c264a
Patch for synthesizing copy assignment operator.
...
WIP.
llvm-svn: 78841
2009-08-12 21:14:35 +00:00
Mike Stump
9deb22b850
Improve the secondary vtables to not include vbase offsets. WIP.
...
llvm-svn: 78831
2009-08-12 18:50:26 +00:00
Fariborz Jahanian
887cd6a8eb
error on property of objc interface type instead of crashing
...
llvm-svn: 78826
2009-08-12 18:17:53 +00:00
Chris Lattner
91f5ff6bce
improve path handling, patch by Baptiste Lepilleur!
...
llvm-svn: 78824
2009-08-12 17:50:39 +00:00
Mike Stump
cecfe61cd1
Refine vtable building for the secondary vtables to exclude yet more
...
cases where a virtual base was already used as a primary base class.
WIP.
llvm-svn: 78820
2009-08-12 17:42:21 +00:00
Chris Lattner
859c37a5d9
use the new llvm::Triple parsing stuffola for handling darwin version #'s.
...
llvm-svn: 78794
2009-08-12 06:24:27 +00:00
Nate Begeman
4874592208
Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation
...
llvm-svn: 78783
2009-08-12 02:28:50 +00:00