[PATCH] D126100: Add sanitizer-specific GlobalValue attributes.

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 3 19:19:30 PDT 2022


vitalybuka added inline comments.


================
Comment at: llvm/include/llvm/AsmParser/LLToken.h:181
 #define GET_ATTR_NAMES
 #define ATTRIBUTE_ENUM(ENUM_NAME, DISPLAY_NAME) \
   kw_##DISPLAY_NAME,
----------------
Have you considered in Attributes.inc ?

/// Can be used as global attribute.
def GvAttr : AttrProperty;


================
Comment at: llvm/include/llvm/IR/GlobalValue.h:329
+    }
+    void deserialize(unsigned V) {
+      if (V & (1 << 0)) NoSanitize = true;
----------------
serialization should not be in this header, this bit stuff is /Bitcode/ specific, both should be there


================
Comment at: llvm/lib/AsmParser/LLLexer.cpp:583
 
+  // Sanitizer keywords.
+  KEYWORD(no_sanitize);
----------------
redundant comment, obvious from the name


================
Comment at: llvm/lib/IR/AsmWriter.cpp:3540
 
+  using SanitizerMetadata = llvm::GlobalValue::SanitizerMetadata;
+  if (GV->hasSanitizerMetadata()) {
----------------
AsmWriter/Parser should be tested in llvm-project/llvm/test/Assembler/
e.g. Assembler/diglobalvariable.ll


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126100



More information about the cfe-commits mailing list