aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-26 03:43:08 +0000
committerChris Lattner <sabre@nondot.org>2004-02-26 03:43:08 +0000
commit1fe9874d1545490a230d6ca3b25e6dfb4c2a9b55 (patch)
tree6a126aca99977f8afd347c4f4ca9b534934a5548 /lib/Analysis/DataStructure/Local.cpp
parentf74a401f613bef9a147d4ce960634f0059b391dc (diff)
Add _more_ functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 6f9bc73510..6760c3704d 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -495,6 +495,15 @@ void GraphBuilder::visitCallSite(CallSite CS) {
if (DSNode *N = RetNH.getNode())
N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker();
return;
+ } else if (F->getName() == "memmove") {
+ // Merge the first & second arguments, and mark the memory read and
+ // modified.
+ DSNodeHandle RetNH = getValueDest(**CS.arg_begin());
+ RetNH.mergeWith(getValueDest(**(CS.arg_begin()+1)));
+ if (DSNode *N = RetNH.getNode())
+ N->setModifiedMarker()->setReadMarker();
+ return;
+
} else if (F->getName() == "atoi" || F->getName() == "atof" ||
F->getName() == "atol" || F->getName() == "atoll" ||
F->getName() == "remove" || F->getName() == "unlink" ||
@@ -753,12 +762,20 @@ void GraphBuilder::visitCallSite(CallSite CS) {
N->mergeTypeInfo(PTy->getElementType(), H.getOffset());
}
return;
- } else if (F->getName() == "strchr" || F->getName() == "strrchr") {
- // These read their first argument, and return it.
+ } else if (F->getName() == "strchr" || F->getName() == "strrchr" ||
+ F->getName() == "strstr") {
+ // These read their arguments, and return the first one
DSNodeHandle H = getValueDest(**CS.arg_begin());
+ H.mergeWith(getValueDest(*CS.getInstruction())); // Returns buffer
+
+ 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();
+
if (DSNode *N = H.getNode())
N->setReadMarker();
- H.mergeWith(getValueDest(*CS.getInstruction())); // Returns buffer
return;
} else if (F->getName() == "modf" && CS.arg_end()-CS.arg_begin() == 2) {
// This writes its second argument, and forces it to double.