in the AST accessor and micro-optimize it very slightly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150787
91177308-0d34-0410-b5e6-
96231b3b80d8
}
/// getFunctionType - Return the underlying function type for this block.
- const FunctionType *getFunctionType() const;
+ const FunctionProtoType *getFunctionType() const;
static bool classof(const Stmt *T) {
return T->getStmtClass() == BlockExprClass;
/// getFunctionType - Return the underlying function type for this block.
///
-const FunctionType *BlockExpr::getFunctionType() const {
- return getType()->getAs<BlockPointerType>()->
- getPointeeType()->getAs<FunctionType>();
+const FunctionProtoType *BlockExpr::getFunctionType() const {
+ // The block pointer is never sugared, but the function type might be.
+ return cast<BlockPointerType>(getType())
+ ->getPointeeType()->castAs<FunctionProtoType>();
}
SourceLocation BlockExpr::getCaretLocation() const {