[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp
John Criswell
criswell at cs.uiuc.edu
Mon Dec 19 09:39:00 PST 2005
Changes in directory llvm/lib/Analysis/DataStructure:
Local.cpp updated: 1.135 -> 1.136
---
Log message:
Added a command line option that allows the user to specify a list of
functions that allocate memory.
---
Diffs of the changes: (+19 -0)
Local.cpp | 19 +++++++++++++++++++
1 files changed, 19 insertions(+)
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.135 llvm/lib/Analysis/DataStructure/Local.cpp:1.136
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.135 Tue Dec 6 12:04:30 2005
+++ llvm/lib/Analysis/DataStructure/Local.cpp Mon Dec 19 11:38:39 2005
@@ -39,6 +39,12 @@
TrackIntegersAsPointers("dsa-track-integers", cl::Hidden,
cl::desc("If this is set, track integers as potential pointers"));
+static cl::list<std::string>
+AllocList("alloc-list",
+ cl::value_desc("list"),
+ cl::desc("List of functions that allocate memory from the heap"),
+ cl::CommaSeparated);
+
namespace llvm {
namespace DS {
// isPointerType - Return true if this type is big enough to hold a pointer.
@@ -548,6 +554,19 @@
N->setModifiedMarker();
return;
default:
+ // Determine if the called function is one of the specified heap
+ // allocation functions
+ for (cl::list<std::string>::iterator AllocFunc = AllocList.begin(),
+ LastAllocFunc = AllocList.end();
+ AllocFunc != LastAllocFunc;
+ ++AllocFunc) {
+ if (F->getName() == *(AllocFunc)) {
+ setDestTo(*CS.getInstruction(),
+ createNode()->setHeapNodeMarker()->setModifiedMarker());
+ return;
+ }
+ }
+
if (F->getName() == "calloc" || F->getName() == "posix_memalign" ||
F->getName() == "memalign" || F->getName() == "valloc") {
setDestTo(*CS.getInstruction(),
More information about the llvm-commits
mailing list