summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Use strcpy instead of sprintf here. This avoids a GCC 4.3 format-stringDan Gohman2008-08-051-1/+1
| | | | | | | warning. There wasn't actually a problem here, because the contents of the string are known. llvm-svn: 54385
* Add a new hidden option to the interpreter to cause it to printChris Lattner2008-07-081-0/+8
| | | | | | | out every volatile load and store. This is useful for tracking down insane volatile memory bugs. llvm-svn: 53241
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-0/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* fix warnings with assertions disabled.Chris Lattner2008-04-061-21/+6
| | | | llvm-svn: 49285
* Update gcc 4.3 warnings fix patch with recent head changesAnton Korobeynikov2008-02-201-11/+12
| | | | llvm-svn: 47368
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-203-1/+4
| | | | | | annoying warnings. llvm-svn: 47367
* Added memmove to interpreter external functions list. Patch by Daniel Dunbar.Evan Cheng2008-02-201-0/+9
| | | | llvm-svn: 47363
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-3/+3
| | | | llvm-svn: 46514
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-294-8/+8
| | | | llvm-svn: 45418
* remove attribution from lib Makefiles.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45415
* Add explicit keywords, and fix a minor typo that they uncovered.Dan Gohman2007-12-141-1/+1
| | | | llvm-svn: 45034
* Add a guard to cxxabi header as other platform mayZhou Sheng2007-12-121-0/+12
| | | | | | not support it. llvm-svn: 44914
* Fixed PR1629.Zhou Sheng2007-12-121-0/+40
| | | | | | | Make lli interpreter correctly call external functions sin()/cos(), __cxa_guard_acquire() and __cxa_guard_release(). llvm-svn: 44910
* It looks like this has been broken for some time -Duncan Sands2007-12-101-2/+2
| | | | | | get it to compile. llvm-svn: 44791
* simplify creation of the interpreter, make ExecutionEngine ctor protected,Chris Lattner2007-12-062-13/+5
| | | | | | delete one ExecutionEngine ctor, minor cleanup. llvm-svn: 44646
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-12/+9
| | | | | | use them. llvm-svn: 44403
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
* Fix an assertion abort on sparc. malloc(0) is allowed toGabor Greif2007-10-111-1/+3
| | | | | | return NULL. llvm-svn: 42871
* #ifdef out unsafe tracing code, which fixes PR1689Chris Lattner2007-09-211-15/+17
| | | | llvm-svn: 42205
* rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()Chris Lattner2007-08-231-2/+3
| | | | | | Add an APSInt::toString() method. llvm-svn: 41309
* Add a comment: don't expect from external function resolver in interpreterAnton Korobeynikov2007-07-301-0/+5
| | | | | | things, it wasn't designed to handle. llvm-svn: 40608
* More explicit keywords.Dan Gohman2007-07-301-1/+1
| | | | llvm-svn: 40589
* VStudio compiler errors and placing Function*->ExFunc map under ↵Chuck Rose III2007-07-271-4/+5
| | | | | | | | | | | | | ManagedStatic control. This commit fixes two things. One is a pair of VStudio compiler errors stemming from variables which defined within the for loop statement and also within the body of the for loop. I fixed these by renaming one of the two variables. Additionally, I've made the Function*->ExFunc map in ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown. In repeated uses of the interpreter, where the same Function* address may get used for completely differnet functions, this was causing a crash. llvm-svn: 40558
* For PR1486:Reid Spencer2007-06-012-2/+2
| | | | | | | Avoid overwriting the APInt instance with 0 bytes which causes the bitwidth to be set to 0 (illegal) producing a subsequent assert. llvm-svn: 37391
* On Linux platforms and at optimization levels -O1 and above, llvm-gcc canReid Spencer2007-05-191-3/+14
| | | | | | | turn "putchar" calls into _IO_putc calls which is a lower-level interface. This patch allows these calls to be executed by lli in interpreter mode. llvm-svn: 37254
* Print integer values as both decimal and hexadecimal for convenienceReid Spencer2007-05-171-1/+1
| | | | | | of verifying result values when debugging. llvm-svn: 37156
* Avoid a "loss of precision" error in gcc 4.1.3.Reid Spencer2007-05-161-1/+1
| | | | llvm-svn: 37105
* Implement printing of instruction result values when debug info is turnedReid Spencer2007-05-161-0/+21
| | | | | | | on. This helps to speed up the debugging time by showing computational results as the program executes. llvm-svn: 37095
* Bitcast all the bits of a floating point value, not just one. The zeroReid Spencer2007-05-041-0/+2
| | | | | | | | extension is needed because the constructor for the Destination value causes the APInt to have a bit width of 1. Patch by Guoling Han. llvm-svn: 36733
* 1. Don't swap byte order in scanf. It isn't necessary and leads toReid Spencer2007-04-261-1/+1
| | | | | | | | incorrect results (canonicalization was dropped several commits ago). 2. Add support for fscanf. 3. Suppress a warning about cast to pointer from non-pointer-sized integer. llvm-svn: 36482
* We only need one putchar which gives it a shot at getting matched by itsReid Spencer2007-04-211-17/+4
| | | | | | users. llvm-svn: 36305
* eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005.Chris Lattner2007-04-171-3/+6
| | | | llvm-svn: 36198
* Implement @sext and @zext parameter attribute handling properly instead ofReid Spencer2007-04-161-11/+20
| | | | | | | forcing every small argument of every function regardless of attributes or calling convention to be expanded. llvm-svn: 36174
* For PR1293:Reid Spencer2007-03-301-49/+67
| | | | | | | | | | * Rename the FunctionType* parameter from M to FT on all the functions. * Implement a fix for PR1293 by just asserting that library functions that must return pointers should have pointer typed results. This just makes sure that we don't attempt to use an uninitialized integer or something later on. llvm-svn: 35508
* Don't use std::hex.Bill Wendling2007-03-081-1/+1
| | | | llvm-svn: 35038
* Don't use a cast. It causes an error on some platforms.Bill Wendling2007-03-081-1/+1
| | | | llvm-svn: 35037
* Fix some thinko's in the last patch. PtrSize has to be in bits and weReid Spencer2007-03-061-2/+2
| | | | | | might need to zext not just trunc the value. llvm-svn: 34955
* Fix a bug in IntToPtr. Truncating to 64-bits only works if the integerReid Spencer2007-03-061-1/+5
| | | | | | is larger. Adjust so that it truncates to pointer width, only if necessary. llvm-svn: 34954
* Radically simplify execution. This patch gets rid of all the specialReid Spencer2007-03-061-636/+128
| | | | | | | | handling for integer of various sizes. GenericValue now has just a single integer field of type APInt. We use its facilities directly in the execution of all instructions. llvm-svn: 34951
* Adjust and simplify external function processing now that GenericValue hasReid Spencer2007-03-061-33/+41
| | | | | | a single integer field of type APInt. llvm-svn: 34950
* APInt's are no longer allocated on the heap because they are directReid Spencer2007-03-061-12/+0
| | | | | | | members of GenericValue. Consequently the code to clean them up isn't needed. llvm-svn: 34948
* Remove the insufficient code in Interpreter::create that computed theReid Spencer2007-03-061-12/+0
| | | | | | | | Target DataLayout incorrectly. For now, we'll trust that the module has got the correct DataLayout. In the future, this needs to be changed to tell the TargetData to be "current host". llvm-svn: 34947
* Remove unnecessary #include.Reid Spencer2007-03-031-1/+0
| | | | llvm-svn: 34889
* Deal with error handling better.Reid Spencer2007-03-032-8/+16
| | | | llvm-svn: 34887
* Complete the APIntification of the interpreter. All asserts for > 64 bitsReid Spencer2007-03-031-118/+209
| | | | | | | have been removed and dealt with. The interpreter should now be able to execute any LLVM program using any bit width. llvm-svn: 34884
* Implement APInt support for the binary operators.Reid Spencer2007-03-031-254/+240
| | | | | | | Move the getConstantExpr function towards the end of the file so we don't need a dozen forward declarations. llvm-svn: 34877
* 1. Have the ExecutionContext keep track of the APInt's allocated andReid Spencer2007-03-031-11/+13
| | | | | | | ensure they are cleaned up when the stack frame exits. 2. Move a function to the Execution.cpp file where it belongs. llvm-svn: 34876
* From Dan Gohman:Chris Lattner2007-02-141-1/+1
| | | | | | | | | | While preparing http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. llvm-svn: 34267
* Privatize StructLayout::MemberOffsets, adding an accessorChris Lattner2007-02-101-1/+1
| | | | llvm-svn: 34156
* For PR1188:Reid Spencer2007-02-082-2/+2
| | | | | | | | Compute BitMask correctly. Patch by Leo (wenwenti@hotmail.com). llvm-svn: 34026
OpenPOWER on IntegriCloud