blob: 5bad84ca8966df003790f2f37b8b33a901a61f20 [file] [log] [blame]
Chris Lattner7720c8e2001-09-10 04:50:17 +00001//===-- ExternalMethods.cpp - Implement External Methods ------------------===//
2//
3// This file contains both code to deal with invoking "external" methods, but
4// also contains code that implements "exported" external methods.
5//
6// External methods in LLI are implemented by dlopen'ing the lli executable and
7// using dlsym to look op the methods that we want to invoke. If a method is
8// found, then the arguments are mangled and passed in to the function call.
9//
10//===----------------------------------------------------------------------===//
11
12#include "Interpreter.h"
13#include "llvm/DerivedTypes.h"
14#include <map>
15#include <dlfcn.h>
Chris Lattner697954c2002-01-20 22:54:45 +000016#include <iostream>
Chris Lattner7720c8e2001-09-10 04:50:17 +000017#include <link.h>
Chris Lattnerc2593162001-10-27 08:28:11 +000018#include <math.h>
Chris Lattnerc063d382001-11-06 21:52:18 +000019#include <stdio.h>
Chris Lattner697954c2002-01-20 22:54:45 +000020using std::vector;
21using std::cout;
Chris Lattner7720c8e2001-09-10 04:50:17 +000022
23typedef GenericValue (*ExFunc)(MethodType *, const vector<GenericValue> &);
Chris Lattner697954c2002-01-20 22:54:45 +000024static std::map<const Method *, ExFunc> Functions;
25static std::map<std::string, ExFunc> FuncNames;
Chris Lattner7720c8e2001-09-10 04:50:17 +000026
Chris Lattnere43db882001-10-27 04:15:57 +000027static Interpreter *TheInterpreter;
28
29// getCurrentExecutablePath() - Return the directory that the lli executable
30// lives in.
31//
Chris Lattner697954c2002-01-20 22:54:45 +000032std::string Interpreter::getCurrentExecutablePath() const {
Chris Lattnere43db882001-10-27 04:15:57 +000033 Dl_info Info;
34 if (dladdr(&TheInterpreter, &Info) == 0) return "";
35
Chris Lattner697954c2002-01-20 22:54:45 +000036 std::string LinkAddr(Info.dli_fname);
Chris Lattnere43db882001-10-27 04:15:57 +000037 unsigned SlashPos = LinkAddr.rfind('/');
Chris Lattner697954c2002-01-20 22:54:45 +000038 if (SlashPos != std::string::npos)
Chris Lattnere43db882001-10-27 04:15:57 +000039 LinkAddr.resize(SlashPos); // Trim the executable name off...
40
41 return LinkAddr;
42}
43
44
Chris Lattner7720c8e2001-09-10 04:50:17 +000045static char getTypeID(const Type *Ty) {
46 switch (Ty->getPrimitiveID()) {
47 case Type::VoidTyID: return 'V';
48 case Type::BoolTyID: return 'o';
49 case Type::UByteTyID: return 'B';
50 case Type::SByteTyID: return 'b';
51 case Type::UShortTyID: return 'S';
52 case Type::ShortTyID: return 's';
53 case Type::UIntTyID: return 'I';
54 case Type::IntTyID: return 'i';
55 case Type::ULongTyID: return 'L';
56 case Type::LongTyID: return 'l';
57 case Type::FloatTyID: return 'F';
58 case Type::DoubleTyID: return 'D';
59 case Type::PointerTyID: return 'P';
60 case Type::MethodTyID: return 'M';
61 case Type::StructTyID: return 'T';
62 case Type::ArrayTyID: return 'A';
63 case Type::OpaqueTyID: return 'O';
64 default: return 'U';
65 }
66}
67
68static ExFunc lookupMethod(const Method *M) {
69 // Function not found, look it up... start by figuring out what the
70 // composite function name should be.
Chris Lattner697954c2002-01-20 22:54:45 +000071 std::string ExtName = "lle_";
Chris Lattneref9c23f2001-10-03 14:53:21 +000072 const MethodType *MT = M->getMethodType();
Chris Lattner7720c8e2001-09-10 04:50:17 +000073 for (unsigned i = 0; const Type *Ty = MT->getContainedType(i); ++i)
74 ExtName += getTypeID(Ty);
75 ExtName += "_" + M->getName();
76
77 //cout << "Tried: '" << ExtName << "'\n";
Chris Lattner4721f132001-10-30 20:28:00 +000078 ExFunc FnPtr = FuncNames[ExtName];
79 if (FnPtr == 0)
80 FnPtr = (ExFunc)dlsym(RTLD_DEFAULT, ExtName.c_str());
81 if (FnPtr == 0)
82 FnPtr = FuncNames["lle_X_"+M->getName()];
Chris Lattner7720c8e2001-09-10 04:50:17 +000083 if (FnPtr == 0) // Try calling a generic function... if it exists...
84 FnPtr = (ExFunc)dlsym(RTLD_DEFAULT, ("lle_X_"+M->getName()).c_str());
85 if (FnPtr != 0)
Chris Lattner697954c2002-01-20 22:54:45 +000086 Functions.insert(std::make_pair(M, FnPtr)); // Cache for later
Chris Lattner7720c8e2001-09-10 04:50:17 +000087 return FnPtr;
88}
89
Chris Lattner4721f132001-10-30 20:28:00 +000090GenericValue Interpreter::callExternalMethod(Method *M,
91 const vector<GenericValue> &ArgVals) {
Chris Lattnere43db882001-10-27 04:15:57 +000092 TheInterpreter = this;
93
Chris Lattner7720c8e2001-09-10 04:50:17 +000094 // Do a lookup to see if the method is in our cache... this should just be a
95 // defered annotation!
Chris Lattner697954c2002-01-20 22:54:45 +000096 std::map<const Method *, ExFunc>::iterator FI = Functions.find(M);
Chris Lattner7720c8e2001-09-10 04:50:17 +000097 ExFunc Fn = (FI == Functions.end()) ? lookupMethod(M) : FI->second;
98 if (Fn == 0) {
99 cout << "Tried to execute an unknown external method: "
Chris Lattner697954c2002-01-20 22:54:45 +0000100 << M->getType()->getDescription() << " " << M->getName() << "\n";
Chris Lattner4721f132001-10-30 20:28:00 +0000101 return GenericValue();
Chris Lattner7720c8e2001-09-10 04:50:17 +0000102 }
103
104 // TODO: FIXME when types are not const!
Chris Lattneref9c23f2001-10-03 14:53:21 +0000105 GenericValue Result = Fn(const_cast<MethodType*>(M->getMethodType()),ArgVals);
Chris Lattner4721f132001-10-30 20:28:00 +0000106 return Result;
Chris Lattner7720c8e2001-09-10 04:50:17 +0000107}
108
109
110//===----------------------------------------------------------------------===//
111// Methods "exported" to the running application...
112//
113extern "C" { // Don't add C++ manglings to llvm mangling :)
114
Chris Lattner2e42d3a2001-10-15 05:51:48 +0000115// Implement void printstr([ubyte {x N}] *)
116GenericValue lle_VP_printstr(MethodType *M, const vector<GenericValue> &ArgVal){
117 assert(ArgVal.size() == 1 && "printstr only takes one argument!");
118 cout << (char*)ArgVal[0].PointerVal;
119 return GenericValue();
120}
121
Chris Lattner7720c8e2001-09-10 04:50:17 +0000122// Implement 'void print(X)' for every type...
123GenericValue lle_X_print(MethodType *M, const vector<GenericValue> &ArgVals) {
124 assert(ArgVals.size() == 1 && "generic print only takes one argument!");
Chris Lattner2e42d3a2001-10-15 05:51:48 +0000125
126 Interpreter::print(M->getParamTypes()[0], ArgVals[0]);
127 return GenericValue();
128}
129
130// Implement 'void printVal(X)' for every type...
131GenericValue lle_X_printVal(MethodType *M, const vector<GenericValue> &ArgVal) {
132 assert(ArgVal.size() == 1 && "generic print only takes one argument!");
133
Chris Lattnerf8f2afb2001-10-18 21:55:32 +0000134 // Specialize print([ubyte {x N} ] *) and print(sbyte *)
Chris Lattner2e42d3a2001-10-15 05:51:48 +0000135 if (PointerType *PTy = dyn_cast<PointerType>(M->getParamTypes()[0].get()))
Chris Lattner7a176752001-12-04 00:03:30 +0000136 if (PTy->getElementType() == Type::SByteTy ||
137 isa<ArrayType>(PTy->getElementType())) {
Chris Lattner2e42d3a2001-10-15 05:51:48 +0000138 return lle_VP_printstr(M, ArgVal);
139 }
140
141 Interpreter::printValue(M->getParamTypes()[0], ArgVal[0]);
Chris Lattner7720c8e2001-09-10 04:50:17 +0000142 return GenericValue();
143}
144
Vikram S. Adve3eb60f82001-10-28 20:52:27 +0000145// Implement 'void printString(X)'
146// Argument must be [ubyte {x N} ] * or sbyte *
147GenericValue lle_X_printString(MethodType *M, const vector<GenericValue> &ArgVal) {
148 assert(ArgVal.size() == 1 && "generic print only takes one argument!");
149 return lle_VP_printstr(M, ArgVal);
150}
151
152// Implement 'void print<TYPE>(X)' for each primitive type or pointer type
153#define PRINT_TYPE_FUNC(TYPENAME,TYPEID) \
Chris Lattner316a65b2001-10-28 22:38:22 +0000154 GenericValue lle_X_print##TYPENAME(MethodType *M,\
155 const vector<GenericValue> &ArgVal) {\
Vikram S. Adve3eb60f82001-10-28 20:52:27 +0000156 assert(ArgVal.size() == 1 && "generic print only takes one argument!");\
Chris Lattner69b5ce92001-11-26 19:19:27 +0000157 assert(M->getParamTypes()[0].get()->getPrimitiveID() == Type::TYPEID);\
Vikram S. Adve3eb60f82001-10-28 20:52:27 +0000158 Interpreter::printValue(M->getParamTypes()[0], ArgVal[0]);\
159 return GenericValue();\
160 }
161
Chris Lattner4721f132001-10-30 20:28:00 +0000162PRINT_TYPE_FUNC(SByte, SByteTyID)
Vikram S. Adve3eb60f82001-10-28 20:52:27 +0000163PRINT_TYPE_FUNC(UByte, UByteTyID)
164PRINT_TYPE_FUNC(Short, ShortTyID)
165PRINT_TYPE_FUNC(UShort, UShortTyID)
166PRINT_TYPE_FUNC(Int, IntTyID)
167PRINT_TYPE_FUNC(UInt, UIntTyID)
168PRINT_TYPE_FUNC(Long, LongTyID)
169PRINT_TYPE_FUNC(ULong, ULongTyID)
170PRINT_TYPE_FUNC(Float, FloatTyID)
171PRINT_TYPE_FUNC(Double, DoubleTyID)
172PRINT_TYPE_FUNC(Pointer, PointerTyID)
173
174
Chris Lattner7720c8e2001-09-10 04:50:17 +0000175// void "putchar"(sbyte)
176GenericValue lle_Vb_putchar(MethodType *M, const vector<GenericValue> &Args) {
177 cout << Args[0].SByteVal;
178 return GenericValue();
179}
180
Chris Lattnere43db882001-10-27 04:15:57 +0000181// int "putchar"(int)
182GenericValue lle_ii_putchar(MethodType *M, const vector<GenericValue> &Args) {
Chris Lattner697954c2002-01-20 22:54:45 +0000183 cout << ((char)Args[0].IntVal) << std::flush;
Chris Lattnere43db882001-10-27 04:15:57 +0000184 return Args[0];
185}
186
Chris Lattner2e42d3a2001-10-15 05:51:48 +0000187// void "putchar"(ubyte)
188GenericValue lle_VB_putchar(MethodType *M, const vector<GenericValue> &Args) {
Chris Lattner697954c2002-01-20 22:54:45 +0000189 cout << Args[0].SByteVal << std::flush;
Chris Lattnere43db882001-10-27 04:15:57 +0000190 return Args[0];
Chris Lattner2e42d3a2001-10-15 05:51:48 +0000191}
192
Chris Lattnerf8f2afb2001-10-18 21:55:32 +0000193// void "__main"()
194GenericValue lle_V___main(MethodType *M, const vector<GenericValue> &Args) {
195 return GenericValue();
196}
197
Chris Lattnere43db882001-10-27 04:15:57 +0000198// void "exit"(int)
Chris Lattner0f279b22001-11-03 10:15:32 +0000199GenericValue lle_X_exit(MethodType *M, const vector<GenericValue> &Args) {
Chris Lattnere43db882001-10-27 04:15:57 +0000200 TheInterpreter->exitCalled(Args[0]);
201 return GenericValue();
202}
203
Chris Lattnerc2593162001-10-27 08:28:11 +0000204// void *malloc(uint)
Chris Lattner0f279b22001-11-03 10:15:32 +0000205GenericValue lle_X_malloc(MethodType *M, const vector<GenericValue> &Args) {
Chris Lattner4721f132001-10-30 20:28:00 +0000206 assert(Args.size() == 1 && "Malloc expects one argument!");
Chris Lattnerc2593162001-10-27 08:28:11 +0000207 GenericValue GV;
Chris Lattnerea38c0e2001-11-07 19:46:27 +0000208 GV.PointerVal = (PointerTy)malloc(Args[0].UIntVal);
Chris Lattnerc2593162001-10-27 08:28:11 +0000209 return GV;
210}
211
212// void free(void *)
Chris Lattner0f279b22001-11-03 10:15:32 +0000213GenericValue lle_X_free(MethodType *M, const vector<GenericValue> &Args) {
Chris Lattnerc063d382001-11-06 21:52:18 +0000214 assert(Args.size() == 1);
Chris Lattner4721f132001-10-30 20:28:00 +0000215 free((void*)Args[0].PointerVal);
Chris Lattnerc2593162001-10-27 08:28:11 +0000216 return GenericValue();
217}
218
Chris Lattner782b9392001-11-26 18:18:18 +0000219// int atoi(char *)
220GenericValue lle_X_atoi(MethodType *M, const vector<GenericValue> &Args) {
221 assert(Args.size() == 1);
222 GenericValue GV;
223 GV.IntVal = atoi((char*)Args[0].PointerVal);
224 return GV;
225}
226
Chris Lattnerc2593162001-10-27 08:28:11 +0000227// double pow(double, double)
Chris Lattner0f279b22001-11-03 10:15:32 +0000228GenericValue lle_X_pow(MethodType *M, const vector<GenericValue> &Args) {
Chris Lattnerc063d382001-11-06 21:52:18 +0000229 assert(Args.size() == 2);
Chris Lattnerc2593162001-10-27 08:28:11 +0000230 GenericValue GV;
Chris Lattner08845a22001-10-29 20:27:45 +0000231 GV.DoubleVal = pow(Args[0].DoubleVal, Args[1].DoubleVal);
Chris Lattnerc2593162001-10-27 08:28:11 +0000232 return GV;
233}
234
Chris Lattnerc063d382001-11-06 21:52:18 +0000235// double sqrt(double)
236GenericValue lle_X_sqrt(MethodType *M, const vector<GenericValue> &Args) {
237 assert(Args.size() == 1);
238 GenericValue GV;
239 GV.DoubleVal = sqrt(Args[0].DoubleVal);
240 return GV;
241}
Chris Lattnerc2593162001-10-27 08:28:11 +0000242
Chris Lattner86790052001-11-06 22:53:25 +0000243// double log(double)
244GenericValue lle_X_log(MethodType *M, const vector<GenericValue> &Args) {
245 assert(Args.size() == 1);
246 GenericValue GV;
247 GV.DoubleVal = log(Args[0].DoubleVal);
248 return GV;
249}
250
Chris Lattner782b9392001-11-26 18:18:18 +0000251// double floor(double)
252GenericValue lle_X_floor(MethodType *M, const vector<GenericValue> &Args) {
253 assert(Args.size() == 1);
254 GenericValue GV;
255 GV.DoubleVal = floor(Args[0].DoubleVal);
256 return GV;
257}
258
Chris Lattner86790052001-11-06 22:53:25 +0000259// double drand48()
260GenericValue lle_X_drand48(MethodType *M, const vector<GenericValue> &Args) {
261 assert(Args.size() == 0);
262 GenericValue GV;
263 GV.DoubleVal = drand48();
264 return GV;
265}
266
Chris Lattner1b600142001-11-13 05:46:08 +0000267// long lrand48()
268GenericValue lle_X_lrand48(MethodType *M, const vector<GenericValue> &Args) {
269 assert(Args.size() == 0);
270 GenericValue GV;
271 GV.IntVal = lrand48();
272 return GV;
273}
274
275// void srand48(long)
276GenericValue lle_X_srand48(MethodType *M, const vector<GenericValue> &Args) {
277 assert(Args.size() == 1);
278 srand48(Args[0].IntVal);
279 return GenericValue();
280}
281
Chris Lattner782b9392001-11-26 18:18:18 +0000282// void srand(uint)
283GenericValue lle_X_srand(MethodType *M, const vector<GenericValue> &Args) {
284 assert(Args.size() == 1);
285 srand(Args[0].UIntVal);
286 return GenericValue();
287}
Chris Lattner86790052001-11-06 22:53:25 +0000288
Chris Lattnere7c6f722001-12-13 00:43:47 +0000289// int sprintf(sbyte *, sbyte *, ...) - a very rough implementation to make
290// output useful.
291GenericValue lle_X_sprintf(MethodType *M, const vector<GenericValue> &Args) {
292 char *OutputBuffer = (char *)Args[0].PointerVal;
293 const char *FmtStr = (const char *)Args[1].PointerVal;
294 unsigned ArgNo = 2;
Chris Lattner08845a22001-10-29 20:27:45 +0000295
296 // printf should return # chars printed. This is completely incorrect, but
297 // close enough for now.
298 GenericValue GV; GV.IntVal = strlen(FmtStr);
299 while (1) {
300 switch (*FmtStr) {
301 case 0: return GV; // Null terminator...
302 default: // Normal nonspecial character
Chris Lattnere7c6f722001-12-13 00:43:47 +0000303 sprintf(OutputBuffer++, "%c", *FmtStr++);
Chris Lattner08845a22001-10-29 20:27:45 +0000304 break;
305 case '\\': { // Handle escape codes
Chris Lattnere7c6f722001-12-13 00:43:47 +0000306 sprintf(OutputBuffer, "%c%c", *FmtStr, *(FmtStr+1));
307 FmtStr += 2; OutputBuffer += 2;
Chris Lattner08845a22001-10-29 20:27:45 +0000308 break;
309 }
310 case '%': { // Handle format specifiers
Chris Lattnerea38c0e2001-11-07 19:46:27 +0000311 char FmtBuf[100] = "", Buffer[1000] = "";
312 char *FB = FmtBuf;
313 *FB++ = *FmtStr++;
314 char Last = *FB++ = *FmtStr++;
315 unsigned HowLong = 0;
316 while (Last != 'c' && Last != 'd' && Last != 'i' && Last != 'u' &&
317 Last != 'o' && Last != 'x' && Last != 'X' && Last != 'e' &&
318 Last != 'E' && Last != 'g' && Last != 'G' && Last != 'f' &&
319 Last != 'p' && Last != 's' && Last != '%') {
320 if (Last == 'l' || Last == 'L') HowLong++; // Keep track of l's
321 Last = *FB++ = *FmtStr++;
Chris Lattner08845a22001-10-29 20:27:45 +0000322 }
Chris Lattnerea38c0e2001-11-07 19:46:27 +0000323 *FB = 0;
324
325 switch (Last) {
326 case '%':
327 sprintf(Buffer, FmtBuf); break;
328 case 'c':
329 sprintf(Buffer, FmtBuf, Args[ArgNo++].SByteVal); break;
330 case 'd': case 'i':
331 case 'u': case 'o':
332 case 'x': case 'X':
333 if (HowLong == 2)
334 sprintf(Buffer, FmtBuf, Args[ArgNo++].ULongVal);
335 else
336 sprintf(Buffer, FmtBuf, Args[ArgNo++].IntVal); break;
337 case 'e': case 'E': case 'g': case 'G': case 'f':
338 sprintf(Buffer, FmtBuf, Args[ArgNo++].DoubleVal); break;
339 case 'p':
340 sprintf(Buffer, FmtBuf, (void*)Args[ArgNo++].PointerVal); break;
341 case 's':
342 sprintf(Buffer, FmtBuf, (char*)Args[ArgNo++].PointerVal); break;
343 default: cout << "<unknown printf code '" << *FmtStr << "'!>";
344 ArgNo++; break;
Chris Lattner08845a22001-10-29 20:27:45 +0000345 }
Chris Lattnere7c6f722001-12-13 00:43:47 +0000346 strcpy(OutputBuffer, Buffer);
347 OutputBuffer += strlen(Buffer);
Chris Lattnerea38c0e2001-11-07 19:46:27 +0000348 }
Chris Lattner08845a22001-10-29 20:27:45 +0000349 break;
350 }
Chris Lattner08845a22001-10-29 20:27:45 +0000351 }
352}
353
Chris Lattnere7c6f722001-12-13 00:43:47 +0000354// int printf(sbyte *, ...) - a very rough implementation to make output useful.
355GenericValue lle_X_printf(MethodType *M, const vector<GenericValue> &Args) {
356 char Buffer[10000];
357 vector<GenericValue> NewArgs;
358 GenericValue GV; GV.PointerVal = (PointerTy)Buffer;
359 NewArgs.push_back(GV);
360 NewArgs.insert(NewArgs.end(), Args.begin(), Args.end());
361 GV = lle_X_sprintf(M, NewArgs);
362 cout << Buffer;
363 return GV;
364}
365
Chris Lattner295fe672002-01-23 21:38:07 +0000366// int clock(void) - Profiling implementation
367GenericValue lle_i_clock(MethodType *M, const vector<GenericValue> &Args) {
368 extern int clock(void);
369 GenericValue GV; GV.IntVal = clock();
370 return GV;
371}
Chris Lattnere7c6f722001-12-13 00:43:47 +0000372
Chris Lattner7720c8e2001-09-10 04:50:17 +0000373} // End extern "C"
Chris Lattner4721f132001-10-30 20:28:00 +0000374
375
376void Interpreter::initializeExternalMethods() {
377 FuncNames["lle_VP_printstr"] = lle_VP_printstr;
378 FuncNames["lle_X_print"] = lle_X_print;
379 FuncNames["lle_X_printVal"] = lle_X_printVal;
380 FuncNames["lle_X_printString"] = lle_X_printString;
381 FuncNames["lle_X_printUByte"] = lle_X_printUByte;
382 FuncNames["lle_X_printSByte"] = lle_X_printSByte;
383 FuncNames["lle_X_printUShort"] = lle_X_printUShort;
384 FuncNames["lle_X_printShort"] = lle_X_printShort;
385 FuncNames["lle_X_printInt"] = lle_X_printInt;
386 FuncNames["lle_X_printUInt"] = lle_X_printUInt;
387 FuncNames["lle_X_printLong"] = lle_X_printLong;
388 FuncNames["lle_X_printULong"] = lle_X_printULong;
389 FuncNames["lle_X_printFloat"] = lle_X_printFloat;
390 FuncNames["lle_X_printDouble"] = lle_X_printDouble;
391 FuncNames["lle_X_printPointer"] = lle_X_printPointer;
Chris Lattner0f279b22001-11-03 10:15:32 +0000392 FuncNames["lle_Vb_putchar"] = lle_Vb_putchar;
393 FuncNames["lle_ii_putchar"] = lle_ii_putchar;
394 FuncNames["lle_VB_putchar"] = lle_VB_putchar;
395 FuncNames["lle_V___main"] = lle_V___main;
396 FuncNames["lle_X_exit"] = lle_X_exit;
397 FuncNames["lle_X_malloc"] = lle_X_malloc;
398 FuncNames["lle_X_free"] = lle_X_free;
Chris Lattner782b9392001-11-26 18:18:18 +0000399 FuncNames["lle_X_atoi"] = lle_X_atoi;
Chris Lattner0f279b22001-11-03 10:15:32 +0000400 FuncNames["lle_X_pow"] = lle_X_pow;
Chris Lattner1b600142001-11-13 05:46:08 +0000401 FuncNames["lle_X_log"] = lle_X_log;
Chris Lattner782b9392001-11-26 18:18:18 +0000402 FuncNames["lle_X_floor"] = lle_X_floor;
403 FuncNames["lle_X_srand"] = lle_X_srand;
Chris Lattner1b600142001-11-13 05:46:08 +0000404 FuncNames["lle_X_drand48"] = lle_X_drand48;
405 FuncNames["lle_X_srand48"] = lle_X_srand48;
406 FuncNames["lle_X_lrand48"] = lle_X_lrand48;
Chris Lattnerc063d382001-11-06 21:52:18 +0000407 FuncNames["lle_X_sqrt"] = lle_X_sqrt;
Chris Lattner0f279b22001-11-03 10:15:32 +0000408 FuncNames["lle_X_printf"] = lle_X_printf;
Chris Lattnere7c6f722001-12-13 00:43:47 +0000409 FuncNames["lle_X_sprintf"] = lle_X_sprintf;
Chris Lattner295fe672002-01-23 21:38:07 +0000410 FuncNames["lle_i_clock"] = lle_i_clock;
Chris Lattner4721f132001-10-30 20:28:00 +0000411}