Commit Graph

133 Commits

Author SHA1 Message Date
Chris Lattner
8cdc6b726a - Fix a really nasty bug in the bytecode reader that caused it to fail
reading bytecode files with > 255 types in them, but only when optimization
    is enabled.  This was caused by GCC shrinking an enum to a single byte
    instead of a whole word.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4266 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-23 00:51:54 +00:00
Chris Lattner
5dfab9ec22 Wow, for some reason, when reading bytecode from stdin, we were only reading
4 bytes at a time.  Change this to read blocks of 4k


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4265 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-22 23:55:24 +00:00
Chris Lattner
6463e0df85 Clean up code a bit, no functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4162 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 03:34:17 +00:00
Chris Lattner
bbd4b303e3 There is no way to guarantee that constants are not forward referenced.
Handle forward referenced constants in a general way.  This fixes bug:
Assembler/2002-10-13-ConstantEncodingProblem.llx and allows the SPEC
197.parser benchmark to be built


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4161 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 03:33:02 +00:00
Chris Lattner
479b54b6bb Minor cleanups, no changes to functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4157 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 00:48:57 +00:00
Chris Lattner
69da5cf261 - Change Function's so that their argument list is populated when they are
constructed.  Before, external functions would have an empty argument list,
    now a Function ALWAYS has a populated argument list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 20:57:00 +00:00
Chris Lattner
0b16ae209a - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 19:39:16 +00:00
Chris Lattner
a92f696b74 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:41 +00:00
Anand Shukla
4f2d5a4d76 Changed uchar to unsigned char in function ParseBytecodeBuffer, because seemingly it affects opt in uncertain ways :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3866 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 20:57:54 +00:00
Misha Brukman
a6d0975679 On the quest of eliminating unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3715 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 02:18:57 +00:00
Chris Lattner
e87e1c9aa9 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:28:50 +00:00
Chris Lattner
cc63f1c674 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:20 +00:00
Chris Lattner
24ea74eb9a Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 22:49:05 +00:00
Chris Lattner
352eef717d Emit an obnoxious warning message for bytecode that includes load/store
instructions that use indexing.  Convert them transparently into a pair
of instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3431 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 22:55:27 +00:00
Chris Lattner
63c58a496a Fix bug: test/Regression/Assembler/2002-08-19-BytecodeReader.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3384 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 16:48:21 +00:00
Chris Lattner
915ce8a02e Turn off a debugging optimization that just slows bytecode reading down
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3377 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-18 00:38:32 +00:00
Chris Lattner
e4619181cc Fix stupid oversight of missing #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3367 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:02:41 +00:00
Chris Lattner
7473413072 - Finally nailed: test/Regression/Assembler/2002-08-16-ConstExprInlined.llx
- ParseConstantPool was resolving reference to value using the function
      slot # instead of the global slot #.
  - Bytecode reader changes:
    - Remove the failure<> template from Bytecode Reader
    - Remove extraneous #includes
    - s/method/function/ a bit
    - Eliminate the fwdRefs class that just added abstraction where it was not
      needed, making things more complex.
    - Use a vector instead of a list for function signatures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3366 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:01:27 +00:00
Chris Lattner
ad333484ea Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3328 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:24:09 +00:00
Chris Lattner
c188eeb08c Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3161 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:25 +00:00
Chris Lattner
e8e4605021 Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3160 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:22 +00:00
Chris Lattner
ce6ef112c4 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3105 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 18:40:14 +00:00
Chris Lattner
9a9433b8b5 Break line to fit 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3083 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 15:40:04 +00:00
Chris Lattner
fe8041ae39 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:08:53 +00:00
Chris Lattner
635cd9347e Register the WriteBytecodePass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3033 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 19:56:44 +00:00
Chris Lattner
56d27019e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:38 +00:00
Chris Lattner
cc4b6ec2b9 ConstExpr::getelementptr now takes a vector of Constants not Values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2948 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:14:27 +00:00
Anand Shukla
3edfb64902 added std:: to pair
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2917 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:04:57 +00:00
Anand Shukla
18be6fb716 added std:: to vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2916 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:04:15 +00:00
Vikram S. Adve
a24a0bb0e2 Add support for writing ConstantExpr nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2899 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:08:30 +00:00
Vikram S. Adve
a7dac3db79 Write out the plane for types first, since values of primitive types
may be constructed by expressions of other types (and so the
contents of the primitive type planes must come after all types).
Use a helper function outputConstantsInPlane in outputConstants to
do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2898 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:07:51 +00:00
Vikram S. Adve
054bd689db Use a helper function outputConstantsInPlane in outputConstants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2897 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:05:53 +00:00
Vikram S. Adve
c668b7c3ae Add support for reading ConstantExpr nodes.
Add class ConstantFwdRefs to resolve forward references to constants
and to globals. (Hmm... this class could be renamed I guess.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2896 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:05:09 +00:00
Vikram S. Adve
c1e4a813a2 Add support for reading ConstantExpr nodes.
Add class ConstantFwdRefs to resolve forward references to constants
and to globals (unified old code for globals into this).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2895 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:04:18 +00:00
Chris Lattner
194f0a56ac Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2805 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:04:37 +00:00
Anand Shukla
eea60fc59c changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2790 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:44:04 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
0b12b5f50e MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:21 +00:00
Chris Lattner
9fcccb0f36 Fix constness problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2759 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 17:49:40 +00:00
Chris Lattner
a48836b195 Fix constness problems now that the cast operators preserve the constness
of their argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2758 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 17:38:28 +00:00
Chris Lattner
9b625030c8 Replace all usages of Type::isPointerType with isa<PointerType>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
09c66f07c0 Remove unneccesary #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2352 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 04:50:19 +00:00
Chris Lattner
ccc259635a Make debugging code not use getStrValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2295 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 18:14:56 +00:00
Chris Lattner
f759c4e2a7 Remove old frivolous uses of getStrValue in a debugging statement
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2270 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-16 21:36:59 +00:00
Chris Lattner
73e214244f Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:48:49 +00:00
Chris Lattner
184b2fa1b9 Use opaque decl instead of #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2203 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 18:35:38 +00:00
Chris Lattner
4d669b510c s/method/function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2177 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 22:01:15 +00:00
Chris Lattner
35e309ab01 llvm/Assembly/Writer.h is unneccesary except for extreme output
isLabelType is obsolete


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2176 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 21:59:36 +00:00