| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Shrinks OverloadCandidate from 208 to 168 bytes.
llvm-svn: 148204
|
| |
|
|
|
|
| |
fragile.
llvm-svn: 148200
|
| |
|
|
|
|
| |
conversion sequences so we don't get double frees when the vector reallocates.
llvm-svn: 148198
|
| |
|
|
| |
llvm-svn: 148197
|
| |
|
|
|
|
|
|
|
|
|
|
| |
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).
Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.
llvm-svn: 148187
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Replace push_back with addCandidate which will let us make use of the fixed size of
the conversion sequence vector soon.
llvm-svn: 148185
|
| |
|
|
|
|
|
|
| |
virtual functions that provide previous/most recent redeclaration
information for any declaration. Use this to eliminate the redundant,
less efficient getPreviousDecl() functions.
llvm-svn: 148184
|
| |
|
|
|
|
|
|
| |
don't set isUsed for local variables which are referenced in unevaluated contexts. Make other code use isReferenced() (which basically indicates that a declaration isn't dead) where appropriate.
I was forced to change test/SemaCXX/linkage.cpp because we aren't actually modeling extern "C" in the AST the way that testcase expects; we were not printing a warning only because we skipped the relevant check. Someone who actually understands the semantics here should fix that.
llvm-svn: 148158
|
| |
|
|
|
|
|
|
| |
The change to SemaTemplateVariadic.cpp improves the typo correction
results in certain situations, while the change to SemaTemplate.cpp
does not change existing behavior.
llvm-svn: 148155
|
| |
|
|
|
|
|
| |
multiple name lookup results in C/Objective-C. Fixes a regression a
caused in r147533, found by Enea Zaffanella!
llvm-svn: 148154
|
| |
|
|
|
|
|
| |
memcmp, strncmp,..) out of Sema and into FunctionDecl so that the logic
could be reused in the analyzer.
llvm-svn: 148142
|
| |
|
|
|
|
|
|
|
| |
improving the typo correction results in certain situations.
This is also the first typo correction callback conversion to affect
an existing unit test. :)
llvm-svn: 148140
|
| |
|
|
| |
llvm-svn: 148135
|
| |
|
|
|
|
| |
base classes.
llvm-svn: 148094
|
| |
|
|
|
|
| |
report on cfe-dev.
llvm-svn: 148090
|
| |
|
|
|
|
| |
function. In particular, this restores the cool error recovery for the example from http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html , which regressed a few months back.
llvm-svn: 148089
|
| |
|
|
|
|
| |
incomplete return type.
llvm-svn: 148088
|
| |
|
|
|
|
|
| |
objects, and add a basic CorrectionCandidateCallback template class
to simplify the fixups.
llvm-svn: 148085
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- If the declarator is at the start of a line, and the previous line contained
another declarator and ended with a comma, then that comma was probably a
typo for a semicolon:
int n = 0, m = 1, l = 2, // k = 5;
myImportantFunctionCall(); // oops!
- If removing the parentheses would correctly initialize the object, then
produce a note suggesting that fix.
- Otherwise, if there is a simple initializer we can suggest which performs
value-initialization, then provide a note suggesting a correction to that
initializer.
Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.
llvm-svn: 148072
|
| |
|
|
|
|
| |
improvng the typo correction results in certain situations.
llvm-svn: 148052
|
| |
|
|
|
|
| |
list of protools. // rdar://10669694
llvm-svn: 148051
|
| |
|
|
|
|
|
| |
And once again improve the typo correction results in certain
situations just by moving the existing checks on the correction.
llvm-svn: 148037
|
| |
|
|
|
|
|
|
| |
expression for an Objective-C object or pointer type, so that we don't
attempt to treat the member name as a template. Fixes
<rdar://problem/10672501>.
llvm-svn: 148028
|
| |
|
|
|
|
|
|
|
|
| |
was constructed, e.g. for a property access.
This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.
llvm-svn: 148013
|
| |
|
|
| |
llvm-svn: 147984
|
| |
|
|
|
|
|
| |
in class extensions and categories by recent refactoring
of objc class ASTs. // rdar://1066654
llvm-svn: 147982
|
| |
|
|
|
|
| |
variably-modified type.
llvm-svn: 147973
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
are still added if the cached correction fails validation.
Also fix a copy-and-paste error in a comment from my previous commit.
Finally, add an example of the benefit the typo correction callback adds
to TryNamespaceTypoCorrection--which happens to also tickle the above
caching problem, as the only way a non-namespace Decl would be added to
the possible corrections is if it was cached as the correction for a
previous instance of the same typo where the typo was corrected to a
non-namespace via a different code path.
llvm-svn: 147968
|
| |
|
|
| |
llvm-svn: 147963
|
| |
|
|
|
|
|
|
|
| |
Also includes two examples of the callback: a wrapper/replacement for
the CorrectTypoContext enum, and a conversion of the two calls to
CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable
improvement to the typo correction, as demonstrated in the added test).
llvm-svn: 147962
|
| |
|
|
|
|
|
| |
life-time to that of its backing 'ivar's lifetime.
// rdar://10558871
llvm-svn: 147956
|
| |
|
|
|
|
|
| |
downgrade the default-error warning to an ExtWarn in
C90/99. <rdar://problem/10668057>
llvm-svn: 147925
|
| |
|
|
|
|
| |
shared between lambda expressions and block literals.
llvm-svn: 147917
|
| |
|
|
|
|
| |
new-expressions.
llvm-svn: 147900
|
| |
|
|
|
|
| |
namespace declaration invalid
llvm-svn: 147882
|
| |
|
|
|
|
| |
ownership of property sent to 'super'. // rdar://10640891
llvm-svn: 147868
|
| |
|
|
| |
llvm-svn: 147864
|
| |
|
|
|
|
| |
complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)
llvm-svn: 147840
|
| |
|
|
|
|
| |
make sure that's safe. Get rid of a check which is now unnecessary in Sema::getFunctionLevelDeclContext().
llvm-svn: 147837
|
| |
|
|
|
|
|
|
| |
- reject definitions of enums within friend declarations
- require 'enum', not 'enum class', for non-declaring references to scoped
enumerations
llvm-svn: 147824
|
| |
|
|
|
|
|
| |
c++ objects with non-trivial assignment/copy functions.
Also, one additional sema check. // rdar://6137845
llvm-svn: 147817
|
| |
|
|
| |
llvm-svn: 147812
|
| |
|
|
|
|
| |
specialization.
llvm-svn: 147798
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is important because it's fairly common for headers (especially system
headers) to want to provide only those typedefs needed for that
particular header, based on some guard macro, e.g.,
#ifndef _SIZE_T
#define _SIZE_T
typedef long size_t;
#endif
which is repeated in a number of headers. The guard macro protects
against duplicate definitions. However, this means that only the first
occurrence of this pattern actually defines size_t, so the submodule
corresponding to this header has the only visible definition. If a
user then imports a different submodule from the same module, size_t
will be known but not visible, and therefore cannot be used.
By allowing redefinition of typedefs, each header that wants to define
size_t can do so independently, so it will be available in the
corresponding submodules.
llvm-svn: 147775
|
| |
|
|
| |
llvm-svn: 147774
|
| |
|
|
| |
llvm-svn: 147730
|
| |
|
|
|
|
|
|
|
|
|
|
| |
to Redeclarable<NamespaceDecl>, so that we benefit from the improveed
redeclaration deserialization and merging logic provided by
Redeclarable<T>. Otherwise, no functionality change.
As a drive-by fix, collapse the "inline" bit into the low bit of the
original namespace/anonymous namespace, saving 8 bytes per
NamespaceDecl on x86_64.
llvm-svn: 147729
|
| |
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
This patch (and some of my other commits related to lambdas) is heavily based off of John Freeman's work-in-progress patches.
llvm-svn: 147706
|