]> granicus.if.org Git - clang/commit
Introduce and use Decl::getAsFunction() to simplify templated function checks
authorAlp Toker <alp@nuanti.com>
Wed, 22 Jan 2014 07:29:52 +0000 (07:29 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 22 Jan 2014 07:29:52 +0000 (07:29 +0000)
commit296a4e54995407cf7e3602b29d28ffd001d15e23
treed39e4e5fb8f8dfa316fdb3e4da74073fb4f1fedb
parent8a4d3a8337a6c91f2ae6613f67caff9e04d45811
Introduce and use Decl::getAsFunction() to simplify templated function checks

Lift the getFunctionDecl() utility out of the parser into a general
Decl::getAsFunction() and use it to simplify other parts of the implementation.

Reduce isFunctionOrFunctionTemplate() to a simple type check that works the
same was as the other is* functions and move unwrapping of shadowed decls to
callers so it doesn't get run twice.

Shuffle around canSkipFunctionBody() to reduce virtual dispatch on ASTConsumer.
There's no need to query when we already know the body can't be skipped.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199794 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/AST/Decl.h
include/clang/AST/DeclBase.h
lib/AST/Decl.cpp
lib/AST/DeclBase.cpp
lib/AST/DeclCXX.cpp
lib/AST/ExprCXX.cpp
lib/Parse/ParseCXXInlineMethods.cpp
lib/Parse/ParseTemplate.cpp
lib/Parse/Parser.cpp
lib/Sema/SemaAccess.cpp
lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaOverload.cpp
tools/libclang/CIndex.cpp