Commit Graph

13747 Commits

Author SHA1 Message Date
Douglas Gregor 3e51e173b6 Reinstate r104117, Chandler Carruth's change that "[provides] a naming
class for UnresolvedLookupExprs, even when occuring on template
names" along with a fix for an Objective-C++ crasher it introduced.

llvm-svn: 104277
2010-05-20 20:58:56 +00:00
Daniel Dunbar 2fcaa549a8 Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts approximately the same interface as 'llvm-mc'.
llvm-svn: 104239
2010-05-20 17:49:16 +00:00
Daniel Dunbar 3730048129 Driver: Move some argument lookup utilities into driver::ArgList.
llvm-svn: 104237
2010-05-20 16:54:55 +00:00
Fariborz Jahanian 6855ba2c95 Copy construction of non-trivial properties must not
be turned into a setter call (fixes radar 8008649).

llvm-svn: 104235
2010-05-20 16:46:55 +00:00
Douglas Gregor 265b8b8de0 Picky, picky
llvm-svn: 104230
2010-05-20 15:48:29 +00:00
Douglas Gregor c19108118d Fix a thinko
llvm-svn: 104229
2010-05-20 15:47:46 +00:00
Douglas Gregor f22101a059 Assert that we do not try to memcpy a non-POD class type in C++. This
particular issue was the cause of the Boost.Interprocess failures, and
in general will lead to horrendous, hard-to-diagnose miscompiles. The
assertion itself has survives self-host and a full Boost build, so we
are close to eradicating this problem in C++.

Note that the assertion is *not* turned on for Objective-C++, where we
still have problems with introducing memcpy's of non-POD class
types. That part of the assertion will go away as soon as we fix the
known issues in Objective-C++.

llvm-svn: 104227
2010-05-20 15:39:01 +00:00
Abramo Bagnara 02ccd28a92 Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.
llvm-svn: 104226
2010-05-20 15:32:11 +00:00
David Chisnall 29cefd1cc3 Fix my inability to spell 'continue' and a case where message sends returning non-pointer-sized things were generating invalid IR inside @try blocks.
llvm-svn: 104222
2010-05-20 13:45:48 +00:00
Abramo Bagnara 1108e7b873 Renamed misleading getSourceRange -> getLocalSourceRange and getFullSourceRange -> getSourceRange for TypeLoc.
llvm-svn: 104220
2010-05-20 10:00:11 +00:00
Douglas Gregor 7c38f153ac Rework our handling of binding a reference to a temporary
subobject. Previously, we could only properly bind to a base class
subobject while extending the lifetime of the complete object (of a
derived type); for non-static data member subobjects, we could memcpy
(!) the result and bind to that, which is rather broken.

Now, we pull apart the expression that we're binding to, to figure out
which subobject we're accessing, then construct the temporary object
(adding a destruction if needed) and, finally, dig out the subobject
we actually meant to access.

This fixes yet another instance where we were memcpy'ing rather than
doing the right thing. However, note the FIXME in references.cpp:
there's more work to be done for binding to subobjects, since the AST
is incorrectly modeling some member accesses in base classes as
lvalues when they are really rvalues.

llvm-svn: 104219
2010-05-20 08:36:28 +00:00
John McCall 58efb8e2bb Whoops.
llvm-svn: 104218
2010-05-20 07:13:26 +00:00
John McCall deb5e728ae Don't try to check jump scopes in invalid functions. Fixes
<rdar://problem/7995494>.

llvm-svn: 104217
2010-05-20 07:05:55 +00:00
Douglas Gregor aa2ac80eaa When creating a this-adjustment thunk where the return value is of C++
class type (that uses a return slot), pass the return slot to the
callee directly rather than allocating new storage and trying to copy
the object. This appears to have been the cause of the remaining two
Boost.Interprocess failures.

llvm-svn: 104215
2010-05-20 05:54:35 +00:00
Douglas Gregor fe60c14263 Remove accidental commit
llvm-svn: 104207
2010-05-20 02:26:51 +00:00
Douglas Gregor 527786ea3a Various small fixes for construction/destruction of Objective-C++
instance variables:
  - Use isRecordType() rather than isa<RecordType>(), so that we see
  through typedefs in ivar types.
  - Mark the destructor as referenced
  - Perform C++ access control on the destructor

