summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-06-28 01:16:06 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-06-28 01:16:06 +0000
commit5b10cfcc39fa1768cf75356d37fe4b0cb4e75b7b (patch)
tree2457a79f0a89e3009018a2ae04da2758886bfe44 /llvm/lib/Analysis/DataStructure
parentebfa24ee9a9e1bef1eaf10573127ae8a25f7bd80 (diff)
downloadbcm5719-llvm-5b10cfcc39fa1768cf75356d37fe4b0cb4e75b7b.tar.gz
bcm5719-llvm-5b10cfcc39fa1768cf75356d37fe4b0cb4e75b7b.zip
add some missing externals
llvm-svn: 28955
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index 22dd2394ace..ecf953230dd 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/lib/Analysis/DataStructure/Local.cpp
@@ -591,6 +591,8 @@ void GraphBuilder::visitCallSite(CallSite CS) {
}
}
+ //gets select localtime ioctl
+
if ((F->isExternal() && F->getName() == "calloc")
|| F->getName() == "posix_memalign"
|| F->getName() == "memalign" || F->getName() == "valloc") {
@@ -627,7 +629,8 @@ void GraphBuilder::visitCallSite(CallSite CS) {
F->getName() == "puts" || F->getName() == "write" ||
F->getName() == "open" || F->getName() == "create" ||
F->getName() == "truncate" || F->getName() == "chdir" ||
- F->getName() == "mkdir" || F->getName() == "rmdir") {
+ F->getName() == "mkdir" || F->getName() == "rmdir" ||
+ F->getName() == "strlen") {
// These functions read all of their pointer operands.
for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
AI != E; ++AI) {
@@ -636,7 +639,7 @@ void GraphBuilder::visitCallSite(CallSite CS) {
N->setReadMarker();
}
return;
- } else if (F->getName() == "memchr") {
+ } else if (F->getName() == "memchr") {
DSNodeHandle RetNH = getValueDest(**CS.arg_begin());
DSNodeHandle Result = getValueDest(*CS.getInstruction());
RetNH.mergeWith(Result);
@@ -644,7 +647,8 @@ void GraphBuilder::visitCallSite(CallSite CS) {
N->setReadMarker();
return;
} else if (F->getName() == "read" || F->getName() == "pipe" ||
- F->getName() == "wait" || F->getName() == "time") {
+ F->getName() == "wait" || F->getName() == "time" ||
+ F->getName() == "getrusage") {
// These functions write all of their pointer operands.
for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
AI != E; ++AI) {
@@ -1002,6 +1006,17 @@ void GraphBuilder::visitCallSite(CallSite CS) {
if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode())
N->setReadMarker();
return;
+ } else if (F->getName() == "strcpy" || F->getName() == "strncpy") {
+ //This might be making unsafe assumptions about usage
+ //Merge return and first arg
+ DSNodeHandle RetNH = getValueDest(*CS.getInstruction());
+ RetNH.mergeWith(getValueDest(**CS.arg_begin()));
+ if (DSNode *N = RetNH.getNode())
+ N->setHeapNodeMarker()->setModifiedMarker();
+ //and read second pointer
+ if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode())
+ N->setReadMarker();
+ return;
} else {
// Unknown function, warn if it returns a pointer type or takes a
// pointer argument.
OpenPOWER on IntegriCloud