John Criswell
1a6863e08b
Modified calcTypeName() so that it does not allocate a std::string for
...
every recursive call.
This makes it more robust for deeply nested, unnamed types.
llvm-svn: 13915
2004-06-01 14:54:08 +00:00
Reid Spencer
0030dfe486
Clean up a comment.
...
llvm-svn: 13860
2004-05-27 22:04:46 +00:00
Reid Spencer
b7b1b9d4b2
Several clean ups suggested by Chris: remove tabs, make SlotMachine do lazy
...
initialization so we don't scan large Modules/Functions needlessly, tighten
up restrictions on what can be put in SlotMachine (no Constants that aren't
GlobalValues).
llvm-svn: 13796
2004-05-26 21:56:09 +00:00
Reid Spencer
58bad426cc
Part of bug 122. Removed dependency of AsmWriter on SlotCalculator by
...
incorporating a significantly simpler "SlotMachine" into this file. The
SlotMachine is tailored for use by only the AsmWriter whose requirements
for slot numbers are vastly different than from the Bytecode/Writer. Code
change passes all Feature and Regression tests.
llvm-svn: 13784
2004-05-26 07:18:52 +00:00
Reid Spencer
756f392365
Document a couple functions.
...
llvm-svn: 13761
2004-05-25 18:14:38 +00:00
Reid Spencer
fec48b0d9d
Convert to SymbolTable's new iteration interface.
...
llvm-svn: 13754
2004-05-25 08:53:40 +00:00
Misha Brukman
5f5f6ca775
class AssemblyWriter:
...
* Make contained ostream pointer, not reference
* Allow setting of that ostream via setStream()
class CachedWriter:
* setStream() in turn calls setStream() on the AssemblyWriter
llvm-svn: 13247
2004-04-28 19:24:28 +00:00
Misha Brukman
d408a510b8
* Add ability to print out type as symbolic
...
* Add Module accessor to AssemblyWriter
llvm-svn: 13227
2004-04-28 15:31:21 +00:00
Chris Lattner
aa815619b4
Print select instructions correctly
...
llvm-svn: 12320
2004-03-12 05:53:14 +00:00
Chris Lattner
94d2b3a524
Adjust to new interface
...
llvm-svn: 12231
2004-03-08 18:51:45 +00:00
Misha Brukman
754f11778f
Doxygenify comments.
...
llvm-svn: 12071
2004-03-02 00:22:19 +00:00
Misha Brukman
d9ed820702
* If a badref has a name, print it out for ease of debugging
...
* Doxygenify (some) comments
llvm-svn: 12057
2004-03-01 19:48:13 +00:00
Chris Lattner
28131460da
Adjustments to support the new ConstantAggregateZero class
...
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Chris Lattner
16690fad3d
Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
...
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
a1757d1d91
Start using the new and improve interface to FunctionType arguments
...
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
a9a34f9d82
vi failed me again. :)
...
llvm-svn: 11206
2004-02-08 21:52:30 +00:00
Chris Lattner
2878b11cfc
Rename the invoke 'except' destination to the 'unwind' destination
...
llvm-svn: 11205
2004-02-08 21:52:04 +00:00
Chris Lattner
68fdb35576
rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
...
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
781ed02fce
SlotCalculator.h moved
...
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner
95c8aa8570
Eliminate special case handling for CPR's
...
Fix some problem cases where I was building the slot calculator in bytecode
writer mode instead of asmwriter mode.
llvm-svn: 10911
2004-01-18 21:03:06 +00:00
Chris Lattner
bcd7372d19
The only clients of the slot calculator are now the asmwriter and bcwriter.
...
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not. This makes it
reasonable to add bcwriter specific stuff to it as necessary.
llvm-svn: 10837
2004-01-14 02:49:34 +00:00
Chris Lattner
a1da49a55c
Finegrainify namespacification
...
llvm-svn: 10131
2003-11-21 20:23:48 +00:00
Chris Lattner
5ac68ed1bf
Don't crash if we are printing an orphaned basic block!
...
llvm-svn: 10100
2003-11-20 00:09:43 +00:00
Chris Lattner
31a03e3207
Be a bit more tolerant of broken code
...
llvm-svn: 10050
2003-11-17 01:17:04 +00:00
Brian Gaeke
675cab8d52
When you hand WriteAsOperand a type, it now prints out its symbolic name.
...
llvm-svn: 10042
2003-11-16 23:08:27 +00:00
Chris Lattner
21c40d8641
Don't print 'No predecessors!' on the entry block
...
llvm-svn: 10038
2003-11-16 22:59:57 +00:00
Brian Gaeke
d25f86d683
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
95e79d0097
Add an assertion
...
llvm-svn: 9831
2003-11-09 15:51:07 +00:00
Chris Lattner
c49a7fd37d
Make use of the new AssemblyAnnotationWriter interface
...
llvm-svn: 9619
2003-10-30 23:41:03 +00:00
Chris Lattner
f24ae5a0ed
Print the names of more opaque types
...
llvm-svn: 9598
2003-10-30 00:22:33 +00:00
Chris Lattner
a2fcab56e3
Make sure to print opaque types names if they are available.
...
llvm-svn: 9597
2003-10-30 00:12:51 +00:00
John Criswell
b402729b30
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
29825508f0
Add support for the new varargs intrinsics and instructions
...
llvm-svn: 9226
2003-10-18 05:57:43 +00:00
Alkis Evlogimenos
5a1f705c88
Eliminate some extraneous code in SlotCalculator::insertVal().
...
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().
llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Chris Lattner
f46c45682a
Add support for 'weak' linkage.
...
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Misha Brukman
c59161ff84
Fix spelling/grammar.
...
llvm-svn: 9023
2003-10-10 17:54:14 +00:00
Chris Lattner
2916eafa42
Add support for volatile loads/stores
...
llvm-svn: 8393
2003-09-08 17:45:59 +00:00
Chris Lattner
2fe8fac4e0
Fix bug where we couldn't print a function without a name
...
llvm-svn: 8341
2003-09-03 17:56:43 +00:00
Chris Lattner
91cdd5dbc9
Support new 'any' support for pointer size and endianness
...
llvm-svn: 8119
2003-08-24 13:48:48 +00:00
Chris Lattner
7cdcd38942
If an "LLVM name" has wierd characters in it, print it out in double quotes instead of prefixing it with %
...
llvm-svn: 8049
2003-08-22 05:40:38 +00:00
Chris Lattner
b44a9376d1
Implement TODO: print out short form of Invoke if possible
...
llvm-svn: 7595
2003-08-05 15:34:45 +00:00
Chris Lattner
1351c304dc
Remove redundant const qualifiers from cast<> expressions
...
llvm-svn: 7253
2003-07-23 15:30:06 +00:00
Chris Lattner
6ad460b336
Simplify code by using ConstantInt::getRawValue instead of checking to see
...
whether the constant is signed or unsigned, then casting
llvm-svn: 7252
2003-07-23 15:22:26 +00:00
Misha Brukman
5de3e14206
The word separate' only has one
e'.
...
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
Chris Lattner
b94fc3e392
Avoid printing out huge structures or arrays if they are just filled with zeros
...
llvm-svn: 6938
2003-06-28 20:08:24 +00:00
Brian Gaeke
d51afb3000
lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here
...
into a new function FPCSafeToPrint(), and use it in printConstant()
and printFunction() to decide whether we should output ConstantFPs as
floating-point constants or as references to stack-allocated variables.
lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above.
llvm-svn: 6762
2003-06-17 23:55:35 +00:00
Chris Lattner
a108915211
Don't print out unique identifier for opaque types
...
llvm-svn: 6511
2003-06-01 03:45:51 +00:00
Chris Lattner
cb3df29c52
Print opaque types
...
llvm-svn: 6200
2003-05-14 17:50:47 +00:00
Chris Lattner
e1faff42f4
Add support for the new va_arg instruction
...
llvm-svn: 6029
2003-05-08 02:44:12 +00:00
Chris Lattner
c412b950d2
Remove using declarations
...
llvm-svn: 6022
2003-05-08 02:08:14 +00:00
Chris Lattner
fcad09d3c1
Emit information about target
...
llvm-svn: 5844
2003-04-22 19:07:19 +00:00
Chris Lattner
fa4f750f3e
Add new linkage types to support a real frontend
...
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner
343a212f2b
Improve the efficiency and cleanup writing a bit
...
llvm-svn: 5782
2003-04-16 20:20:02 +00:00
Chris Lattner
0509f2bb59
Clean up cruft
...
llvm-svn: 5720
2003-03-06 23:23:32 +00:00
Chris Lattner
b5027095e5
- Eliminated the deferred symbol table stuff in Module & Function, it really
...
wasn't an optimization and it was causing lots of bugs.
llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
82f54dca49
- 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.
llvm-svn: 4149
2002-10-13 20:57:00 +00:00
Chris Lattner
4e19009255
Global variables are now external if they don't have initializers, not
...
"uninitialized"
llvm-svn: 4052
2002-10-06 22:48:09 +00:00
Chris Lattner
94a5211b6a
- Print the predecessors of a basic block instead of the number of uses of
...
the block in the AsmWriter
llvm-svn: 4019
2002-10-02 19:38:55 +00:00
Chris Lattner
a63519afc8
Add support for printing constpointerrefs more nicely
...
llvm-svn: 3654
2002-09-10 15:53:49 +00:00
Chris Lattner
e63ef1c3ab
Changed parser to always use parenthesis on ConstExprs to be consistent
...
llvm-svn: 3363
2002-08-16 21:17:11 +00:00
Chris Lattner
0d1bc11665
Write constexpr casts using the cast X to Y notation, not using the implicit
...
type result
llvm-svn: 3354
2002-08-15 19:37:43 +00:00
Chris Lattner
8adb533609
Fix bug: test/Regression/Assembler/2002-07-31-SlashInString.llx
...
llvm-svn: 3195
2002-07-31 23:56:44 +00:00
Chris Lattner
1720a4c0b7
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
llvm-svn: 3161
2002-07-30 18:54:25 +00:00
Chris Lattner
7a9eb848cd
* Add support for different "PassType's"
...
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses
llvm-svn: 3113
2002-07-26 21:12:46 +00:00
Chris Lattner
32f5f52f92
Fix typeo that caused bug:
...
test/Regression/Assembler/2002-07-25-ReturnPtrFunction.llx
llvm-svn: 3103
2002-07-25 20:58:51 +00:00
Chris Lattner
2aa4420d83
Fix bug: test/Regression/Assembler/2002-07-25-QuoteInString.llx
...
llvm-svn: 3099
2002-07-25 20:32:37 +00:00
Chris Lattner
cc707df01a
Register Writer passes
...
llvm-svn: 3017
2002-07-23 18:07:49 +00:00
Vikram S. Adve
ca1f1c58e1
Added support to write out ConstantExpr nodes.
...
Also, avoid asserting out when writing out an invalid tree
since the assembly writer is used when debugging.
llvm-svn: 2902
2002-07-14 23:14:45 +00:00
Chris Lattner
c27a459095
*** empty log message ***
...
llvm-svn: 2852
2002-07-10 16:48:17 +00:00
Chris Lattner
dfd421a7df
MEGAPATCH checkin.
...
For details, See: docs/2002-06-25-MegaPatchInfo.txt
llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner
365806ddf7
Support opaque type printing a little bit at least
...
llvm-svn: 2748
2002-05-26 20:17:54 +00:00
Chris Lattner
37107da53e
Print out function name with % style instead of "" style
...
llvm-svn: 2726
2002-05-22 22:29:26 +00:00
Chris Lattner
f7333e31a1
Avoid emitting a useless comment for a basic block with no uses (which
...
often happens for the entry basic block of a function)
llvm-svn: 2624
2002-05-14 16:02:05 +00:00
Chris Lattner
dfb7d63b15
Print functions with curly braces instead of begin/end
...
llvm-svn: 2469
2002-05-06 03:00:40 +00:00
Chris Lattner
bbd002a9ca
The implementation keyword is no longer neccesary
...
llvm-svn: 2434
2002-05-02 19:11:29 +00:00
Chris Lattner
a2c59f1302
Changes so that iMemory.h doesn't include DerivedTypes.h
...
llvm-svn: 2404
2002-04-29 18:46:50 +00:00
Chris Lattner
96e0c48175
Eliminate duplicate or unneccesary #include's
...
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
c760a6a4f4
Todo has been implemented, remove it
...
llvm-svn: 2387
2002-04-28 21:45:02 +00:00
Chris Lattner
321a8cf4ba
Split ConstantVals.h into Constant.h and Constants.h
...
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
07da09cd34
Module's are no longer values
...
llvm-svn: 2354
2002-04-28 04:51:09 +00:00
Chris Lattner
f1dee31d23
Pull all of the getStrValue implementation cruft out of Constants.cpp and
...
put it into the AsmWriter. This code is kinda gross and could probably be
cleaned up, but not now.
llvm-svn: 2299
2002-04-18 18:53:13 +00:00
Chris Lattner
10c22c6970
Changes to:
...
* Fix bug printing method types (oops when converting previous code)
* Move some of the code from Constant::getStrValue implementations here.
This allows us to do a MUCH MUCH better job printing out complex constant
values (think an array of structure pointers), because we print symbolic
type names instead of structural. The assistance when debugging is immense
Eventually, Constant::getStrValue should be removed (it existed before because
the asmwriter file was not in VMCore), and everyone should go through the
asmwriter that want's equivalent functionality.
llvm-svn: 2268
2002-04-16 21:36:08 +00:00
Chris Lattner
c0505e8d4e
Minor bugfix for previous checkin
...
llvm-svn: 2241
2002-04-13 21:11:04 +00:00
Chris Lattner
5496a44cc2
* Remove obselete code for unsized arrays
...
* Add new function printTypeAtLeastOneLevel used to...
* Print the symbol table *WITH SYMBOLIC TYPES*. Now we get:
%tree = type { int, %tree*, %tree* }
in the type definition section of the disassembled output instead of
%tree = type { int, \2*, \2* }
the different for the health benchmark and power are simply amazing.
llvm-svn: 2240
2002-04-13 20:53:41 +00:00
Chris Lattner
a4bce481d6
* Clean up code to use isa & dyncast instead of poking directly into instructions
...
* Do not print the allocation size for a non array allocation (this used to work,
but was broken).
llvm-svn: 2235
2002-04-13 18:34:38 +00:00
Chris Lattner
d1d6edad49
* Add comment
...
* Do not print a space before the * in a pointer type.
llvm-svn: 2232
2002-04-12 18:21:53 +00:00
Chris Lattner
5e12c7caf5
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
llvm-svn: 2216
2002-04-09 19:48:49 +00:00
Chris Lattner
5046c084ec
* Narrow AsmWriter interface
...
* Implement Value::print methods here instead of WriteToAssembly
llvm-svn: 2179
2002-04-08 22:03:40 +00:00
Chris Lattner
137fa92dce
* Move include/llvm/Analysis/SlotCalculator.h to include/llvm/SlotCalculator.h
...
because the slot calculator is already part of the VMCore library.
* Rename incorporateMethod and purgeMethod to *Function
llvm-svn: 2154
2002-04-07 22:49:37 +00:00
Chris Lattner
c994519230
Update comments
...
Implement Value::dump here.
llvm-svn: 2148
2002-04-07 22:31:46 +00:00
Chris Lattner
084601e6f4
s/Method/Function
...
llvm-svn: 2034
2002-03-29 03:44:36 +00:00
Chris Lattner
849c762b02
Change references from Method to Function
...
change references from MethodARgument to FunctionArgument
llvm-svn: 1991
2002-03-26 18:01:55 +00:00
Chris Lattner
3dc9a2a61f
Changes to build successfully with GCC 3.02
...
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
2cd50171de
Don't waste as much horizontal space on #uses flag when printing
...
llvm-svn: 1459
2001-12-14 16:29:12 +00:00
Chris Lattner
c4a5815033
Renamed inst_const_iterator -> const_inst_iterator
...
Renamed op_const_iterator -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()
llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Chris Lattner
f6b7da2bb5
Rename ConstPoolVal -> Constant
...
Rename ConstPool* -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h
llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner
bcf2df7058
Split the PHINode class out from the iOther.h file into the iPHINode.h file
...
llvm-svn: 1405
2001-12-03 18:02:31 +00:00
Chris Lattner
463cc31132
Create a new #include "Support/..." directory structure to move things
...
from "llvm/Support/..." that are not llvm dependant.
Move files and fix #includes
llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner
2a1613d3b2
Implement support for internal methods
...
llvm-svn: 1373
2001-11-26 18:54:16 +00:00
Chris Lattner
3aeffe685c
Implement CachedWriter class to allow module level printing of various components very quickly
...
llvm-svn: 1168
2001-11-07 04:21:57 +00:00