rsmith added inline comments.

================
Comment at: lib/AST/TypePrinter.cpp:1430-1431
 
+  if (T->getAttrKind() == attr::AddressSpace)
+    return;
+
----------------
Please justify why this is appropriate with a comment.


================
Comment at: lib/AST/TypePrinter.cpp:1501-1502
+
+  case attr::AddressSpace:
+    llvm_unreachable("Printing of address_space is handled by the qualifier");
   }
----------------
Just add this to the list starting on line 1450.


================
Comment at: lib/Sema/SemaType.cpp:7287-7294
+      if (attr.getKind() == ParsedAttr::AT_AddressSpace &&
+          !type->getAs<DependentAddressSpaceType>()) {
+        ASTContext &Ctx = state.getSema().Context;
+        auto *ASAttr = ::new (Ctx) AddressSpaceAttr(
+            attr.getRange(), Ctx, attr.getAttributeSpellingListIndex(),
+            static_cast<unsigned>(type.getQualifiers().getAddressSpace()));
+        type = state.getAttributedType(ASAttr, type, type);
----------------
This should be done in `HandleAddressSpaceTypeAttribute`, not here.


Repository:
  rC Clang

https://reviews.llvm.org/D51229



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to