[PATCH] D20108: Delete mayBeOverridden

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 08:39:57 PDT 2016


rafael created this revision.
rafael added a reviewer: rnk.
rafael added a subscriber: llvm-commits.

It is the same as isInterposable which seems to be the preferred name.

http://reviews.llvm.org/D20108

Files:
  include/llvm/IR/GlobalValue.h
  lib/Transforms/IPO/FunctionImport.cpp

Index: lib/Transforms/IPO/FunctionImport.cpp
===================================================================
--- lib/Transforms/IPO/FunctionImport.cpp
+++ lib/Transforms/IPO/FunctionImport.cpp
@@ -156,7 +156,7 @@
       CalleeSummaryList,
       [&](const std::unique_ptr<GlobalValueSummary> &SummaryPtr) {
         auto *GVSummary = SummaryPtr.get();
-        if (GlobalValue::isMayBeOverriddenLinkage(GVSummary->linkage()))
+        if (GlobalValue::isInterposableLinkage(GVSummary->linkage()))
           // There is no point in importing these, we can't inline them
           return false;
         if (auto *AS = dyn_cast<AliasSummary>(GVSummary)) {
Index: include/llvm/IR/GlobalValue.h
===================================================================
--- include/llvm/IR/GlobalValue.h
+++ include/llvm/IR/GlobalValue.h
@@ -114,19 +114,12 @@
     case AppendingLinkage:
     case InternalLinkage:
     case PrivateLinkage:
-      return mayBeOverridden();
+      return isInterposable();
     }
 
     llvm_unreachable("Fully covered switch above!");
   }
 
-  /// Whether the definition of this global may be replaced by something
-  /// non-equivalent at link time. For example, if a function has weak linkage
-  /// then the code defining it may be replaced by different code.
-  bool mayBeOverridden() const {
-    return isMayBeOverriddenLinkage(getLinkage());
-  }
-
 protected:
   /// \brief The intrinsic ID for this subclass (which must be a Function).
   ///
@@ -269,7 +262,7 @@
   /// Whether the definition of this global may be replaced by something
   /// non-equivalent at link time. For example, if a function has weak linkage
   /// then the code defining it may be replaced by different code.
-  static bool isMayBeOverriddenLinkage(LinkageTypes Linkage) {
+  static bool isInterposableLinkage(LinkageTypes Linkage) {
     switch (Linkage) {
     case WeakAnyLinkage:
     case LinkOnceAnyLinkage:
@@ -300,7 +293,7 @@
 
   /// Whether the definition of this global may be replaced at link time.  NB:
   /// Using this method outside of the code generators is almost always a
-  /// mistake: when working at the IR level use mayBeOverridden instead as it
+  /// mistake: when working at the IR level use isInterposable instead as it
   /// knows about ODR semantics.
   static bool isWeakForLinker(LinkageTypes Linkage)  {
     return Linkage == WeakAnyLinkage || Linkage == WeakODRLinkage ||
@@ -352,7 +345,7 @@
   /// *arbitrary* definition at link time.  We cannot do any IPO or inlinining
   /// across interposable call edges, since the callee can be replaced with
   /// something arbitrary at link time.
-  bool isInterposable() const { return mayBeOverridden(); }
+  bool isInterposable() const { return isInterposableLinkage(getLinkage()); }
 
   bool hasExternalLinkage() const { return isExternalLinkage(getLinkage()); }
   bool hasAvailableExternallyLinkage() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20108.56724.patch
Type: text/x-patch
Size: 2910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160510/eea8a650/attachment.bin>


More information about the llvm-commits mailing list