From 9ccb1af08f0f55050f873cb0d08be311ac226d26 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 24 Feb 2004 22:17:00 +0000 Subject: [PATCH] Add support for 'rename' llvm-svn: 11813 --- llvm/lib/Analysis/DataStructure/Local.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index 52e588bf2857..681b61f67ba7 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/lib/Analysis/DataStructure/Local.cpp @@ -484,10 +484,15 @@ void GraphBuilder::visitCallSite(CallSite CS) { N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker(); return; } else if (F->getName() == "atoi" || F->getName() == "atof" || - F->getName() == "remove") { - // atoi reads its argument. - if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) - N->setReadMarker(); + F->getName() == "remove" || F->getName() == "unlink" || + F->getName() == "rename") { + // These functions read all of their pointer operands. + for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); + AI != E; ++AI) { + if (isPointerType((*AI)->getType())) + if (DSNode *N = getValueDest(**AI).getNode()) + N->setReadMarker(); + } return; } else if (F->getName() == "fopen" && CS.arg_end()-CS.arg_begin() == 2){