llvm-svn: 104206
2010-05-20 02:24:22 +00:00
Ted Kremenek bd7b3ccbf8 Expose -fobjc-nonfragile-abi2 as a top-level clang driver option. Fixes <rdar://problem/8007063>.
llvm-svn: 104205
2010-05-20 02:12:37 +00:00
John McCall 87fe5d5618 Support implicitly closing on 'this' in a block. Fixed PR7165.
(the codegen works here, too, but that's annoying to test without execution)

llvm-svn: 104202
2010-05-20 01:18:31 +00:00
Chris Lattner 8ca2fd2e93 just add a fixme for the StructuredArgs leak, it shouldn't affect
c++'03 code and variadic support "needs work".

llvm-svn: 104195
2010-05-20 00:26:28 +00:00
Chris Lattner 047f5aa007 switch TemplateArgumentListBuilder to hold its flat argument list in a smallvector
instead of new[]'d.  This greatly reduces the number of new[]'s, and guess what, 
they were all leaked.

This adds a fixme in this hunk:

   unsigned NumPackArgs = NumFlatArgs - PackBeginIndex;
+  // FIXME: NumPackArgs shouldn't be negative here???
   if (NumPackArgs)
-    PackArgs = &FlatArgs[PackBeginIndex];
+    PackArgs = FlatArgs.data()+PackBeginIndex;

where test/SemaTemplate/variadic-class-template-2.cpp is accessing the vector
out of range and NumPackArgs is negative.  I assume variadic template args are
completely hosed.

llvm-svn: 104194
2010-05-20 00:25:36 +00:00
Chris Lattner ce7a22d97c fix the TemplateArgumentList copy constructor to not
be a copy constructor (since it isn't one semantically)
and fix the ownership bits it sets to be correct!

llvm-svn: 104192
2010-05-20 00:19:09 +00:00
Chris Lattner c9b03bcc5d Clarify TemplateArgumentList ownership over its "flat" and
"structure" arg lists, the first step to fixing some massive
memory leaks.

llvm-svn: 104191
2010-05-20 00:11:47 +00:00
Jim Grosbach db061516be tweak to (hopefully) fix darwin[89] buildbots. Thanks to Doug for the suggested modification.
llvm-svn: 104188
2010-05-19 23:53:08 +00:00
Douglas Gregor fa6010b6e4 When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.

Daniel did all the hard work of tracking down the issue, I get to type
up the trivial fix for this horrible miscompile.

llvm-svn: 104184
2010-05-19 23:40:50 +00:00
Abramo Bagnara d754848f10 Added basic source locations to Elaborated and DependentName types.
llvm-svn: 104169
2010-05-19 21:37:53 +00:00
Fariborz Jahanian f633ebd961 Adds support for ObjC++'s GC attribute on declaration of
object variables and functions returning such objects.

llvm-svn: 104168
2010-05-19 21:37:30 +00:00
Daniel Dunbar fd5ed84873 Revert r104117, "Provide a naming class for UnresolvedLookupExprs, even when
occuring on..." which breaks some Objective-C code. Working on getting a test
case...

llvm-svn: 104150
2010-05-19 21:07:14 +00:00
Douglas Gregor 0e0f67ec95 Fill in some silly defaults to silence a GCC warning
llvm-svn: 104140
2010-05-19 18:41:43 +00:00
Douglas Gregor a72a4e3229 Cache the linkage of a type within its canonical type, eliminating
some seriously non-linear performance with deeply nested template
instantiations, as shown in PR6998.

llvm-svn: 104139
2010-05-19 18:39:18 +00:00
Ted Kremenek 26bde774df Add clang support for IBOutletCollection.
llvm-svn: 104135
2010-05-19 17:38:06 +00:00
Douglas Gregor 6044d691bb Revert r104106; it's breaking linking of Boost.Serialization.
llvm-svn: 104121
2010-05-19 17:02:24 +00:00
Benjamin Kramer fdb61d78e9 Implement codegen for __builtin_isnormal.
llvm-svn: 104118
2010-05-19 11:24:26 +00:00
Chandler Carruth 8fd2b8935e Provide a naming class for UnresolvedLookupExprs, even when occuring on
template names. We were completely missing naming classes for many unqualified
lookups, but this didn't trigger code paths that need it. This removes part of
an optimization that re-uses the template name lookup done by the parser to
determine if explicit template arguments actually form a template-id.
Unfortunately the technique for avoiding the duplicate lookup lost needed data
such as the class context in which the lookup succeeded.

llvm-svn: 104117
2010-05-19 09:39:06 +00:00
Douglas Gregor e9ceb31405 Profile type-dependent uses of overloaded operators in C++ the same
way regardless of whether some overloaded operator functions were
found by name lookup within the template. Fixes PR6851.

llvm-svn: 104107
2010-05-19 04:13:23 +00:00
Douglas Gregor 21553f5970 Teach clang to instantiate attributes on more declarations. Fixes PR7102.
llvm-svn: 104106
2010-05-19 03:39:53 +00:00
Douglas Gregor cbfbca14d0 Implement C++ builtin operator candidates for vector types.
llvm-svn: 104105
2010-05-19 03:21:00 +00:00
Chandler Carruth 425cec3e33 Fix a GCC warning about inline functions not being defined. Until r104081, only
the same .cpp file as provided the definitions referenced these functions,
hiding the issue. However, they are clearly no longer inline. Let me know if
there is a reason to move their definitions to the header and make them truly
inline.

llvm-svn: 104104
2010-05-19 02:12:56 +00:00
Chandler Carruth eba788efa6 Fix an obvious goof that rjmccall found by inspection. No testcase, suggestions
welcome for one.

llvm-svn: 104101
2010-05-19 01:37:01 +00:00
Fariborz Jahanian 9f963c2488 Misc. fixes to bring Objetive-C++'s handling of
gc attributes to be inline with Objective-C
(for radar 7925141).

llvm-svn: 104084
2010-05-18 23:04:17 +00:00
Douglas Gregor bdb604a806 Protect isIntegerConstantExpr from seeing type- or value-dependent
expressions in attributes, pragmas.

llvm-svn: 104083
2010-05-18 23:01:22 +00:00
Douglas Gregor 4618868a7d Implement C++ support for vector and extended vector types. This
involves extending implicit conversion sequences to model vector
conversions and vector splats, along with teaching the C++ conditional
operator-checking code about vector types.

Fixes <rdar://problem/7983501>.

llvm-svn: 104081
2010-05-18 22:42:18 +00:00
Ted Kremenek 49be9e0819 Teach CursorVisitor about duplicate ObjCPropertyDecls that can arise because of a current
design limitation in how we handle Objective-C class extensions.  This was causing the CursorVisitor
to essentially visit an @property twice (once in the @interface, the other in the class extension).
Fixes <rdar://problem/7410145>.

llvm-svn: 104055
2010-05-18 21:09:07 +00:00
Douglas Gregor a941dcae16 Add support for Microsoft's __thiscall, from Steven Watanabe!
llvm-svn: 104026
2010-05-18 16:57:00 +00:00
Anders Carlsson be48c548c5 Correctly initialize bases with member pointers. This should fix PR6441 but that test case is a bit weird and I'd like to investigate further before closing that bug.
llvm-svn: 104025
2010-05-18 16:51:41 +00:00
Douglas Gregor 86ad085b40 Give a slight edge to the context-sensitive keyword 'super' over
non-function-local declarations with names similar to what the user
typed. For example, this allows us to correct 'supper' to 'super' in
an Objective-C message send, even though the C function 'isupper' has
the same edit distance.

llvm-svn: 104023
2010-05-18 16:30:22 +00:00
Douglas Gregor 5fd04d4832 Tweak typo-correction logic a bit regarding "super", so that we
consider "super" as a candidate whenever we're parsing an expression
within an Objective-C method in an interface that has a superclass. At
some point, we'd like to give "super" a little edge over non-local
names; that will come later.

llvm-svn: 104022
2010-05-18 16:14:23 +00:00
John McCall 0e704f7fcd Permit Objective C object pointers to be const_casted.
llvm-svn: 104019
2010-05-18 09:35:29 +00:00
Alexis Hunt abb2ac8889 Switch over the tablegen to use much prettier range technology
Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def
files

llvm-svn: 104017
2010-05-18 06:22:21 +00:00
Douglas Gregor 923d2252dc "The attached patch allows clang to find the headers
for Visual Studio 2010.  It also adds a registry search
for the Express edition,", from Steven Watanabe!

llvm-svn: 104015
2010-05-18 05:47:04 +00:00
Douglas Gregor b92ea59481 I hate this commit.
Revert much of the implementation of C++98/03 [temp.friend]p5 in
r103943 and its follow-ons r103948 and r103952. While our
implementation was technically correct, other compilers don't seem to
implement this paragraph (which forces the instantiation of friend
functions defined in a class template when a class template
specialization is instantiated), and doing so broke a bunch of Boost
libraries. 

Since this behavior has changed in C++0x (which instantiates the
friend function definitions when they are used), we're going to skip
the nowhere-implemented C++98/03 semantics and go straight to the
C++0x semantics.

This commit is a band-aid to get Boost up and running again. It
doesn't really fix PR6952 (which this commit un-fixes), but it does
deal with the way Boost.Units abuses this particular paragraph.

llvm-svn: 104014
2010-05-18 05:45:02 +00:00