diff options
author | Chris Lattner <sabre@nondot.org> | 2002-01-23 21:38:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-01-23 21:38:07 +0000 |
commit | 295fe670596ed0f80850fa289f9bedd74d391b2d (patch) | |
tree | 34c90eb3f5b32f8729ace01306ca8a740a9f8d6a /lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | 52a4e85a98fdb7e03f13cfc1eb9f2ef4326ec62a (diff) |
Implement the clock() function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index bcff5e5795..5bad84ca89 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -363,6 +363,12 @@ GenericValue lle_X_printf(MethodType *M, const vector<GenericValue> &Args) { return GV; } +// int clock(void) - Profiling implementation +GenericValue lle_i_clock(MethodType *M, const vector<GenericValue> &Args) { + extern int clock(void); + GenericValue GV; GV.IntVal = clock(); + return GV; +} } // End extern "C" @@ -401,4 +407,5 @@ void Interpreter::initializeExternalMethods() { FuncNames["lle_X_sqrt"] = lle_X_sqrt; FuncNames["lle_X_printf"] = lle_X_printf; FuncNames["lle_X_sprintf"] = lle_X_sprintf; + FuncNames["lle_i_clock"] = lle_i_clock; } |