Skip to content

Commit 92cf71f

Browse files
author
Andrew Lenharth
committed
linear -> constant time
llvm-svn: 27652
1 parent 9857229 commit 92cf71f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/IPO/IndMemRemoval.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ bool IndMemRemPass::runOnModule(Module &M) {
5151
//to intrinsics. Therefor, this goes through and finds where the
5252
//address of free or malloc are taken and replaces those with bounce
5353
//functions, ensuring that all malloc and free that might happen
54-
//happens through intrinsics.
54+
//happen through intrinsics.
5555
bool changed = false;
5656
if (Function* F = M.getNamedFunction("free")) {
5757
assert(F->isExternal() && "free not external?");
58-
if (F->getNumUses()) {
58+
if (!F->use_empty()) {
5959
Function* FN = new Function(F->getFunctionType(),
6060
GlobalValue::LinkOnceLinkage,
6161
"free_llvm_bounce", &M);
@@ -70,7 +70,7 @@ bool IndMemRemPass::runOnModule(Module &M) {
7070
}
7171
if (Function* F = M.getNamedFunction("malloc")) {
7272
assert(F->isExternal() && "malloc not external?");
73-
if (F->getNumUses()) {
73+
if (!F->use_empty()) {
7474
Function* FN = new Function(F->getFunctionType(),
7575
GlobalValue::LinkOnceLinkage,
7676
"malloc_llvm_bounce", &M);

0 commit comments

Comments
 (0)