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

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 15:01:51 PDT 2015


pcc added a comment.

> The documentation would probably benefit from some advice about when to use each and how they compare.


Added.


================
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() << "]";
+  }
+
----------------
rsmith wrote:
> :( 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.)
Done. This also required some improvements to the bitset lowering pass (D11857) to permit non-string bitset identifiers.


http://reviews.llvm.org/D11857





More information about the cfe-commits mailing list