[PATCH] D119296: KCFI sanitizer

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 20 14:28:37 PDT 2022


nickdesaulniers added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2255-2260
+  for (const char &C : Name) {
+    if (llvm::isAlnum(C) || C == '_' || C == '.')
+      continue;
+    return false;
+  }
+  return true;
----------------
samitolvanen wrote:
> nickdesaulniers wrote:
> > Is this more concise using `llvm::all_of` from llvm/ADT/STLExtras.h?
> Yes, but also slower. This is the same function that we use in LLVM to check for acceptable promotion alias names (https://reviews.llvm.org/D104058). Should this be moved into a helper function somewhere? If so, where?
Seeing as it was originally based off of MCAsmInfo::isAcceptableChar, perhaps MCAsmInfo or one of its subclasses?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119296



More information about the cfe-commits mailing list