diff options
author | Leonard Chan <leonardchan@google.com> | 2019-05-02 20:38:14 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2019-05-02 20:38:14 +0000 |
commit | fc40cbd9d8c63e65eed3590ba925321afe782e1d (patch) | |
tree | a98067aca61c26511d17adffdc19f7acaeece7ae /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 206bc17ea0f522fa0a5939991796fc3ce814d01d (diff) | |
download | bcm5719-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/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 3656602c3d8..4c43c00cd5e 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2844,6 +2844,9 @@ static QualType UnwrapTypeForDebugInfo(QualType T, const ASTContext &C) { case Type::Paren: T = cast<ParenType>(T)->getInnerType(); break; + case Type::MacroQualified: + T = cast<MacroQualifiedType>(T)->getUnderlyingType(); + break; case Type::SubstTemplateTypeParm: T = cast<SubstTemplateTypeParmType>(T)->getReplacementType(); break; @@ -3023,6 +3026,7 @@ llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) { case Type::DeducedTemplateSpecialization: case Type::Elaborated: case Type::Paren: + case Type::MacroQualified: case Type::SubstTemplateTypeParm: case Type::TypeOfExpr: case Type::TypeOf: |