Skip to content

Commit 7e647b9

Browse files
author
v01dxyz
committed
tmp: getAsAdjusted use getModifiedLoc, replace the loop by a custom one
1 parent d5faa43 commit 7e647b9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

clang/lib/AST/Decl.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3880,7 +3880,19 @@ FunctionTypeLoc FunctionDecl::getFunctionTypeLoc() const {
38803880
if (!TSI)
38813881
return FunctionTypeLoc();
38823882

3883-
return TSI->getTypeLoc().getAsAdjusted<FunctionTypeLoc>();
3883+
TypeLoc TL = TSI->getTypeLoc();
3884+
FunctionTypeLoc FTL;
3885+
3886+
while (!(FTL = TL.getAs<FunctionTypeLoc>())) {
3887+
if (auto PTL = TL.getAs<ParenTypeLoc>())
3888+
TL = PTL.getInnerLoc();
3889+
else if (auto ATL = TL.getAs<AttributedTypeLoc>())
3890+
TL = ATL.getEquivalentTypeLoc();
3891+
else
3892+
break;
3893+
}
3894+
3895+
return FTL;
38843896
}
38853897

38863898
SourceRange FunctionDecl::getReturnTypeSourceRange() const {

0 commit comments

Comments
 (0)