[llvm] r269150 - Delete mayBeOverridden.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 18:26:07 PDT 2016


Author: rafael
Date: Tue May 10 20:26:06 2016
New Revision: 269150

URL: http://llvm.org/viewvc/llvm-project?rev=269150&view=rev
Log:
Delete mayBeOverridden.

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

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

Modified: llvm/trunk/include/llvm/IR/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/GlobalValue.h?rev=269150&r1=269149&r2=269150&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/IR/GlobalValue.h Tue May 10 20:26:06 2016
@@ -114,19 +114,12 @@ private:
     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 @@ public:
   /// 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 @@ public:
 
   /// 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 @@ public:
   /// *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 {

Modified: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp?rev=269150&r1=269149&r2=269150&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp Tue May 10 20:26:06 2016
@@ -156,7 +156,7 @@ selectCallee(const ModuleSummaryIndex &I
       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)) {




More information about the llvm-commits mailing list