Changeset View
Changeset View
Standalone View
Standalone View
lib/AST/Decl.cpp
Context not available. | |||||
return RTRange; | return RTRange; | ||||
} | } | ||||
SourceRange FunctionDecl::getExceptionSpecSourceRange() const { | |||||
const TypeSourceInfo *TSI = getTypeSourceInfo(); | |||||
if (!TSI) | |||||
return SourceRange(); | |||||
FunctionTypeLoc FTL = | |||||
TSI->getTypeLoc().IgnoreParens().getAs<FunctionTypeLoc>(); | |||||
if (!FTL) | |||||
return SourceRange(); | |||||
return FTL.getExceptionSpecRange(); | |||||
} | |||||
rsmith: Can you factor out a function to get the `FunctionTypeLoc` from a `FunctionDecl`, when there is… | |||||
Not Done ReplyInline ActionsYup, I can do that. aaron.ballman: Yup, I can do that. | |||||
const Attr *FunctionDecl::getUnusedResultAttr() const { | const Attr *FunctionDecl::getUnusedResultAttr() const { | ||||
QualType RetType = getReturnType(); | QualType RetType = getReturnType(); | ||||
if (RetType->isRecordType()) { | if (RetType->isRecordType()) { | ||||
Context not available. |
Can you factor out a function to get the FunctionTypeLoc from a FunctionDecl, when there is one (preferably as a separate change)? This is duplicated in a few places now (you can find some more by searching for getAs<FunctionProtoTypeLoc> in Sema), and looks slightly wrong here (we should skip calling convention attributes as well as parens).