- May 16, 2010
-
-
rdar://7985267Chris Lattner authored
passed to va_start, it doesn't actually pass it. llvm-svn: 103899
-
- May 15, 2010
-
-
John McCall authored
ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
-
Douglas Gregor authored
return statements. We perform NRVO only when all of the return statements in the function return the same variable. Fixes some link failures in Boost.Interprocess (which is relying on NRVO), and probably improves performance for some C++ applications. llvm-svn: 103867
-
Douglas Gregor authored
return value optimization. Sema marks return statements with their NRVO candidates (which may or may not end up using the NRVO), then, at the end of a function body, computes and marks those variables that can be allocated into the return slot. I've checked this locally with some debugging statements (not committed), but there won't be any tests until CodeGen comes along. llvm-svn: 103865
-
Douglas Gregor authored
"return" statement and mark the corresponding CXXConstructExpr as elidable. Teach CodeGen that eliding a temporary is different from eliding an object construction. This is just a baby step toward NRVO. llvm-svn: 103849
-
- May 14, 2010
-
-
Fariborz Jahanian authored
Radar 7923673. llvm-svn: 103812
-
Fariborz Jahanian authored
user directive is needed to force a property implementation. It is decided based on those propeties which are declared in the class (or in its protocols) but not those which must be default implemented by one of its super classes. Implements radar 7923851. llvm-svn: 103787
-
Daniel Dunbar authored
types.", it is breaking Clang bootstrap. llvm-svn: 103775
-
Abramo Bagnara authored
llvm-svn: 103770
-
Douglas Gregor authored
scopes during unqualified name lookup that has fallen out to namespace scope. Fixes PR7133. llvm-svn: 103766
-
Douglas Gregor authored
function's definition is an out-of-class definition marked "inline". Fixes an assertion in WebKit. llvm-svn: 103763
-
- May 13, 2010
-
-
Fariborz Jahanian authored
Completes radar 7963410. llvm-svn: 103719
-
Douglas Gregor authored
"used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key function definition). Previously, we were effectively tracking "potential definitions" rather than uses, so we were a bit too eager about emitting vtables for classes without key functions. The new scheme: - For every use of a vtable, Sema calls MarkVTableUsed() to indicate the use. For example, this occurs when calling a virtual member function of the class, defining a constructor of that class type, dynamic_cast'ing from that type to a derived class, casting to/through a virtual base class, etc. - For every definition of a vtable, Sema calls MarkVTableUsed() to indicate the definition. This happens at the end of the translation unit for classes whose key function has been defined (so we can delay computation of the key function; see PR6564), and will also occur with explicit template instantiation definitions. - For every vtable defined/used, we mark all of the virtual member functions of that vtable as defined/used, unless we know that the key function is in another translation unit. This instantiates virtual member functions when needed. - At the end of the translation unit, Sema tells CodeGen (via the ASTConsumer) which vtables must be defined (CodeGen will define them) and which may be used (for which CodeGen will define the vtables lazily). From a language perspective, both the old and the new schemes are permissible: we're allowed to instantiate virtual member functions whenever we want per the standard. However, all other C++ compilers were more lazy than we were, and our eagerness was both a performance issue (we instantiated too much) and a portability problem (we broke Boost test cases, which now pass). Notes: (1) There's a ton of churn in the tests, because the order in which vtables get emitted to IR has changed. I've tried to isolate some of the larger tests from these issues. (2) Some diagnostics related to implicitly-instantiated/implicitly-defined virtual member functions have moved to the point of first use/definition. It's better this way. (3) I could use a review of the places where we MarkVTableUsed, to see if I missed any place where the language effectively requires a vtable. Fixes PR7114 and PR6564. llvm-svn: 103718
-
John McCall authored
magic type that 'id' is a pointer to. llvm-svn: 103708
-
John McCall authored
against pointer patterns. llvm-svn: 103706
-
Chandler Carruth authored
llvm-svn: 103705
-
Fariborz Jahanian authored
class object used as a receiver to an objective-c pointer via a converwsion function. wip. llvm-svn: 103672
-
Chris Lattner authored
llvm-svn: 103670
-
- May 12, 2010
-
-
Fariborz Jahanian authored
another. llvm-svn: 103630
-
Douglas Gregor authored
potentially-evaluated expression context, to ensure that used declarations get properly marked. Fixes PR7123. llvm-svn: 103624
-
Douglas Gregor authored
member function (default constructor, copy constructor, copy assignment operator, destructor), emit a note showing where that implicit definition was required. llvm-svn: 103619
-
John McCall authored
a convenience routine to find the innermost common ancestor of two scopes. llvm-svn: 103565
-
John McCall authored
about the permitted scopes. Specifically: 1) Permit labels and gotos to appear after a prologue of variable initializations. 2) Permit indirect gotos to jump out of scopes that don't require cleanup. 3) Diagnose possible attempts to indirect-jump out of scopes that do require cleanup. This requires a substantial reinvention of the algorithm for checking indirect goto. The current algorithm is Omega(M*N), with M = the number of unique scopes being jumped from and N = the number of unique scopes being jumped to, with an additional factor that is probably (worst-case) linear in the depth of scopes. Thus the entire thing is likely cubic given some truly bizarre ill-formed code; on well-formed code the additional factor collapses to an amortized constant (when amortized over the entire function) and so the algorithm is quadratic. Even this requires every label to appear in its own scope, which would be very unusual for indirect-goto code (and extremely unlikely for well-formed code); it is far more likely that all labels will be in the same scope and so the algorithm becomes linear. For such a marginal feature, I am fairly happy with this result. (this is using JumpDiagnostic's definition of scope, where successive variables in a block appear in their own scope) llvm-svn: 103536
-
- May 11, 2010
-
-
Abramo Bagnara authored
llvm-svn: 103517
-
Daniel Dunbar authored
implicitly-instantiated class as ...", which seems to have broken bootstrap. llvm-svn: 103515
-
Douglas Gregor authored
referenced unless we see one of them defined (or the key function defined, if it as one) or if we need the vtable for something. Fixes PR7114. llvm-svn: 103497
-
Douglas Gregor authored
explicit instantiations of template. C++0x clarifies the intent (they're ill-formed in some cases; see [temp.explicit] for details). However, one could squint at the C++98/03 standard and conclude they are permitted, so reduce the error to a warning (controlled by -Wc++0x-compat) in C++98/03 mode. llvm-svn: 103482
-
Fariborz Jahanian authored
Fixes radar 7952457. llvm-svn: 103447
-
- May 09, 2010
-
-
Douglas Gregor authored
Be more careful about picking a template parameter when we fail to substitute explicit template arguments into a function template llvm-svn: 103369
-
Douglas Gregor authored
non-existent condition expressions to boolean values during template instantiation. llvm-svn: 103364
-
Douglas Gregor authored
particular, don't complain about unused variables that have dependent type until instantiation time, so that we can look at the type of the variable. Moreover, only complain about unused variables that have neither a user-declared constructor nor a non-trivial destructor. llvm-svn: 103362
-
Douglas Gregor authored
unused, since the operation has side effects. llvm-svn: 103360
-
Douglas Gregor authored
for, and switch), be careful to construct the full expressions as soon as we perform template instantation, so we don't either forget to call temporary destructors or destroy temporaries at the wrong time. This is the template-instantiation analogue to r103187, during which I hadn't realized that the issue would affect the handling of these constructs differently inside and outside of templates. Fixes a regression in Boost.Function. llvm-svn: 103357
-
- May 08, 2010
-
-
Douglas Gregor authored
Don't destroy the data associated with an overload resolution candidate; it's ASTContext-allocated now llvm-svn: 103350
-
Douglas Gregor authored
templates and conversion function templates. llvm-svn: 103349
-
Douglas Gregor authored
specific message that includes the template arguments, e.g., test/SemaTemplate/overload-candidates.cpp:27:20: note: candidate template ignored: substitution failure [with T = int *] typename T::type get_type(const T&); // expected-note{{candidate ... ^ llvm-svn: 103348
-
Douglas Gregor authored
failed because the explicitly-specified template arguments did not match its template parameters, e.g., test/SemaTemplate/overload-candidates.cpp:18:8: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'I' void get(const T&); ^ test/SemaTemplate/overload-candidates.cpp:20:8: note: candidate template ignored: invalid explicitly-specified argument for 1st template parameter void get(const T&); ^ llvm-svn: 103344
-
Douglas Gregor authored
this issue. llvm-svn: 103343
-
Douglas Gregor authored
functionality change. llvm-svn: 103342
-
Douglas Gregor authored
many/too few arguments, use the same diagnostic we use for arity mismatches in non-templates (but note that it's a function template). llvm-svn: 103341
-