aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateStmt.cpp
AgeCommit message (Collapse)Author
2009-08-20Refactor the instantiation of statements into a generic treeDouglas Gregor
transformation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis
interfaces. DeclaratorDecl contains a DeclaratorInfo* to keep type source info. Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl. EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo. Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap ↵Anders Carlsson
the return expr inside a CXXExprWithTemporaries if needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08Get rid of Stmt::Clone now that we can reference count statements instead.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-22Rework the way we track which declarations are "used" duringDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12add the location of the ')' in a do/while statement to DoStmt.Chris Lattner
This fixes a source range problem reported by Olaf Krzikalla. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04Make sure to call FullExpr before parsing anything else.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30ActOnReturnStmt should also take a FullExprArg.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-29Reduce the amount of stack space we use in SmallVectors duringDouglas Gregor
template instantiation. This helps reduce our stack footprint when performing deep template instantiations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-27Reimplement much of the way that we track nested classes in theDouglas Gregor
parser. Rather than placing all of the delayed member function declarations and inline definitions into a single bucket corresponding to the top-level class, we instead mirror the nesting structure of the nested classes and place the delayed member functions into their appropriate place. Then, when we actually parse the delayed member function declarations, set up the scope stack the same way as it was when we originally saw the declaration, so that we can find, e.g., template parameters that are in scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-21Merge the ASTVector and ASTOwningVector templates, since they offeredDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20Fix template instantiation for compound statements so that it properlyDouglas Gregor
passes the "isStmtExpr" flag, to suppress warnings about unused expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20Introduce a new kind of RAII class, ASTOwningVector, which is anDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18Template instantiation for C++ try/catch statements.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18Include StmtNodes.def to declare Visit methods for all of the knownDouglas Gregor
kinds of statements (in the instantiation logic). No functionality change, but now we'll get linker errors if we add a statement but forget to introduce its instantiation logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-17Make ActOnWhileStmt take a FullExprArg for the condition expr.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-17Fix DISABLE_SMART_POINTERS build.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-17Add the FullExprArg wrapper and use it for if statement conditions.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-16Reflow some comments.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-16Template instantiation for IndirectGotoStmt. Now my life is complete.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Template instantiation for switch statementsDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Template instantiation for break and continue statements.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Template instantiation for "for" loopsDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Template instantiation for do-while statements.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Template instantiation for WhileStmt and CXXConditionDeclExpr.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Allow instantiation of NULL expressions and statementsDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15I take it back, InstantiateExpr does not check for null.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15No need to null check the expr, Sema::SemaRef.InstantiateExpr handles all that.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Template instantiation for "if" statements. Also:Douglas Gregor
- Skip semantic analysis of the "if" condition if it is type-dependent. - Added the location of the "else" keyword into IfStmt, so that we can provide it for type-checking after template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Move statement instantiation into its own file. No functionality changeDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71872 91177308-0d34-0410-b5e6-96231b3b80d8