[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 10 12:07:20 PST 2018


aaron.ballman added inline comments.


================
Comment at: clang/test/Sema/address_space_attribute.cpp:1
+// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
+
----------------
This test should be moved to the AST directory instead of Sema.


================
Comment at: clang/test/Sema/address_space_attribute.cpp:9
+  // CHECK: VarDecl {{.*}} x '__attribute__((address_space(1))) int *'
+  __attribute__((address_space(1))) int *x;
+
----------------
Can you also add a test using the `[[clang::address_space(1)]]` spelling and ensure that it is printed properly?


================
Comment at: clang/tools/libclang/CXType.cpp:132
+      if (!(TU->ParsingOptions & CXTranslationUnit_IncludeAttributedTypes) &&
+          ATT->getAttrKind() != attr::AddressSpace) {
         return MakeCXType(ATT->getModifiedType(), TU);
----------------
This change seems surprising -- if the parsing options say the caller does not want attributed types, why are we returning one anyway for address space?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55447/new/

https://reviews.llvm.org/D55447





More information about the cfe-commits mailing list