summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Pool allocate ImplicitConversionSequences.Benjamin Kramer2012-01-141-9/+10
| | | | | | | | | | | | | | | | To avoid malloc thrashing give OverloadCandidateSet an inline capacity for conversion sequences. We use the fact that OverloadCandidates never outlive the OverloadCandidateSet and have a fixed amount of conversion sequences. This eliminates the oversized SmallVector from OverloadCandidate shrinking it from 752 to 208 bytes. On the test case from the "Why is CLANG++ so freaking slow" thread on llvmdev this avoids one gig of vector reallocation (including memcpy) which translates into 5-10% speedup on Lion/x86_64. Overload candidate computation is still the biggest malloc contributor when compiling templated c++ code. llvm-svn: 148186
* OverloadCandidateSet: Stop exposing SmallVector internalsBenjamin Kramer2012-01-141-22/+9
| | | | | | | Replace push_back with addCandidate which will let us make use of the fixed size of the conversion sequence vector soon. llvm-svn: 148185
* More lambda work: semantic analysis of capturing 'this'. It's a bit ↵Eli Friedman2012-01-071-0/+1
| | | | | | complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.) llvm-svn: 147723
* Overloading for initializer list construction.Sebastian Redl2011-12-221-80/+126
| | | | llvm-svn: 147156
* Two null Decl*'s don't refer to the same declaration, because theyDouglas Gregor2011-12-151-3/+4
| | | | | | | | don't refer to anything. Amusingly, we were relying on this in one place. Thanks to Chandler for noticing the weirdness in declaresSameEntity. llvm-svn: 146659
* Replace all comparisons between ObjCInterfaceDecl pointers with callsDouglas Gregor2011-12-151-1/+2
| | | | | | | | to declaresSameEntity(), as a baby step toward tracking forward declarations of Objective-C classes precisely. Part of <rdar://problem/10583531>. llvm-svn: 146618
* Make the diagnostic message more consistant. Update the type comparison toRichard Trieu2011-12-131-11/+16
| | | | | | | handle non-pointer types. This is for the extra info printed when function types are compared. llvm-svn: 146525
* Implement overload resolution for reference-typed parameters supplied with ↵Sebastian Redl2011-12-031-3/+65
| | | | | | initializer lists. llvm-svn: 145769
* In Microsoft mode, make "Unqualified lookup into dependent bases of class ↵Francois Pichet2011-11-251-1/+1
| | | | | | | | | | templates" works inside a friend function definition at class scope. Basically we have to look into the parent *lexical* DeclContext for friend functions at class scope. That's because calling GetParent() return the namespace or file DeclContext. This fixes all remaining cases of "Unqualified lookup into dependent bases of class templates" when parsing MFC code with clang. llvm-svn: 145127
* Add feature to diagnostics that will provide more information on functionRichard Trieu2011-11-231-14/+121
| | | | | | | | | | pointer mismatch. Cases covered are: initialization, assignment, and function arguments. Additional text will give the extra information about the nature of the mismatch: different classes for member functions, wrong number of parameters, different parameter type, different return type, and function qualifier mismatch. llvm-svn: 145114
* Fixed HadMultipleCandidates loading.Abramo Bagnara2011-11-191-9/+15
| | | | llvm-svn: 144995
* In Microsoft mode, make "Unqualified lookup into dependent bases of class ↵Francois Pichet2011-11-171-1/+1
| | | | | | | | | | templates" works inside default argument instantiation. This is a little bit tricky because during default argument instantiation the CurContext points to a CXXMethodDecl but we can't use the keyword this or have an implicit member call generated. This fixes 2 errors when parsing MFC code with clang. llvm-svn: 144881
* Added missing ImplicitCastExpr around conversion operator call.Abramo Bagnara2011-11-161-4/+14
| | | | llvm-svn: 144850
* Move "Unqualified lookup into dependent bases of class templates" Microsoft ↵Francois Pichet2011-11-111-1/+1
| | | | | | specific behavior from -fms-extensions to -fms-compatibility. llvm-svn: 144341
* Implicit casts from rvalue to lvalue are not meaningful. Don't accidentally addRichard Smith2011-11-101-1/+1
| | | | | | | | | | them when performing a const conversion on the implicit object argument for a member operator call on an rvalue. No change to the testsuite: the test for this change is that the added assertion does not fire any more. llvm-svn: 144333
* In C++ keep unavailable function calls in the AST, like in C/ObjC.Argyrios Kyrtzidis2011-11-041-0/+7
| | | | | | This allows the migrator to visit and fix them. llvm-svn: 143699
* Enable function call and some overload resolution with parameters of ↵Sebastian Redl2011-11-011-7/+40
| | | | | | aggregate class type and initializer list arguments. llvm-svn: 143462
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-44/+12
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-12/+44
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-44/+12
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Teach the ARC compiler to not require __bridge casts whenJohn McCall2011-10-171-38/+120
| | | | | | | passing/receiving CF objects at +0 to/from Objective-C methods or audited C functions. llvm-svn: 142219
* Implement overload resolution from init lists for scalar parameter types.Sebastian Redl2011-10-161-0/+86
| | | | llvm-svn: 142148
* Drop the Diagnose parameter from Sema::PerformImplicitConversion again and ↵Sebastian Redl2011-10-161-8/+3
| | | | | | instead use TryImplicitConversion in CheckSingleAssignmentConstraints when that function is in no-diagnostics mode. llvm-svn: 142143
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-2/+7
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Attempt to fix Windows buildbot, round 2.Eli Friedman2011-10-141-1/+1
| | | | llvm-svn: 142014
* Attempt to fix buildbot failure on Windows.Eli Friedman2011-10-141-1/+2
| | | | llvm-svn: 142008
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-141-1/+1
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* Catch placeholder types in DefaultLvalueConversionJohn McCall2011-10-111-28/+45
| | | | | | | | | | | and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. llvm-svn: 141738
* Always add the built-in overload candidates for operators &&, ||, andDouglas Gregor2011-10-101-1/+5
| | | | | | !. Fixes PR9865. llvm-svn: 141537
* Added a flag to identify resolved overloaded function references.Abramo Bagnara2011-10-051-36/+73
| | | | llvm-svn: 141171
* Don't allow an rvalue reference to bind to the result of a calling aDouglas Gregor2011-10-041-0/+23
| | | | | | | | | conversion function whose result type is an lvalue reference. The initialization code already handled this properly, but overload resolution was allowing the binding. Fixes PR11003 / <rdar://problem/10233078>. llvm-svn: 141137
* CUDA: diagnose invalid calls across targetsPeter Collingbourne2011-10-021-0/+32
| | | | llvm-svn: 140978
* objc arc: Diagnose block pointer type mismatch whenFariborz Jahanian2011-09-281-16/+4
| | | | | | | | some arguments types are ns_consumed and some otherwise matching types are not. This is objc side of // rdar://10187884 llvm-svn: 140729
* objc++ arc: Diagnose block pointer type mismatch whenFariborz Jahanian2011-09-281-0/+17
| | | | | | | | some arguments types are ns_consumed and some otherwise matching types are not. This fixes the objc++ side only *auch*. // rdar://10187884 llvm-svn: 140717
* Only print _Bool as 'bool' when 'bool' is defined as an object-likeDouglas Gregor2011-09-271-1/+1
| | | | | | macro whose only replacement token is '_Bool'. llvm-svn: 140656
* When 'bool' is not a built-in type but is defined as a macro, printDouglas Gregor2011-09-271-1/+1
| | | | | | | 'bool' rather than '_Bool' within types, to make things a bit more readable. Fixes <rdar://problem/10063263>. llvm-svn: 140650
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+3
| | | | llvm-svn: 140478
* Add a special note for overload resolution when an initializer list argumentSebastian Redl2011-09-241-0/+11
| | | | | | | | | cannot be converted. This is in preparation for overload resolution of initializer lists. Currently, you will always get this message when you try to pass an init list to an overloaded function. llvm-svn: 140461
* Give InitListChecker a verification-only mode, where it neither emits ↵Sebastian Redl2011-09-241-15/+19
| | | | | | | | | | | diagnostics nor builds a semantic (structured) initializer list, just reports on whether it can match the given list to the target type. Use this mode for doing init list checking in the initial step of initialization, which will eventually allow us to do overload resolution based on the outcome. llvm-svn: 140457
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-2/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-6/+7
| | | | llvm-svn: 140367
* Enforce access control for conversion operators used in contextualJohn McCall2011-09-211-5/+4
| | | | | | conversions (rather than just call-arguments). llvm-svn: 140244
* In Microsoft mode(-fms-compatibility), prefer an integral conversion to a ↵Francois Pichet2011-09-181-0/+19
| | | | | | | | | | | | | | | | floating-to-integral conversion if the integral conversion is between types of the same size. For example: void f(float); void f(int); int main { long a; f(a); } Here, MSVC will call f(int) instead of generating a compile error as clang will do in standard mode. This fixes a few errors when parsing MFC code with clang. llvm-svn: 140007
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-3/+3
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Silence "end of non-void function" warnings with llvm_unreachable and add an ↵Benjamin Kramer2011-09-101-2/+5
| | | | | | assert. llvm-svn: 139474
* Fix a -Wreturn-type warning due to this field not explicitly having theChandler Carruth2011-09-101-1/+1
| | | | | | enumeration type. llvm-svn: 139445
* Add smarter sorting of overload candidates that failed template deduction.Kaelyn Uhrain2011-09-091-0/+37
| | | | llvm-svn: 139417
* Contextually converting to 'id' is not a useful operation. ContextuallyJohn McCall2011-09-091-14/+46
| | | | | | | | | | | | converting to an arbitrary Objective-C pointer type is. Without significantly re-implementing anything, change the API to reflect this, and as a minor optimization, strip the pointer conversion off before potentially building it. Mostly, this removes a really bizarre-looking bit of code from BuildInstanceMessage. llvm-svn: 139354
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-091-6/+13
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* In Microsoft mode, if we are inside a template class member function and we ↵Francois Pichet2011-09-071-1/+14
| | | | | | | | can't resolve a function call then create a type-dependent CallExpr even if the function has no type dependent arguments. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes. With this patch in, clang will generate only 37 errors (down from 212) when parsing a typical MFC source file. llvm-svn: 139210
OpenPOWER on IntegriCloud