[PATCH] D11857: CFI: Introduce -fsanitize=cfi-icall flag.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 8 17:40:21 PDT 2015


rsmith added a comment.

This seems to have a lot of overlap with the function sanitizer. The documentation would probably benefit from some advice about when to use each and how they compare.


================
Comment at: lib/AST/ItaniumMangle.cpp:4119-4126
@@ +4118,10 @@
+                                                    raw_ostream &Out) {
+  if (!isExternallyVisible(FT->getLinkage())) {
+    // This part of the identifier needs to be unique across all translation
+    // units in the linked program. The scheme fails if multiple translation
+    // units are compiled using the same relative source file path, or if
+    // multiple translation units are built from the same source file.
+    SourceManager &SM = getASTContext().getSourceManager();
+    Out << "[" << SM.getFileEntryForID(SM.getMainFileID())->getName() << "]";
+  }
+
----------------
:( Making up a name here seems like it should not be necessary. Could you use a named metadata node with no name as the key for your bitset? (Weird as it is, that seems to be our representation for "internal linkage" metadata.)


http://reviews.llvm.org/D11857





More information about the cfe-commits mailing list