[llvm] r269204 - [NFC] Remove some dead code:

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 09:38:40 PDT 2016


Author: filcab
Date: Wed May 11 11:38:40 2016
New Revision: 269204

URL: http://llvm.org/viewvc/llvm-project?rev=269204&view=rev
Log:
[NFC] Remove some dead code:

DbgInfoIntrinsic::StripCast() is dead since r79977
The only function that creates Comdat objects seems to be in Module, and always creates them using the default constructor.

Modified:
    llvm/trunk/include/llvm/IR/Comdat.h
    llvm/trunk/include/llvm/IR/IntrinsicInst.h
    llvm/trunk/lib/IR/Comdat.cpp
    llvm/trunk/lib/IR/IntrinsicInst.cpp

Modified: llvm/trunk/include/llvm/IR/Comdat.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Comdat.h?rev=269204&r1=269203&r2=269204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Comdat.h (original)
+++ llvm/trunk/include/llvm/IR/Comdat.h Wed May 11 11:38:40 2016
@@ -46,7 +46,6 @@ public:
 private:
   friend class Module;
   Comdat();
-  Comdat(SelectionKind SK, StringMapEntry<Comdat> *Name);
   Comdat(const Comdat &) = delete;
 
   // Points to the map in Module.

Modified: llvm/trunk/include/llvm/IR/IntrinsicInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IntrinsicInst.h?rev=269204&r1=269203&r2=269204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IntrinsicInst.h (original)
+++ llvm/trunk/include/llvm/IR/IntrinsicInst.h Wed May 11 11:38:40 2016
@@ -75,8 +75,6 @@ namespace llvm {
     static inline bool classof(const Value *V) {
       return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
     }
-
-    static Value *StripCast(Value *C);
   };
 
   /// This represents the llvm.dbg.declare instruction.

Modified: llvm/trunk/lib/IR/Comdat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Comdat.cpp?rev=269204&r1=269203&r2=269204&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Comdat.cpp (original)
+++ llvm/trunk/lib/IR/Comdat.cpp Wed May 11 11:38:40 2016
@@ -15,9 +15,6 @@
 #include "llvm/ADT/StringMap.h"
 using namespace llvm;
 
-Comdat::Comdat(SelectionKind SK, StringMapEntry<Comdat> *Name)
-    : Name(Name), SK(SK) {}
-
 Comdat::Comdat(Comdat &&C) : Name(C.Name), SK(C.SK) {}
 
 Comdat::Comdat() : Name(nullptr), SK(Comdat::Any) {}

Modified: llvm/trunk/lib/IR/IntrinsicInst.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/IntrinsicInst.cpp?rev=269204&r1=269203&r2=269204&view=diff
==============================================================================
--- llvm/trunk/lib/IR/IntrinsicInst.cpp (original)
+++ llvm/trunk/lib/IR/IntrinsicInst.cpp Wed May 11 11:38:40 2016
@@ -32,24 +32,6 @@ using namespace llvm;
 /// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
 ///
 
-static Value *CastOperand(Value *C) {
-  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
-    if (CE->isCast())
-      return CE->getOperand(0);
-  return nullptr;
-}
-
-Value *DbgInfoIntrinsic::StripCast(Value *C) {
-  if (Value *CO = CastOperand(C)) {
-    C = StripCast(CO);
-  } else if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
-    if (GV->hasInitializer())
-      if (Value *CO = CastOperand(GV->getInitializer()))
-        C = StripCast(CO);
-  }
-  return dyn_cast<GlobalVariable>(C);
-}
-
 Value *DbgInfoIntrinsic::getVariableLocation(bool AllowNullOp) const {
   Value *Op = getArgOperand(0);
   if (AllowNullOp && !Op)




More information about the llvm-commits mailing list