| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.
llvm-svn: 78645
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes PR4704 problems
Addresses Eli's patch feedback re: ugly cast code
Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.
llvm-svn: 78621
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp
llvm-svn: 78551
|
|
|
|
|
|
|
|
| |
In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.
llvm-svn: 78535
|
|
|
|
| |
llvm-svn: 78452
|
|
|
|
|
|
|
| |
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.
llvm-svn: 78450
|
|
|
|
|
|
|
|
| |
this->Base::foo
from James Porter!
llvm-svn: 78278
|
|
|
|
|
|
| |
expressions and a test case.
llvm-svn: 78213
|
|
|
|
|
|
| |
obviously correct.
llvm-svn: 77969
|
|
|
|
|
|
| |
will be :)
llvm-svn: 77650
|
|
|
|
|
|
|
|
|
| |
A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.
llvm-svn: 77488
|
|
|
|
|
|
|
|
| |
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).
Still need back-end CodeGen for ObjCIsaExpr.
llvm-svn: 76979
|
|
|
|
|
|
| |
pass it when instantiating the expr. Fixes another member pointer bug.
llvm-svn: 75075
|
|
|
|
|
|
|
| |
are fewer template arguments than there are template parameters for
that function.
llvm-svn: 74578
|
|
|
|
|
|
|
| |
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.
llvm-svn: 74563
|
|
|
|
|
|
|
|
|
|
|
| |
"semantic analysis" part. Use the "semantic analysis" part when
performing template instantiation on a DeclRefExpr, rather than an ad
hoc list of rules to construct DeclRefExprs from the instantiation.
A test case for this change will come in with a large commit, which
illustrates what I was actually trying to work on.
llvm-svn: 74528
|
|
|
|
|
|
|
| |
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.
llvm-svn: 74506
|
|
|
|
| |
llvm-svn: 74257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates.
For example, this now type-checks (but does not instantiate the body
of deref<int>):
template<typename T> T& deref(T* t) { return *t; }
void test(int *ip) {
int &ir = deref(ip);
}
Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.
llvm-svn: 74213
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compilation, and (hopefully) introduce RAII objects for changing the
"potentially evaluated" state at all of the necessary places within
Sema and Parser. Other changes:
- Set the unevaluated/potentially-evaluated context appropriately
during template instantiation.
- We now recognize three different states while parsing or
instantiating expressions: unevaluated, potentially evaluated, and
potentially potentially evaluated (for C++'s typeid).
- When we're in a potentially potentially-evaluated context, queue
up MarkDeclarationReferenced calls in a stack. For C++ typeid
expressions that are potentially evaluated, we will play back
these MarkDeclarationReferenced calls when we exit the
corresponding potentially potentially-evaluated context.
- Non-type template arguments are now parsed as constant
expressions, so they are not potentially-evaluated.
llvm-svn: 73899
|
|
|
|
| |
llvm-svn: 73462
|
|
|
|
|
|
| |
template partial specializations.
llvm-svn: 73254
|
|
|
|
|
|
| |
and @protocol expressions.
llvm-svn: 73036
|
|
|
|
| |
llvm-svn: 73034
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Once we have deduced template arguments for a class template partial
specialization, we use exactly those template arguments for instantiating
the definition of the class template partial specialization.
- Added template argument deduction for non-type template parameters.
- Added template argument deduction for dependently-sized array types.
With these changes, we can now implement, e.g., the remove_reference
type trait. Also, Daniel's Ackermann template metaprogram now compiles
properly.
llvm-svn: 72909
|
|
|
|
| |
llvm-svn: 72633
|
|
|
|
| |
llvm-svn: 72632
|
|
|
|
| |
llvm-svn: 72627
|
|
|
|
|
|
|
| |
template instantiation. This helps reduce our stack footprint when
performing deep template instantiations.
llvm-svn: 72582
|
|
|
|
|
|
|
|
|
|
|
| |
declaration references. The key realization is that dependent Decls,
which actually require instantiation, can only refer to the current
instantiation or members thereof. And, since the current context
during instantiation contains all of those members of the current
instantiation, we can simply find the real instantiate that matches up
with the "current instantiation" template.
llvm-svn: 72486
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
references. There are several smallish fixes here:
- Make sure we look through template parameter scope when
determining whether we're parsing a nested class (or nested class
*template*). This makes sure that we delay parsing the bodies of
inline member functions until after we're out of the outermost
class (template) scope.
- Since the bodies of member functions are always parsed
"out-of-line", even when they were declared in-line, teach
unqualified name lookup to look into the (semantic) parents.
- Use the new InstantiateDeclRef to handle the instantiation of a
reference to a declaration (in DeclRefExpr), which drastically
simplifies template instantiation for DeclRefExprs.
- When we're instantiating a ParmVarDecl, it must be in the current
instantiation scope, so only look there.
Also, remove the #if 0's and FIXME's from the dynarray example, which
now compiles and executes thanks to Anders and Eli.
llvm-svn: 72481
|
|
|
|
|
|
|
|
|
|
|
|
| |
instantiation of a declaration from the template version (or version
that lives in a template) and a given set of template arguments. This
needs much, much more testing, but it suffices for simple examples
like
typedef T* iterator;
iterator begin();
llvm-svn: 72461
|
|
|
|
| |
llvm-svn: 72440
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expressions. We are now missing template instantiation logic for only
three classes of expressions:
- Blocks-related expressions (BlockExpr, BlockDeclRefExpr)
- C++ default argument expressions
- Objective-C expressions
Additionally, our handling of DeclRefExpr is still quite poor, since
it cannot handle references to many kinds of declarations.
As part of this change, converted the TemplateExprInstantiator to use
iteration through all of the expressions via clang/AST/StmtNodes.def,
ensuring that we don't forget to add template instantiation logic for
any new expression node kinds.
llvm-svn: 72303
|
|
|
|
| |
llvm-svn: 72301
|
|
|
|
| |
llvm-svn: 72299
|
|
|
|
|
|
|
| |
call other member functions of class templates, including after
template instantiation. No functionality change.
llvm-svn: 72282
|
|
|
|
|
|
|
|
|
|
|
|
| |
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.
Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.
llvm-svn: 72281
|
|
|
|
| |
llvm-svn: 72236
|
|
|
|
| |
llvm-svn: 72234
|
|
|
|
|
|
|
|
| |
can. Also, delay semantic analysis of initialization for
value-dependent as well as type-dependent expressions, since we can't
always properly type-check a value-dependent expression.
llvm-svn: 72233
|
|
|
|
| |
llvm-svn: 72229
|
|
|
|
| |
llvm-svn: 72220
|
|
|
|
| |
llvm-svn: 72218
|
|
|
|
| |
llvm-svn: 72217
|
|
|
|
| |
llvm-svn: 72216
|
|
|
|
|
|
|
|
| |
redundant functionality. The result (ASTOwningVector) lives in
clang/Parse/Ownership.h and is used by both the parser and semantic
analysis. No intended functionality change.
llvm-svn: 72214
|
|
|
|
| |
llvm-svn: 72199
|
|
|
|
|
|
|
| |
passes the "isStmtExpr" flag, to suppress warnings about unused
expressions.
llvm-svn: 72190
|
|
|
|
|
|
|
|
| |
llvm::SmallVector that owns all of the AST nodes inside of it. This
RAII class is used to ensure proper destruction of AST nodes when
template instantiation fails.
llvm-svn: 72186
|