summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndex.cpp
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2019-05-02 20:38:14 +0000
committerLeonard Chan <leonardchan@google.com>2019-05-02 20:38:14 +0000
commitfc40cbd9d8c63e65eed3590ba925321afe782e1d (patch)
treea98067aca61c26511d17adffdc19f7acaeece7ae /clang/tools/libclang/CIndex.cpp
parent206bc17ea0f522fa0a5939991796fc3ce814d01d (diff)
downloadbcm5719-llvm-fc40cbd9d8c63e65eed3590ba925321afe782e1d.tar.gz
bcm5719-llvm-fc40cbd9d8c63e65eed3590ba925321afe782e1d.zip
[Attribute/Diagnostics] Print macro if definition is an attribute declaration
If an address_space attribute is defined in a macro, print the macro instead when diagnosing a warning or error for incompatible pointers with different address_spaces. We allow this for all attributes (not just address_space), and for multiple attributes declared in the same macro. Differential Revision: https://reviews.llvm.org/D51329 llvm-svn: 359826
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r--clang/tools/libclang/CIndex.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index a5a8998f613..1144ec64f58 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -1614,6 +1614,10 @@ bool CursorVisitor::VisitParenTypeLoc(ParenTypeLoc TL) {
return Visit(TL.getInnerLoc());
}
+bool CursorVisitor::VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc TL) {
+ return Visit(TL.getInnerLoc());
+}
+
bool CursorVisitor::VisitPointerTypeLoc(PointerTypeLoc TL) {
return Visit(TL.getPointeeLoc());
}
OpenPOWER on IntegriCloud