| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
reached a thrilling climax when
FunctionDecl::setPure crashed a poor user's code.
Remove the use of this accessor when deserializing, along with several other in the neighborhood. Fixes rdar://8759653.
llvm-svn: 122756
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
packs, e.g.,
template<typename T, unsigned ...Dims> struct multi_array;
along with semantic analysis support for finding unexpanded non-type
template parameter packs in types, expressions, and so on.
Template instantiation involving non-type template parameter packs
probably doesn't work yet. That'll come soon.
llvm-svn: 122527
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
common base for ExtQuals and Type that stores the underlying type
pointer. This results in a 2% performance win for -emit-llvm on a
typical C file, with 1% memory growth in the AST.
Note that there is an API change in this optimization:
QualType::getTypePtr() can no longer be invoked on a NULL
QualType. If the QualType might be NULL, use
QualType::getTypePtrOrNull(). I've audited all uses of getTypePtr() in
the code base and changed the appropriate uses over to
getTypePtrOrNull().
A future optimization opportunity would be to distinguish between
cast/dyn_cast and cast_or_null/dyn_cast_or_null; for the former, we
could use getTypePtr() rather than getTypePtrOrNull(), to take another
branch out of the cast/dyn_cast implementation.
llvm-svn: 121489
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"inline", we weren't giving the definition weak linkage because the
"inline" bit wasn't propagated. This was a longstanding FIXME that,
somehow, hadn't triggered a bug in the wild. Fix this problem by
tracking whether any declaration was marked "inline", and clean up the
semantics of GNU's "extern inline" semantics calculation based on this
change.
Fixes <rdar://problem/8740363>.
llvm-svn: 121373
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My previous attempt at solving the compile-time problem with many
redeclarations of the same entity cached both linkage and visibility,
while this patch only tackles linkage. There are several reasons for
this difference:
- Linkage is a language concept, and is evaluated many times during
semantic analysis and codegen, while visibility is only a
code-generation concept that is evaluated only once per (unique)
declaration. Hence, we *must* optimize linkage calculations but
don't need to optimize visibility computation.
- Once we know the linkage of a declaration, subsequent
redeclarations can't change that linkage. Hence, cache
invalidation is far simpler than for visibility, where a later
redeclaration can completely change the visibility.
- We have 3 spare bits in Decl to store the linkage cache, so the
cache doesn't increase the size of declarations. With the
visibility+linkage cache, NamedDecl got larger.
llvm-svn: 121023
|
|
|
|
|
|
|
|
|
| |
and visibility of declarations, because it was extremely messy and it
increased the size of NamedDecl.
An improved implementation is forthcoming.
llvm-svn: 121012
|
|
|
|
| |
llvm-svn: 120828
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declarations.
The motivation for this patch is that linkage/visibility computations
are linear in the number of redeclarations of an entity, and we've run
into a case where a single translation unit has > 6500 redeclarations
of the same (unused!) external variable. Since each redeclaration
involves a linkage check, the resulting quadratic behavior makes Clang
slow to a crawl. With this change, a simple test with 512
redeclarations of a variable syntax-checks ~20x faster than
before.
That said, I hate this change, and will probably end up reverting it
in a few hours. Reasons to hate it:
- It makes NamedDecl larger, since we don't have enough free bits in
Decl to squeeze in the extra information about caching.
- There are way too many places where we need to invalidate this
cache, because the visibility of a declaration can change due to
redeclarations (!). Despite self-hosting and passing the testsuite,
I have no confidence that I've found all of places where this cache
needs to be invalidated.
llvm-svn: 120808
|
|
|
|
|
|
|
|
|
|
|
| |
A new AST node is introduced:
def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.
llvm-svn: 119919
|
|
|
|
|
|
|
|
|
| |
@synthesize foo = _foo;
keep track of the location of the ivar ("_foo"). Teach libclang to
visit the ivar as a member reference.
llvm-svn: 119447
|
|
|
|
|
|
|
|
| |
avoid leaking memory.
Fixes rdar://8649963.
llvm-svn: 118674
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.
But don't get too excited about that happening now.
llvm-svn: 118385
|
|
|
|
|
|
| |
the performance of C++ PCH and reducing stack depth in the reader.
llvm-svn: 117732
|
|
|
|
|
|
|
|
| |
location before the
first one if the redeclaration comes from a friend decl.
llvm-svn: 117537
|
|
|
|
|
|
| |
chained PCH.
llvm-svn: 117533
|
|
|
|
|
|
|
| |
not loading the specializations of a class template until some AST
consumer needs them.
llvm-svn: 117498
|
|
|
|
|
|
| |
some excessive recursion and deserialization.
llvm-svn: 117480
|
|
|
|
|
|
| |
eliminate some excessive recursion and deserialization.
llvm-svn: 117476
|
|
|
|
|
|
| |
definition was completed.
llvm-svn: 117240
|
|
|
|
|
|
|
|
|
| |
completed.
In that case a chained PCH will record the updates to the DefinitionData pointer of forward references.
If a forward reference mutated into a definition re-write it into the chained PCH, this is too big of a change.
llvm-svn: 117239
|
|
|
|
|
|
|
| |
- Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used.
- Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData.
llvm-svn: 117236
|
|
|
|
|
|
|
|
|
|
|
|
| |
committed after
its initial creation/deserialization and store the changes in a chained PCH.
The idea is that the AST entities call methods on the ASTMutationListener to give notifications
of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes
of the updated entity. WIP
llvm-svn: 117235
|
|
|
|
|
|
|
|
| |
definition data when loaded from PCH.
Temporary disable 'test/PCH/chain-cxx.cpp' until a better way to fix it is in place.
llvm-svn: 117234
|
|
|
|
| |
llvm-svn: 117233
|
|
|
|
|
|
|
|
| |
have the same location
if it's a template specialization pointing at the template.
llvm-svn: 116974
|
|
|
|
| |
llvm-svn: 116930
|
|
|
|
|
|
| |
definition in the chained PCH.
llvm-svn: 116887
|
|
|
|
|
|
|
|
|
| |
declaration block instead of trying to create another block.
The new block was messing with the assumption that after decls block comes the stmts block.
Fixes http://llvm.org/PR8406
llvm-svn: 116737
|
|
|
|
|
|
|
|
| |
by marking the decl invalid isn't. Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.
llvm-svn: 116661
|
|
|
|
|
|
| |
QualifierInfos (rdar://8513756).
llvm-svn: 116598
|
|
|
|
|
|
|
|
| |
complete declaration context in order to compute it.
Progress for rdar://7260160.
llvm-svn: 116508
|
|
|
|
|
|
| |
bit by me).
llvm-svn: 116122
|
|
|
|
| |
llvm-svn: 115667
|
|
|
|
|
|
| |
preamble or main file. Base Decls' PCHLevel on this to make it more sane.
llvm-svn: 115626
|
|
|
|
| |
llvm-svn: 115625
|
|
|
|
|
|
| |
we're missing the corresponding changes in the LLVM repository.
llvm-svn: 115340
|
|
|
|
| |
llvm-svn: 115336
|
|
|
|
|
|
|
|
| |
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.
llvm-svn: 114916
|
|
|
|
|
|
|
|
| |
The canonical FunctionTemplateDecl contains the specializations but we cannot use getCanonicalDecl on Template because it may still be initializing.
Write and read it from PCH.
Fixes http://llvm.org/PR8134
llvm-svn: 113744
|
|
|
|
| |
llvm-svn: 113743
|
|
|
|
| |
llvm-svn: 113742
|
|
|
|
| |
llvm-svn: 113741
|
|
|
|
|
|
|
|
|
| |
Another beating by boost in this test case: http://llvm.org/PR8117
A function specialization wasn't properly initialized if it wasn't canonical.
I wish there was a nice little test case but this was boost.
llvm-svn: 113481
|
|
|
|
| |
llvm-svn: 113413
|
|
|
|
|
|
|
|
|
|
|
| |
PCH got a severe beating by the boost-using test case reported here: http://llvm.org/PR8099
Fix issues like:
-When PCH reading, make sure Decl's getASTContext() doesn't get called since a Decl in the parent hierarchy may be initializing.
-In ASTDeclReader::VisitFunctionDecl VisitRedeclarable should be called before using FunctionDecl's isCanonicalDecl()
-In ASTDeclReader::VisitRedeclarableTemplateDecl CommonOrPrev must be initialized before anything else.
llvm-svn: 113391
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.
Several related changes here:
- Cursor visitation of the three AST nodes for using declarations
- Proper source-range computation for these AST nodes
- Using declarations have no USRs, since they don't actually declare
any entities.
llvm-svn: 112730
|
|
|
|
|
|
|
|
| |
suppressing USRs). Also, fix up the source location information for
using directives so that the declaration location refers to the
namespace name.
llvm-svn: 112693
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols
(and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in
an @interface declaration. 'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced
in both the @interface and class extensions. The latter is needed for semantic analysis/codegen, while the former is
needed to maintain the lexical information of the original source.
Fixes <rdar://problem/8380046>.
llvm-svn: 112691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
aliases. Previously, the location of the alias was at the "namespace"
keyword. Now, it's on the identifier being declared (as is the custom
for Clang), and we keep a separate source location for the "namespace"
keyword.
Also, added a getSourceRange() member function to NamespaceAliasDecl
to correctly compute the source range.
Finally, removed a bunch of setters from NamespaceAliasDecl and gave
ASTReaderDecl friendship so that it could set the corresponding fields
directly.
llvm-svn: 112681
|
|
|
|
|
|
| |
This lets us remove Sema.h's dependency on Expr.h and Decl.h.
llvm-svn: 112156
|