[PATCH] D71486: [clang-tools-extra] Fix switch coverage warning

Eric Christopher via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 13 12:23:59 PST 2019


echristo created this revision.
echristo added reviewers: Anastasia, sammccall.
echristo added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, mcrosier.
Herald added a project: clang.
echristo added a subscriber: rdhindsa.

... I think this is right?

Add support in the switch statement for addr spaces. I couldn't get a magical API combination to get just the address space off the top of my head, but wanted to get this out.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71486

Files:
  clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp


Index: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
===================================================================
--- clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -521,6 +521,10 @@
     case clang::DiagnosticsEngine::ak_attr:
       Builder << reinterpret_cast<Attr *>(Info.getRawArg(Index));
       break;
+    case clang::DiagnosticsEngine::ak_addrspace:
+      Builder << Qualifiers::getAddrSpaceAsString(
+          *reinterpret_cast<LangAS *>(Info.getRawArg(Index)));
+      break;
     }
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71486.233846.patch
Type: text/x-patch
Size: 608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191213/f7d860c9/attachment.bin>


More information about the cfe-commits mailing list