[llvm-commits] [llvm] r74351 - in /llvm/trunk: include/llvm/Transforms/Utils/Local.h lib/Transforms/Utils/Local.cpp

Devang Patel dpatel at apple.com
Fri Jun 26 15:53:22 PDT 2009


Author: dpatel
Date: Fri Jun 26 17:53:22 2009
New Revision: 74351

URL: http://llvm.org/viewvc/llvm-project?rev=74351&view=rev
Log:
Remove unused routines.

Modified:
    llvm/trunk/include/llvm/Transforms/Utils/Local.h
    llvm/trunk/lib/Transforms/Utils/Local.cpp

Modified: llvm/trunk/include/llvm/Transforms/Utils/Local.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=74351&r1=74350&r2=74351&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/Local.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/Local.h Fri Jun 26 17:53:22 2009
@@ -114,13 +114,6 @@
 bool OnlyUsedByDbgInfoIntrinsics(Instruction *I, 
                            SmallVectorImpl<DbgInfoIntrinsic *> *DbgInUses = 0);
 
-/// UserIsDebugInfo - Return true if U is a constant expr used by 
-/// llvm.dbg.variable or llvm.dbg.global_variable
-bool UserIsDebugInfo(User *U);
-
-/// RemoveDbgInfoUser - Remove an User which is representing debug info.
-void RemoveDbgInfoUser(User *U);
-
 } // End llvm namespace
 
 #endif

Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=74351&r1=74350&r2=74351&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Fri Jun 26 17:53:22 2009
@@ -340,44 +340,3 @@
   return true;
 }
 
-/// UserIsDebugInfo - Return true if U is a constant expr used by 
-/// llvm.dbg.variable or llvm.dbg.global_variable
-bool llvm::UserIsDebugInfo(User *U) {
-  ConstantExpr *CE = dyn_cast<ConstantExpr>(U);
-
-  if (!CE || CE->getNumUses() != 1)
-    return false;
-
-  Constant *Init = dyn_cast<Constant>(CE->use_back());
-  if (!Init || Init->getNumUses() != 1)
-    return false;
-
-  GlobalVariable *GV = dyn_cast<GlobalVariable>(Init->use_back());
-  if (!GV || !GV->hasInitializer() || GV->getInitializer() != Init)
-    return false;
-
-  DIVariable DV(GV);
-  if (!DV.isNull()) 
-    return true; // User is llvm.dbg.variable
-
-  DIGlobalVariable DGV(GV);
-  if (!DGV.isNull())
-    return true; // User is llvm.dbg.global_variable
-
-  return false;
-}
-
-/// RemoveDbgInfoUser - Remove an User which is representing debug info.
-void llvm::RemoveDbgInfoUser(User *U) {
-  assert (UserIsDebugInfo(U) && "Unexpected User!");
-  ConstantExpr *CE = cast<ConstantExpr>(U);
-  while (!CE->use_empty()) {
-    Constant *C = cast<Constant>(CE->use_back());
-    while (!C->use_empty()) {
-      GlobalVariable *GV = cast<GlobalVariable>(C->use_back());
-      GV->eraseFromParent();
-    }
-    C->destroyConstant();
-  }
-  CE->destroyConstant();
-}





More information about the llvm-commits mailing list