aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:59:25 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:59:25 +0000
commiteb1a8453f9571cea2dc0a79374351db78f31bc28 (patch)
tree897c3261723f3d7614e704f6e4ec50abcefa27a0 /lib/ExecutionEngine
parent2df1f74b972bf1986e27294a1c4fbfadeb1d9763 (diff)
downloadexternal_llvm-eb1a8453f9571cea2dc0a79374351db78f31bc28.zip
external_llvm-eb1a8453f9571cea2dc0a79374351db78f31bc28.tar.gz
external_llvm-eb1a8453f9571cea2dc0a79374351db78f31bc28.tar.bz2
Added external functions for hashing pointers to sequence numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 5bc46fa..efe2e8f 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -12,6 +12,7 @@
#include "Interpreter.h"
#include "llvm/DerivedTypes.h"
+#include "../test/Libraries/libinstr/tracelib.h"
#include <map>
#include <dlfcn.h>
#include <iostream>
@@ -21,6 +22,7 @@
using std::vector;
using std::cout;
+
typedef GenericValue (*ExFunc)(FunctionType *, const vector<GenericValue> &);
static std::map<const Function *, ExFunc> Functions;
static std::map<std::string, ExFunc> FuncNames;
@@ -457,6 +459,43 @@ GenericValue lle_X_fflush(FunctionType *M, const vector<GenericValue> &Args) {
return GV;
}
+// unsigned int HashPointerToSeqNum(char* ptr)
+GenericValue lle_X_HashPointerToSeqNum(FunctionType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 1);
+ GenericValue GV;
+
+ GV.UIntVal = HashPointerToSeqNum((char*) Args[0].PointerVal);
+ return GV;
+}
+
+// void ReleasePointerSeqNum(char* ptr);
+GenericValue lle_X_ReleasePointerSeqNum(FunctionType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 1);
+ ReleasePointerSeqNum((char*) Args[0].PointerVal);
+ return GenericValue();
+}
+
+// void RecordPointer(char* ptr);
+GenericValue lle_X_RecordPointer(FunctionType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 1);
+ RecordPointer((char*) Args[0].PointerVal);
+ return GenericValue();
+}
+
+// void PushPointerSet();
+GenericValue lle_X_PushPointerSet(FunctionType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 0);
+ PushPointerSet();
+ return GenericValue();
+}
+
+// void ReleaseRecordedPointers();
+GenericValue lle_X_ReleasePointersPopSet(FunctionType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 0);
+ ReleasePointersPopSet();
+ return GenericValue();
+}
+
} // End extern "C"
@@ -503,4 +542,9 @@ void Interpreter::initializeExternalMethods() {
FuncNames["lle_X_fwrite"] = lle_X_fwrite;
FuncNames["lle_X_fgets"] = lle_X_fgets;
FuncNames["lle_X_fflush"] = lle_X_fflush;
+ FuncNames["lle_X_HashPointerToSeqNum"] = lle_X_HashPointerToSeqNum;
+ FuncNames["lle_X_ReleasePointerSeqNum"] = lle_X_ReleasePointerSeqNum;
+ FuncNames["lle_X_RecordPointer"] = lle_X_RecordPointer;
+ FuncNames["lle_X_PushPointerSet"] = lle_X_PushPointerSet;
+ FuncNames["lle_X_ReleasePointersPopSet"] = lle_X_ReleasePointersPopSet;
}