[PATCH] D46665: [Itanium] Emit type info names with external linkage.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 9 17:05:55 PDT 2018


rsmith added inline comments.


================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:3033
+      return {llvm::GlobalValue::InternalLinkage,
+              llvm::GlobalValue::LinkOnceODRLinkage};
+    return {llvm::GlobalValue::InternalLinkage,
----------------
Shouldn't this be based on the type's linkage? Eg:

```
namespace { struct Incomplete; }
auto x = typeid(Incomplete*);
```

should have an `internal` type info name, not a `linkonce_odr` name. I think we should compute the linkage per the code below and then demote the type's linkage to internal in the incomplete-class case.


================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:3034-3035
+              llvm::GlobalValue::LinkOnceODRLinkage};
+    return {llvm::GlobalValue::InternalLinkage,
+            llvm::GlobalValue::InternalLinkage};
+  }
----------------
Should we promote the type info name in this case too? (We get here for the incomplete-class type info we generate as a detail of the pointer type info, but the names of such types are accessible via the <cxx_abi.h> interface, so it seems reasonable to apply the same global-uniqueness to them too.)


https://reviews.llvm.org/D46665





More information about the cfe-commits mailing list