]> granicus.if.org Git - clang/commit
[Attribute/Diagnostics] Print macro if definition is an attribute declaration
authorLeonard Chan <leonardchan@google.com>
Thu, 2 May 2019 20:38:14 +0000 (20:38 +0000)
committerLeonard Chan <leonardchan@google.com>
Thu, 2 May 2019 20:38:14 +0000 (20:38 +0000)
commitfae4e4715c9bc8ceb9b3714d5c08813363890b7f
tree8994356a0cce2feee0f0cd07cc2ebc180c7fe81c
parentc1150d547616902e07d68c5b51f466bac8ff1883
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359826 91177308-0d34-0410-b5e6-96231b3b80d8
33 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/AST/Type.h
include/clang/AST/TypeLoc.h
include/clang/AST/TypeNodes.def
include/clang/Parse/Parser.h
include/clang/Sema/ParsedAttr.h
include/clang/Sema/Sema.h
include/clang/Serialization/ASTBitCodes.h
lib/ARCMigrate/TransGCAttrs.cpp
lib/AST/ASTContext.cpp
lib/AST/ASTDiagnostic.cpp
lib/AST/ASTStructuralEquivalence.cpp
lib/AST/ItaniumMangle.cpp
lib/AST/Type.cpp
lib/AST/TypePrinter.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/Parse/ParseDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaStmt.cpp
lib/Sema/SemaType.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/Frontend/macro_defined_type.cpp [new file with mode: 0644]
test/Sema/address_space_print_macro.c [new file with mode: 0644]
test/Sema/address_spaces.c
test/SemaObjC/externally-retained.m
test/SemaObjC/gc-attributes.m
test/SemaObjC/mrc-weak.m
test/SemaObjCXX/gc-attributes.mm
tools/libclang/CIndex.cpp