aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/DeclarationFragments.cpp
diff options
context:
space:
mode:
authorErick Velez <erickvelez7@gmail.com>2023-08-22 14:51:23 -0700
committerErick Velez <erickvelez7@gmail.com>2023-08-22 15:00:14 -0700
commite81744563a53b1ed0aaa2cefda885287974a9e21 (patch)
tree6dec7ed62f6e7ccbd973ea4e630132986869d3fc /clang/lib/ExtractAPI/DeclarationFragments.cpp
parent7822e5dbf1cb4be2d73eb13da27b04de684c318b (diff)
downloadllvm-e81744563a53b1ed0aaa2cefda885287974a9e21.zip
llvm-e81744563a53b1ed0aaa2cefda885287974a9e21.tar.gz
llvm-e81744563a53b1ed0aaa2cefda885287974a9e21.tar.bz2
[clang][ExtractAPI] Fix bool spelling coming from the macro definition.
getFragmentsForType resulted in a bool typeIdentifier fragment to be spelled "_Bool". This fixes the spelling to be "bool" and checks it in C and C++. Reviewed By: dang Differential Revision: https://reviews.llvm.org/D158474
Diffstat (limited to 'clang/lib/ExtractAPI/DeclarationFragments.cpp')
-rw-r--r--clang/lib/ExtractAPI/DeclarationFragments.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp
index f1fff6b..3c15d50 100644
--- a/clang/lib/ExtractAPI/DeclarationFragments.cpp
+++ b/clang/lib/ExtractAPI/DeclarationFragments.cpp
@@ -397,6 +397,9 @@ DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForType(
DeclarationFragments QualsFragments = getFragmentsForQualifiers(SQT.Quals),
TypeFragments =
getFragmentsForType(SQT.Ty, Context, After);
+ if (QT.getAsString() == "_Bool")
+ TypeFragments.replace("bool", 0);
+
if (QualsFragments.getFragments().empty())
return TypeFragments;