[PATCH] D72829: Implement -fsemantic-interposition

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 21 12:05:17 PST 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/IR/Globals.cpp:101
+    return true;
+  return isInterposableLinkage(getLinkage());
+}
----------------
MaskRay wrote:
> MaskRay wrote:
> > Checking `isInterposableLinkage(getLinkage())` first may be more efficient.
> `if (!isInterposableLinkage(getLinkage())) return false;`
```lang=cpp
if (!isInterposableLinkage(getLinkage()))
  return false;
return getParent() && getParent()->getSemanticInterposition() && !isDSOLocal();
```


================
Comment at: llvm/lib/IR/Module.cpp:564
+
+  return cast<ConstantInt>(Val->getValue())->getZExtValue();
+}
----------------
A test/llvm/Verifier/ test checking "SemanticInterposition" must be a ConstantInt will be nice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72829





More information about the cfe-commits mailing list