Commit Graph

21789 Commits

Author SHA1 Message Date
Mon P Wang cc2ab0cdc9 Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.
llvm-svn: 100305
2010-04-04 03:10:52 +00:00
Rafael Espindola 8e7ca8e0b1 Don't produce a vtable for a class if we have an explicit template instantiation declaration and no key function. We will produce the vtable at the explicit template instantiation.
Fixes PR6748

llvm-svn: 100266
2010-04-03 04:26:42 +00:00
Eric Christopher e1ddaf911b Add option and macro definition for AES instructions. Now produces real
assembly for testcases.

llvm-svn: 100253
2010-04-02 23:50:19 +00:00
Fariborz Jahanian d077f719be Improve diagnosing when a method type does not start with '-'|'+'
when parsing. Fixes radar 7822196.

llvm-svn: 100248
2010-04-02 23:15:40 +00:00
Daniel Dunbar 7e5aba433d IRgen/NeXT: Remove my refactoring-enabling asserts, and add a FIXME.
llvm-svn: 100237
2010-04-02 22:29:40 +00:00
Daniel Dunbar 8f0be43669 Avoid unneeded calls to opt/llvm-dis.
llvm-svn: 100236
2010-04-02 22:29:38 +00:00
Daniel Dunbar 87c1991bb4 Merge several tests into switch.c.
llvm-svn: 100235
2010-04-02 22:29:35 +00:00
Daniel Dunbar 8c7f981833 IRgen/Obj-C: Eliminate FindIvarInterface, now that ivar's are in the right DeclContexts (-2 FIXMEs). We still have an annoying linear scan + hidden dependency on how Obj-C layout is done.
- This is also an algorithmic improvement in IRgen for Obj-C, although it probably doesn't matter in practice.

llvm-svn: 100228
2010-04-02 21:14:02 +00:00
Daniel Dunbar 89947ea894 AST: Add ObjCIvarDecl::getContainingInterface().
llvm-svn: 100227
2010-04-02 21:13:59 +00:00
Fariborz Jahanian e16cdb407a diagnose declaring class extension after its implementation
(radar 7822210).

llvm-svn: 100226
2010-04-02 20:53:05 +00:00
Chris Lattner 18a584b56c NewDebugLoc got renamed to DebugLoc.
llvm-svn: 100219
2010-04-02 20:21:43 +00:00
Daniel Dunbar fe3ead7c48 Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants on the provided DeclContext.
- Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is.

llvm-svn: 100213
2010-04-02 20:10:03 +00:00
Fariborz Jahanian a9f8675e02 Diagnose invalid code with -fobjc-nonfragile-abi2 when
property is being accessed without the dot-syntax notation.
(radar 7822344).

llvm-svn: 100212
2010-04-02 20:09:24 +00:00
Daniel Dunbar ab5d7aef72 Sema/Obj-C: Narrow type, and simplify.
llvm-svn: 100210
2010-04-02 19:44:54 +00:00
Douglas Gregor ce6c2748f7 We seem to get an inconsistent alignment value in the generated
assembly for the global "d7". We were previously testing for alignment
3, which seems to happen for some builders and not for others. I've
eliminated the alignment check and added a FIXME to unbreak the
buildbots.

llvm-svn: 100205
2010-04-02 19:02:06 +00:00
Mon P Wang f7f3bff646 Revert r100193 since it causes failures in objc in clang
llvm-svn: 100200
2010-04-02 18:43:42 +00:00
Daniel Dunbar 229385cd68 Sema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.
llvm-svn: 100197
2010-04-02 18:29:09 +00:00
Douglas Gregor 45cf7e3d2a Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.

llvm-svn: 100196
2010-04-02 18:24:57 +00:00
Mon P Wang 4b82a88764 Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.
llvm-svn: 100193
2010-04-02 18:04:30 +00:00
Daniel Dunbar 031d4d40d0 CG/NeXT: Assert some invariants on an ivar's containing decl context that I am about to refactor based on, following some testing.
llvm-svn: 100188
2010-04-02 15:43:29 +00:00
Anders Carlsson db0a965eca If a constructor is a dependent context, just set the base and member initializers as they are written. Fixes a bug where we wouldn't show initialization order warnings when instantiating.
llvm-svn: 100180
2010-04-02 06:26:44 +00:00
Anders Carlsson 7b3f2788a1 Diagnose multiple base and member initializers in class templates.
llvm-svn: 100179
2010-04-02 05:42:15 +00:00
Anders Carlsson 4c8cb01b5a More cleanup.
llvm-svn: 100175
2010-04-02 03:43:34 +00:00
Anders Carlsson 96b8fc664a Constify.
llvm-svn: 100174
2010-04-02 03:38:04 +00:00
Anders Carlsson e857b29e0c Minor cleanup.
llvm-svn: 100173
2010-04-02 03:37:03 +00:00
Chandler Carruth 4a70ae54b4 Resolve a layering violation by making AddTaggedVal public for
PartialDiagnostic objects, and hoisting the stream operator for QualType into
Type.h with the operator for the normal DiagnosticBuilder. Also remove the no
longer needed friend declaration for the DeclarationName stream operator.

llvm-svn: 100169
2010-04-02 01:39:03 +00:00
John McCall cdf40bed1b Check in a motivating test for the revised access semantics.
llvm-svn: 100159
2010-04-02 00:11:49 +00:00
John McCall d79b4d8173 Correct the calculation of access to more closely model the wording in
the standard.

