linear -> constant time
authorAndrew Lenharth <andrewl@lenharth.org>
Thu, 13 Apr 2006 13:43:31 +0000 (13:43 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Thu, 13 Apr 2006 13:43:31 +0000 (13:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27652 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/IndMemRemoval.cpp

index 84a43072289b01d418b8f9c41228c36200e9e78a..b5d0195a298c5c4cc838f05d0fd0eed55fb903b3 100644 (file)
@@ -51,11 +51,11 @@ bool IndMemRemPass::runOnModule(Module &M) {
   //to intrinsics.  Therefor, this goes through and finds where the
   //address of free or malloc are taken and replaces those with bounce
   //functions, ensuring that all malloc and free that might happen
-  //happens through intrinsics.
+  //happen through intrinsics.
   bool changed = false;
   if (Function* F = M.getNamedFunction("free")) {
     assert(F->isExternal() && "free not external?");
-    if (F->getNumUses()) {
+    if (!F->use_empty()) {
       Function* FN = new Function(F->getFunctionType(), 
                                  GlobalValue::LinkOnceLinkage, 
                                  "free_llvm_bounce", &M);
@@ -70,7 +70,7 @@ bool IndMemRemPass::runOnModule(Module &M) {
   }
   if (Function* F = M.getNamedFunction("malloc")) {
     assert(F->isExternal() && "malloc not external?");
-    if (F->getNumUses()) {
+    if (!F->use_empty()) {
       Function* FN = new Function(F->getFunctionType(), 
                                  GlobalValue::LinkOnceLinkage, 
                                  "malloc_llvm_bounce", &M);