Commit Graph

44 Commits

Author SHA1 Message Date
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Chris Lattner
52e20b0977 * Bug fixes:
- Fix problems where the constant table would not get updated when
    resolving constants causes other constants to change.

Changes to the V2 bytecode format
  - Null values are implicitly encoded instead of explicitly, this makes
    things more compact!
  - More compactly represent ConstantPointerRefs
  - Bytecode files are represented as:
      Header|GlobalTypes|GlobalVars/Function Protos|Constants|Functions|SymTab
    instead of
      Header|GlobalTypes|Constants|GlobalVars/Function Protos|Functions|SymTab
    which makes a lot of things simpler.

Changes to the reader:
  - Function loading code is much simpler.  We now no longer make function
    PlaceHolderHelper objects to be replaced with real functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5748 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-19 20:54:26 +00:00
Chris Lattner
6e5a0e4e89 s/Method/Function in variable and method names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5715 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-06 17:18:14 +00:00
Chris Lattner
0d75d8d73e Use the std namespace explicitly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5708 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-06 16:32:25 +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
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
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
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
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
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
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
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
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
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
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
92940ac1c0 Enable better debug output. When debugging the type system, print out the
type tables after reading a bytecode file to make sure they are ok


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2126 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 06:11:22 +00:00
Chris Lattner
c9aa7dfee4 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2035 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:51:11 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Chris Lattner
90865150e4 Remove unsized array support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1461 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-14 16:30:51 +00:00
Chris Lattner
7a17675206 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-04 00:03:30 +00:00
Chris Lattner
e9bb2df410 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 22:26:30 +00:00
Chris Lattner
7061dc50b2 Split the PHINode class out from the iOther.h file into the iPHINode.h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1405 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 18:02:31 +00:00
Chris Lattner
d23b1d31c0 Implement internal method support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1374 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 18:56:10 +00:00
Chris Lattner
e244a25014 Fix major bugs in type resolution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1092 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-03 03:27:53 +00:00
Chris Lattner
7eadfa1db8 Frivolous cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@973 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 06:21:22 +00:00
Chris Lattner
d48d6c74ad Fix another annoying bug that took forever to track down. This one involves abstract type resolution at a bad time that broke symbol tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@958 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 01:53:01 +00:00
Chris Lattner
c18545dc9e Rename ConstPoolPointerReference to ConstPoolPointerRef - My fingers get tired typing that much
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@822 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 13:21:42 +00:00
Chris Lattner
05950c34a4 * Add real support for global variable addresses initializing constants
* Add minor optimization to BytecodeParser::refineAbstractType
* MethodType::get now take an explicit isVarArg parameter
* Fix encoding/decoding of VarArgs calls
* Support the Invoke instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@760 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-13 06:47:01 +00:00
Chris Lattner
d535c2d163 Rename getNullPointer to getNull
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@708 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 15:39:24 +00:00
Chris Lattner
ef9c23f281 * Both Method & GlobalVariable now subclass GlobalValue
* ConstPoolPointerReference now represents a pointer to a GlobalValue
* Methods name references are now explicit pointers to methods
* Rename Value::GlobalVal to Value::GlobalVariableVal to avoid confusion


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@703 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 14:53:21 +00:00
Chris Lattner
b00c582b6d Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-02 03:41:24 +00:00
Chris Lattner
1d87bcf490 Convert more code to use new style casts
Eliminate old style casts from value.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@696 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 20:11:19 +00:00
Chris Lattner
cfe26c930a Add more support for new style casts
Convert more code to use them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@695 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 18:26:53 +00:00
Chris Lattner
1a1cb111fe Implement constant pointers, and null specifically in the parser, bytecode writer, and
bytecode reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@668 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-30 22:46:54 +00:00
Chris Lattner
1d670cc402 * Remove support for internal constant pool
* Support globally unique constants
* Support recursive and forward referenced types
* Support abstract types
* Add new BCR_TRACE macro to enable debugging of why the bytecode reader
  occasionally refuses to read something


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@448 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-07 16:37:43 +00:00
Chris Lattner
3d3f289eac * Add calls to failure template so that it is actually possible to debug
why bytecode parsing is failing.  Just put a breakpoint in the failure
  templates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-28 17:50:18 +00:00
Chris Lattner
e5a57ee363 Add support for extern varargs methods & varargs method calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-25 22:47:55 +00:00
Chris Lattner
a137530341 Add support to the bytecode reader to recognize floating point constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-15 00:17:18 +00:00
Chris Lattner
7fc9fe3439 Miscellaneous cleanups:
* Convert post to pre-increment for for loops
  * Use generic programming more
  * Use new Value::cast* instructions
  * Use new Module, Method, & BasicBlock forwarding methods
  * Use new facilities in STLExtras.h
  * Use new Instruction::isPHINode() method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:41:11 +00:00
Chris Lattner
009505452b Initial revision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-06 20:29:01 +00:00