llvm-svn: 100155
2010-04-02 00:03:43 +00:00
Ted Kremenek cbcb692133 Update analyzer build.
llvm-svn: 100153
2010-04-01 23:25:38 +00:00
Douglas Gregor 697a39110f Minor cleanup with the ternary operator
llvm-svn: 100144
2010-04-01 22:47:07 +00:00
Fariborz Jahanian d603b54c55 Relax the typesafty rules of block pointers types which
take'id' or return 'id' in their type. Fixes radar 7814131.

llvm-svn: 100129
2010-04-01 19:50:22 +00:00
Douglas Gregor b242683d99 Overhaul checking of non-type template arguments that should refer to
an object or function. Our previous checking was too lax, and ended up
allowing missing or extraneous address-of operators, among other
evils. The new checking provides better diagnostics and adheres more
closely to the standard.

Fixes PR6563 and PR6749.

llvm-svn: 100125
2010-04-01 18:32:35 +00:00
Daniel Dunbar e43887bd2b Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

llvm-svn: 100119
2010-04-01 18:21:41 +00:00
Daniel Dunbar f4b37e1926 Fix -Asserts warning, and protect against missing case.
llvm-svn: 100115
2010-04-01 16:50:48 +00:00
Kovarththanan Rajaratnam 8841e86d11 Include *.inc in install target
Fixes PR6755.

llvm-svn: 100105
2010-04-01 14:24:41 +00:00
Zhongxing Xu 640aad7667 Use the element type to compute the array size when the base region is a VarRegion.
Patch by Jordy Rose.

llvm-svn: 100099
2010-04-01 08:20:27 +00:00
Zhongxing Xu 920070cfe7 Initial support for visiting CXXMemberCallExpr.
llvm-svn: 100098
2010-04-01 07:58:50 +00:00
Chris Lattner e675d0f924 adjust to IRBuilder change and use faster DebugLoc apis.
llvm-svn: 100093
2010-04-01 06:31:43 +00:00
Zhongxing Xu 8cea7f6f70 Improve C++ constructor handling.
llvm-svn: 100080
2010-04-01 03:47:27 +00:00
Eric Christopher 2fbd4050e9 Fix typo.
llvm-svn: 100079
2010-04-01 03:07:20 +00:00
Eric Christopher 5464e5ae00 First start at wmmintrin.h file with Intel AES-NI instructions.
llvm-svn: 100077
2010-04-01 03:03:35 +00:00
Ted Kremenek c3e1f2f9ba Fix a bug (PR 6699) in RegionStore::RemoveDeadBindings() where
array values with a non-zero offset would get prematurely pruned from the store.

llvm-svn: 100067
2010-04-01 00:15:55 +00:00
Douglas Gregor f5af3584ca Improve diagnostics when an elaborated-type-specifer containing a
nested-name-specifier (e.g., "class T::foo") fails to find a tag
member in the scope nominated by the
nested-name-specifier. Previously, we gave a bland

  error: 'Nested' does not name a tag member in the specified scope

which didn't actually say where we were looking, which was rather
horrible when the nested-name-specifier was instantiated. Now, we give
something a bit better:

  error: no class named 'Nested' in 'NoDepBase<T>'

llvm-svn: 100060
2010-03-31 23:17:41 +00:00
Douglas Gregor e677dafce1 Change the representation of dependent elaborated-type-specifiers
(such as "class T::foo") from an ElaboratedType of a TypenameType to a
DependentNameType, which more accurately models the underlying
concept.

Improve template instantiation for DependentNameType nodes that
represent nested-name-specifiers, by performing tag name lookup and
checking the resulting tag appropriately. Fixes PR5681.

There is still much testing and cleanup to do in this area.

llvm-svn: 100054
2010-03-31 22:19:08 +00:00
Fariborz Jahanian 083712fbb7 Issue better syntax error when objc's messaging
ares are not separated by ':' (radar 7030268).

llvm-svn: 100040
2010-03-31 20:22:35 +00:00
Douglas Gregor 0208535fda Extend DependentNameType with a keyword enum that specifies whether
this was parsed as a typename-specifier, elaborated-type-specifier
(including the kind), or just a dependent qualified type name.

llvm-svn: 100039
2010-03-31 20:19:30 +00:00
Ted Kremenek b43e06fa56 For reverse data flow analyses, enqueue the blocks in reverse order.
This more likely matches with the ideal order the blocks should be visited.
This shaves another 1% off the -fsyntax-only time for compare.c (403.gcc).

llvm-svn: 100030
2010-03-31 18:45:04 +00:00
Chandler Carruth b32b344c8f Re-bind non-dependent CXXTemporaryObjectExpr nodes as temporaries when
instantiating a template, which ensures the destructor is called. This fixes
PR6671.

llvm-svn: 100029
2010-03-31 18:34:58 +00:00
Fariborz Jahanian c1fb862fda Patch implements gcc's -Wno-protocol option to suppress warning
on unimplemented methods in protocols adopted by a class.
(radar 7056600).

llvm-svn: 100028
2010-03-31 18:23:33 +00:00
Douglas Gregor d7d70e4788 Remove the AST statistics tracking I added yesterday; it didn't pan out.
llvm-svn: 100027
2010-03-31 18:21:31 +00:00