1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

554 Commits

Author SHA1 Message Date
Devang Patel
ad8ca34acd Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.

llvm-svn: 56511
2008-09-23 22:35:17 +00:00
Duncan Sands
2c9f6ab06d Rationalize the names of passes that print information:
-callgraph => print-callgraph
    -callscc   => print-callgraph-sccs
    -cfgscc    => print-cfg-sccs
    -externalfnconstants => print-externalfnconstants
    -print               => print-function
    -print-alias-sets (no change)
    -print-callgraph     => dot-callgraph
    -print-cfg           => dot-cfg
    -print-cfg-only      => dot-cfg-only
    -print-dom-info (no change)
    -printm              => print-module
    -printusedtypes      => print-used-types

llvm-svn: 56487
2008-09-23 12:47:39 +00:00
Devang Patel
c7fc5ed65f Add hasNote() to check note associated with a function.
llvm-svn: 56477
2008-09-22 22:32:29 +00:00
Dan Gohman
6418cb3998 Fix WriteAsOperand to not emit a leading space character. Adjust
its callers to emit a space character before calling it when a
space is needed.

This fixes several spurious whitespace issues in
ScalarEvolution's debug dumps. See the test changes for
examples.

This also fixes odd space-after-tab indentation in the output
for switch statements, and changes calls from being printed like
this:
  call void @foo( i32 %x )
to this:
  call void @foo(i32 %x)

llvm-svn: 56196
2008-09-14 17:21:12 +00:00
Devang Patel
c0d6a60b65 Avoid extra comma.
llvm-svn: 55742
2008-09-03 22:55:40 +00:00
Devang Patel
f8c7bd2a05 Parse and print opt_size note.
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Devang Patel
5659d2508e s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
d131eb6bfb Use bitwise AND.
llvm-svn: 55656
2008-09-02 21:46:44 +00:00
Devang Patel
4b52a398c3 Print function notes.
llvm-svn: 55647
2008-09-02 20:56:33 +00:00
Chris Lattner
efbbbb0cde Asmprint nameless instructions as:
%4 = add ...

instead of:

add ...    ; 4

This makes opt -print-cfg output actually usable and makes .ll files
generally easier to read.  This fixes PR2480

llvm-svn: 55541
2008-08-29 17:19:30 +00:00
Chris Lattner
df2af1f4c5 Fix pasto (values -> types) noticed by Josh Conner
llvm-svn: 55315
2008-08-25 17:03:15 +00:00
Chris Lattner
0efa9e9d2e flush stream after dumping.
llvm-svn: 55301
2008-08-25 04:55:46 +00:00
Chris Lattner
f6e98a0f30 add a hack to temporarily allow pseudo source values.
llvm-svn: 55289
2008-08-24 18:33:17 +00:00
Chris Lattner
ea485fa47d minor cleanups.
llvm-svn: 55267
2008-08-23 22:52:27 +00:00
Chris Lattner
fe3155fc62 Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly, 
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself 
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".


A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream 
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.

llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Chris Lattner
2b6a31501e more cleanups, random methods shouldn't return ostreams.
llvm-svn: 54984
2008-08-19 05:26:17 +00:00
Chris Lattner
8cc806c9be more cleanup, eliminate getLLVMName when printing out
type names at the top of the file.

llvm-svn: 54983
2008-08-19 05:16:28 +00:00
Chris Lattner
b665916d8d random cleanups, factor some printing code for linkage and visibility
llvm-svn: 54982
2008-08-19 05:06:27 +00:00
Chris Lattner
6df4ed8bfd Change WriteTypeSymbolic/WriteAsOperand to return void instead of
an ostream, which is just weird.

Rename SC_DEBUG -> ST_DEBUG

Remove static indentation strangeness from WriteConstantInt.  This makes it 
so that large structs are not broken down and printed on multiple lines.  If
there is demand for this to return, there are better ways to implement this.

llvm-svn: 54981
2008-08-19 04:47:09 +00:00
Chris Lattner
50a2b09df9 rearrange code and make more legible.
llvm-svn: 54976
2008-08-19 04:36:02 +00:00
Chris Lattner
de5c9e9be5 put SlotTracker in an anon namespace since it is private.
llvm-svn: 54975
2008-08-19 04:28:07 +00:00
Chris Lattner
c6e031668d Reid had to call this class "slot machine" out of some strange reference
to the gambling device.  Name it something more meaningful.

llvm-svn: 54974
2008-08-19 04:26:57 +00:00
Chris Lattner
467a8dc22e Fix a bug daniel pointed out to me, where asmprinter started
printing ascii code for hex numbers instead of the hex numbers 
themselves.

llvm-svn: 54936
2008-08-18 19:41:26 +00:00
Gordon Henriksen
2cc861a6c1 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

  Collector               -> GCStrategy
  CollectorMetadata       -> GCFunctionInfo
  CollectorModuleMetadata -> GCModuleInfo
  CollectorRegistry       -> GCRegistry
  Function::getCollector  -> getGC (setGC, hasGC, clearGC)

Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.

llvm-svn: 54899
2008-08-17 18:44:35 +00:00
Chris Lattner
aa7b21d49b getLLVMName is only used for types now, which always pass in LocalPrefix. Specialize on it.
llvm-svn: 54897
2008-08-17 17:28:37 +00:00
Chris Lattner
2dc591352d switch valuemap's from std::map to densemap. This speeds up llvm-dis
on a stripped kc++ .bc file from 0.83 to 0.77s (8%)

llvm-svn: 54896
2008-08-17 17:25:25 +00:00
Chris Lattner
661710bbd1 avoid an extraneous std::string construction
llvm-svn: 54875
2008-08-17 07:24:08 +00:00
Chris Lattner
c0610874cc Rework the routines that convert AP[S]Int into a string. Now, instead of
returning an std::string by value, it fills in a SmallString/SmallVector
passed in.  This significantly reduces string thrashing in some cases.

More specifically, this:
 - Adds an operator<< and a print method for APInt that allows you to 
   directly send them to an ostream.
 - Reimplements APInt::toString to be much simpler and more efficient
   algorithmically in addition to not thrashing strings quite as much.

This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the
asmprinter.  This also fixes a bug I introduced into the asmwriter in a
previous patch w.r.t. alias printing.

llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Chris Lattner
332a173cff avoid string thrashing when formatting names in output. This
speeds up release-asserts llvm-dis on kc++ from 1.86s to 1.04s (~79%)

llvm-svn: 54868
2008-08-17 04:40:13 +00:00
Chris Lattner
ba25bb349e random cleanups.
llvm-svn: 54866
2008-08-17 04:17:45 +00:00
Dale Johannesen
c3d88ff804 Add read/write support for X86's sseregparm.
llvm-svn: 54744
2008-08-13 18:40:23 +00:00
Dan Gohman
51a5eb52c5 Fix the AsmWriter to not print extra spaces after parameter attributes.
llvm-svn: 54351
2008-08-05 15:51:44 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Dale Johannesen
2803c991a5 Prevent a crash in debug dumps.
llvm-svn: 51910
2008-06-03 18:14:29 +00:00
Dan Gohman
06d49b3c5b AsmWriter support for insertvalue/extractvalue. These instructions can
now round-trip through assembly and bitcode.

llvm-svn: 51823
2008-05-31 19:12:39 +00:00
Dale Johannesen
768b6f281e Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.

llvm-svn: 51118
2008-05-14 20:12:51 +00:00
Nate Begeman
b5b1e1353b Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch

llvm-svn: 50985
2008-05-12 19:01:56 +00:00
Dan Gohman
4f0d9d18c3 Update comments.
llvm-svn: 50974
2008-05-12 16:34:30 +00:00
Nick Lewycky
1f831c0f57 Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.

llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Chris Lattner
188b560336 more fallout from Nicholas' asmprinter patch.
llvm-svn: 50078
2008-04-22 02:45:44 +00:00
Chris Lattner
c077c2a4ea another bug introduced in r47802 by nicholas, for no apparent reason.
llvm-svn: 50031
2008-04-21 06:12:55 +00:00
Chris Lattner
26468c09af fix a bug introduced by Nicholas' "unwinds to" stuff: we
lost newlines between blocks.

llvm-svn: 50024
2008-04-21 04:20:33 +00:00
Dale Johannesen
87b88d2a8f Don't read off end of the input array.
llvm-svn: 49799
2008-04-16 17:31:41 +00:00
Anton Korobeynikov
06f3b7f4ee Support chained aliases for LLVM IR printing. This fixes PR2145
llvm-svn: 48684
2008-03-22 08:17:17 +00:00
Chris Lattner
7925cc72c0 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Nick Lewycky
5dd879d5b5 Turn unwind_to into "unwinds to".
llvm-svn: 48123
2008-03-10 02:20:00 +00:00
Devang Patel
a33f4b4cc7 Print types for all ret operands.
llvm-svn: 47911
2008-03-04 22:05:14 +00:00
Nick Lewycky
b02fe64d8b Add an unwind_to field to basic blocks, making them Users instead of Values.
This is the first checkin for PR1269, the new EH infrastructure.

llvm-svn: 47802
2008-03-02 02:48:09 +00:00
Devang Patel
03a99197aa print getresult operand and its type directly.
llvm-svn: 47514
2008-02-23 01:04:26 +00:00
Devang Patel
63d29fccdf Use dyn_cast instead of isa + cast.
llvm-svn: 47511
2008-02-23 00:47:00 +00:00
Devang Patel
f674975a65 To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
llvm-svn: 47508
2008-02-23 00:35:18 +00:00
Dale Johannesen
ae08bdb4cf Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.

llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Devang Patel
066973767f Print getresult instruction properly.
llvm-svn: 47473
2008-02-22 03:10:23 +00:00
Devang Patel
2754d59c53 Print ret instruction that returns aggregates.
llvm-svn: 47472
2008-02-22 02:50:49 +00:00
Dale Johannesen
ecb2b233b1 Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.

llvm-svn: 47342
2008-02-19 21:38:47 +00:00
Dan Gohman
522401f26e Add explicit keywords.
llvm-svn: 46506
2008-01-29 11:36:12 +00:00
Bill Wendling
0ad07f292c Reformatted. It was confusing the other way. No functionality change.
llvm-svn: 46009
2008-01-15 21:16:32 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Christopher Lamb
efdf2791b2 Don't forget to print address space qualifiers when printing out the type table! Thanks to Gordon Henriksen for pointing this out.
llvm-svn: 45147
2007-12-18 03:49:35 +00:00
Christopher Lamb
7368604860 Implement address space attribute for LLVM pointer types. Address spaces are
regions of memory that have a target specific relationship, as described in the 
Embedded C Technical Report. 

This also implements the 2007-12-11-AddressSpaces test, 
which demonstrates how address space attributes can be used in LLVM IR.

In addition, this patch changes the bitcode signature for stores (in a backwards 
compatible manner), such that the pointer type, rather than the pointee type, is 
encoded. This permits type information in the pointer (e.g. address space) to be 
preserved for stores.

LangRef updates are forthcoming.

llvm-svn: 44858
2007-12-11 08:59:05 +00:00
Gordon Henriksen
5d201e0bcc Adding a collector name attribute to Function in the IR. These
methods are new to Function:

  bool hasCollector() const;
  const std::string &getCollector() const;
  void setCollector(const std::string &);
  void clearCollector();

The assembly representation is as such:

  define void @f() gc "shadow-stack" { ...

The implementation uses an on-the-side table to map Functions to 
collector names, such that there is no overhead. A StringPool is 
further used to unique collector names, which are extremely
likely to be unique per process.

llvm-svn: 44769
2007-12-10 03:18:06 +00:00
Duncan Sands
3602011bec Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Chris Lattner
cf741eccd6 print a call to a fastcc function as:
call x86_fastcallcc void @func( i32* %X, i64 0 )
not:
	callx86_fastcallcc  void @func( i32* %X, i64 0 )

This fixes Codegen/X86/fast-cc-merge-stack-adj.ll

llvm-svn: 44217
2007-11-18 18:32:16 +00:00
Dale Johannesen
0ee2a2fb59 Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations.  Make readers and
writers work.  Split constants into 2 doubles in
Legalize.

llvm-svn: 42865
2007-10-11 18:07:22 +00:00
Dale Johannesen
089d2e760f Make temporaries explicit to avoid premature
destruction of compiler-created ones.

llvm-svn: 42383
2007-09-26 23:20:33 +00:00
Dale Johannesen
4784ee3431 Revise previous patch per review comments.
Next round of x87 long double stuff.
Getting close now, basically works.

llvm-svn: 41875
2007-09-12 03:30:33 +00:00
Dale Johannesen
86f367a6b7 Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)

llvm-svn: 41747
2007-09-06 18:13:44 +00:00
Chris Lattner
a92fddf2cc simplify code and print visibility for declarations.
llvm-svn: 41173
2007-08-19 22:15:26 +00:00
Reid Spencer
c60a73917d Reinstate the patch for escaping non-printing characters and allow for
\\ to escape \. All these cases are now handled by the AsmParser.

llvm-svn: 37295
2007-05-22 19:27:35 +00:00
Chris Lattner
1509e17e6c temporarily revert reid's asmwriter patch, it is missing the asmparser piece
that decodes the escape sequences, thus breaking all cases that use them.

This fixes test/Assembler/2007-05-21-Escape.ll

llvm-svn: 37284
2007-05-22 07:00:50 +00:00
Reid Spencer
dbc381aedd Get the order of the hext digits right!
llvm-svn: 37261
2007-05-19 14:44:42 +00:00
Reid Spencer
7170d7ab1b Adjust how LLVM names are produced:
1. Always use % for local and @ for global.
2. Replace NameNeedsQuotes with QuoteNameIfNeeded so that any adjustments
   to the name can be done in one pass.
3. Implement generation of hex escapes so we don't get "wonky" characters
   in the output.

llvm-svn: 37260
2007-05-19 07:25:21 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Anton Korobeynikov
3d95e52ea2 Implement protected visibility. This partly implements PR1363. Linker
should be taught to deal with protected symbols.

llvm-svn: 36565
2007-04-29 18:35:00 +00:00
Anton Korobeynikov
cb2004f82c Implement review feedback
llvm-svn: 36564
2007-04-29 18:02:48 +00:00
Anton Korobeynikov
45162c6dad Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.

llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Chris Lattner
bb09b15fe3 print aliases before functions
llvm-svn: 36459
2007-04-26 02:24:10 +00:00
Anton Korobeynikov
25dc9a61cb Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
will follow.

llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Christopher Lamb
5606cd66e2 PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Reid Spencer
4721577334 For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.

llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Reid Spencer
81070d52da Revert Christopher Lamb's load/store alignment changes.
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Christopher Lamb
b56b6a7ad7 add support for alignment attributes on load/store instructions
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Chris Lattner
0ee78670b8 don't access argument list of prototypes
llvm-svn: 36238
2007-04-18 00:57:22 +00:00
Lauro Ramos Venancio
a76c2806de Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
2792e203c5 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.

llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer
3d414b473d For PR1146:
Adjust writing of parameter attributes to use ParamAttrList class.

llvm-svn: 35808
2007-04-09 06:10:42 +00:00
Reid Spencer
bd89a6ea1c No need to generate the implementation keyword any more. Its frivolous.
llvm-svn: 35405
2007-03-28 01:53:20 +00:00
Dan Gohman
d0a0ea9916 Change uses of Function::front to Function::getEntryBlock for readability.
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Reid Spencer
135ca5e8c4 For PR1258:
Radically simplify the SlotMachine. There is no need to keep Value planes
around any more. This change causes slot numbering to number all un-named,
non-void values starting at 0 and incrementing monotonically through the
function, regardless of type (including BasicBlocks). Getting slot numbers
is now a single lookup operation instead of a double lookup.

llvm-svn: 35171
2007-03-19 18:32:53 +00:00
Reid Spencer
8178fd7bd5 Adjust to changes in the APInt interface.
llvm-svn: 34681
2007-02-27 20:25:25 +00:00
Reid Spencer
b05cb31bdf Allow the AsmWriter to print out arbitrary precision integers.
llvm-svn: 34664
2007-02-27 08:34:09 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer
6af21b3029 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Reid Spencer
da848a64ce Fix a comment that needed to change after SHIFT patch landed.
llvm-svn: 33781
2007-02-02 13:54:55 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Reid Spencer
19af04a142 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Anton Korobeynikov
611d5e2eda Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Reid Spencer
e2ac333854 For PR645:
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.

llvm-svn: 33523
2007-01-26 08:02:52 +00:00
Chris Lattner
b0a126d212 make this more efficient in release builds (time and space)
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner
c5e1611848 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Anton Korobeynikov
548b9af9c2 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Reid Spencer
eeb33c0716 Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Reid Spencer
373d2bccea For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
3d986f6487 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Reid Spencer
c511274dc1 Shut up a warning about signed/unsigned.
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Chris Lattner
6fee172493 simplify some logic further
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner
3147621368 Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.

llvm-svn: 33068
2007-01-11 03:54:27 +00:00
Reid Spencer
d6ed2499db Back out the last patch which is a nightly test killer. The assertion
in getLocalSlot fires on many, many values. It broke nearly all of
the dejagnu tests. Simple changes to the assertion did not fix the
problem.

llvm-svn: 33054
2007-01-10 09:18:16 +00:00
Chris Lattner
bf6aebe720 Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.

llvm-svn: 33053
2007-01-10 07:01:46 +00:00
Chris Lattner
6ee5a4d0d2 eliminate some iterator gymnastics.
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Chris Lattner
af73545299 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner
ef3e9a5ea1 Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!

llvm-svn: 33037
2007-01-09 07:58:11 +00:00
Chris Lattner
ee67a96b5d Split CreateSlot into two versions, one for globals and one for function-local
values

llvm-svn: 33036
2007-01-09 07:55:49 +00:00
Chris Lattner
88c55c3483 Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.

llvm-svn: 33035
2007-01-09 07:46:21 +00:00
Andrew Lenharth
31e7a82bea And asm writing for packed struct initializers
llvm-svn: 33016
2007-01-08 18:21:30 +00:00
Reid Spencer
cdaf88ff9d For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Reid Spencer
4f14887126 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.

llvm-svn: 32904
2007-01-05 17:06:19 +00:00
Reid Spencer
45bed286fa Fix a cut-and-paste bug for processing of InvokeInst parameter attributes.
The lookup of parameter attributes was offset by two because of the
additional operands in an invoke instruction.

llvm-svn: 32801
2006-12-31 22:17:01 +00:00
Reid Spencer
ba137437bf For PR950:
* Change integer type name from signed to signless
* Implement printing of FunctionType parameter attributes.

llvm-svn: 32778
2006-12-31 05:24:50 +00:00
Reid Spencer
38002bb037 For PR950:
Remove all grammar conflicts from assembly parsing.  This change involves:
1. Making the "type" keyword not a primitive type (removes several
   reduce/reduce conflicts)
2. Being more specific about which linkage types are allowed for functions
   and global variables. In particular "appending" can no longer be
   specified for a function. A differentiation was made between the various
   internal and external linkage types.
3. Introduced the "define" keyword which is now required when defining a
   function. This disambiguates several cases where a named function return
   type could get confused with the definition of a new type. Using the
   keyword eliminates all shift/reduce conflicts and the remaining
   reduce/reduce conflicts.

These changes are necessary to implement the function parameter attributes
that will be introduced soon. Adding the function parameter attributes in
the presence of the shift/reduce and reduce/reduce conflicts led to severe
ambiguities that caused the parser to report syntax errors that needed to
be resolved. This patch resolves them.

llvm-svn: 32770
2006-12-29 20:29:48 +00:00
Reid Spencer
812cc9c807 Now that ConstantInt::isValueValidForType can handle signed and unsigned
values regardless of the signedness of the constant's type, it is okay to
always make the AsmWriter.cpp print constant ints as signed values. The
AsmParser will automatically handle things like: uint -1 as a result.

llvm-svn: 32686
2006-12-19 21:16:35 +00:00
Andrew Lenharth
d115fe7ce3 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Bill Wendling
23b8b13c9d Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner
f92de9a3d2 Remove the dead CachedWriter class.
llvm-svn: 32271
2006-12-06 06:40:49 +00:00
Chris Lattner
a428b29cdb printName is almost always true. In the cases that mattered where it was false,
it was effectively set to true by this:

-  if ((PrintName || isa<GlobalValue>(V)) && V->hasName())
+  if (V->hasName())

Delete printname entirely.

llvm-svn: 32265
2006-12-06 06:24:27 +00:00
Chris Lattner
c73d71336d The hasSlot methods are gone.
Remove the 'PrintName' argument to WriteAsOperand, as it is always true.
Only call getOrCreateSlot on things that are valid.

llvm-svn: 32263
2006-12-06 06:15:43 +00:00
Chris Lattner
cc4a08f45b remove unused api, simplify some code
llvm-svn: 32260
2006-12-06 05:55:41 +00:00
Chris Lattner
04357677e5 remove more code that was only used by the bc writer
llvm-svn: 32259
2006-12-06 05:50:41 +00:00
Chris Lattner
9a36bc328e remove dead code left over from when this functionality was shared with the
bcwriter.

llvm-svn: 32258
2006-12-06 05:42:32 +00:00
Chris Lattner
7ee127edad rename createSlot -> getOrCreateSlot.
llvm-svn: 32256
2006-12-06 05:27:40 +00:00
Chris Lattner
8f97b3e24b clean up some sloppy and inconsistent spacing
llvm-svn: 32255
2006-12-06 05:12:21 +00:00
Chris Lattner
74b8045bc5 wrap long lines
llvm-svn: 32254
2006-12-06 04:41:52 +00:00
Reid Spencer
ca27d66971 For PR950: Implement ICmp/FCmp predicate printing for constant expressions
llvm-svn: 32168
2006-12-04 05:19:18 +00:00
Reid Spencer
f78fe29ca8 Shorten the FCmp predicate mnemonics.
llvm-svn: 32150
2006-12-03 06:35:48 +00:00
Reid Spencer
904e41f87e Allow the ICmp and FCmp instructions to be written by the AsmWriter
llvm-svn: 32148
2006-12-03 06:27:29 +00:00
Bill Wendling
aa02717a76 Changed to using LLVM streams.
llvm-svn: 31955
2006-11-28 02:09:03 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Reid Spencer
4bafa71dc1 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Reid Spencer
dd294b507f Make the Value and Type methods print a newline so it prints nicely in gdb
llvm-svn: 31221
2006-10-27 18:58:54 +00:00
Chris Lattner
9e59066602 Change keyword to datalayout
llvm-svn: 31107
2006-10-22 06:06:56 +00:00
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Owen Anderson
12374f766b Add support for the new "target data" information in .ll files. This provides
a better encoding of the targets data layout, rather than trying to guess it
from the endianness and pointersize like before.

llvm-svn: 31030
2006-10-18 02:21:12 +00:00
Chris Lattner
3b8cae29c7 simplify code
llvm-svn: 30655
2006-09-28 22:50:29 +00:00
Anton Korobeynikov
59ef7e94eb Adding codegeneration for StdCall & FastCall calling conventions
llvm-svn: 30549
2006-09-20 22:03:51 +00:00
Anton Korobeynikov
6e19f80688 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Reid Spencer
2567610703 For PR387:
Close out this long standing bug by removing the remaining overloaded
virtual functions in LLVM. The -Woverloaded-virtual option is now turned on.

llvm-svn: 29934
2006-08-28 01:02:49 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
0ad370eeb7 Fix PR885
llvm-svn: 29794
2006-08-21 17:20:01 +00:00
Chris Lattner
7a3f5267c0 Print csretcc calls like this:
call csretcc void %structret( { sbyte }* %P )

instead of this:

        callcsretcc  void %structret( { sbyte }* %P )

llvm-svn: 28412
2006-05-19 21:58:52 +00:00
Chris Lattner
b0af1b89ac pretty print csretcc for calls
llvm-svn: 28410
2006-05-19 21:54:03 +00:00
Chris Lattner
bb961fb9d8 Asmprint csret nicely
llvm-svn: 28408
2006-05-19 21:29:57 +00:00
Chris Lattner
872e3ecaa1 inverted logic, caught by coverity
llvm-svn: 28290
2006-05-14 18:46:52 +00:00
Chris Lattner
14b19acd56 Add shufflevector support, todo, implement better constant folding.
llvm-svn: 27510
2006-04-08 01:18:18 +00:00
Evan Cheng
dd066eac71 Back out my last check-in. Wrong place to fix it.
llvm-svn: 26462
2006-03-01 22:17:00 +00:00
Evan Cheng
25ecfb9411 AsmWriter should not print LLVM constant in comment. Assembler won't like
multi-line comments.

llvm-svn: 26461
2006-03-01 22:00:59 +00:00
Jim Laskey
64fdd3498f Pretty print large struct constants.
llvm-svn: 26400
2006-02-27 10:33:53 +00:00
Jim Laskey
0ba89a0a4c Reverting. Didn't realize some developers were embedding constants in their
target assembler code gen.

llvm-svn: 26383
2006-02-26 10:16:05 +00:00
Jim Laskey
8ad04a557b Format large struct constants for readability.
llvm-svn: 26379
2006-02-25 12:27:03 +00:00
Chris Lattner
b31becf499 Print InlineAsm objects
llvm-svn: 25617
2006-01-25 22:26:05 +00:00
Chris Lattner
d36993d81d Change inline asms to be uniqued like constants, not embedded in a Module.
llvm-svn: 25610
2006-01-25 18:57:27 +00:00
Chris Lattner
50ba79e71b Initial checkin of the InlineAsm class
llvm-svn: 25570
2006-01-24 04:13:11 +00:00
Chris Lattner
c53f8ef744 Pretty print file-scope asm blocks.
llvm-svn: 25568
2006-01-24 00:45:30 +00:00
Chris Lattner
239ebe1535 syntax change
llvm-svn: 25567
2006-01-24 00:40:17 +00:00
Chris Lattner
597ab252ea Print out inline asm strings
llvm-svn: 25556
2006-01-23 23:03:36 +00:00
Chris Lattner
5b42a5ea1a print section info
llvm-svn: 24313
2005-11-12 00:10:19 +00:00
Chris Lattner
6991a6f23f print alignment info for globals and functions
llvm-svn: 24212
2005-11-06 06:48:53 +00:00
Chris Lattner
8eee9a6234 fix printing the alignment directive
llvm-svn: 24197
2005-11-05 21:20:34 +00:00
Nate Begeman
f299b9fb03 Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.

llvm-svn: 24196
2005-11-05 09:21:28 +00:00
Jim Laskey
61e3d7bca5 Culling out use of unions for converting FP to bits and vice versa.
llvm-svn: 22838
2005-08-17 19:34:49 +00:00
Andrew Lenharth
a9214fec08 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Reid Spencer
ba222e3e99 Some cleanups for compilation with GCC 4.0.0 to remove warnings:
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.

llvm-svn: 22057
2005-05-15 16:13:11 +00:00
Chris Lattner
26a44493ef add support for explicit calling conventions
llvm-svn: 21746
2005-05-06 20:26:43 +00:00
Chris Lattner
72ffd7e7d5 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.

llvm-svn: 21722
2005-05-06 05:51:46 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
7a9186cb47 stop using arg_front
llvm-svn: 20599
2005-03-15 05:03:36 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Misha Brukman
5b587350ee Fix the spelling of the word `the'
llvm-svn: 20412
2005-03-02 23:17:31 +00:00
Chris Lattner
f9597dc689 Print the module ID as a comment.
llvm-svn: 20411
2005-03-02 23:12:40 +00:00
Chris Lattner
af54bd6050 Fix some problems where the verifier would crash on invalid input instead of
reporting the problem and exiting.

llvm-svn: 20302
2005-02-24 16:58:29 +00:00
Chris Lattner
343a831bab Fix test/Regression/Assembler/2005-02-09-AsmWriterStoreBug.ll
llvm-svn: 20089
2005-02-09 17:45:03 +00:00
Chris Lattner
1cbca58b87 Update for API change.
llvm-svn: 19960
2005-02-01 01:24:01 +00:00
Chris Lattner
6446c6fb34 To not break TBAA rules, use a union.
llvm-svn: 19280
2005-01-04 01:56:57 +00:00
Alkis Evlogimenos
9b02192468 Fix writer to properly quote label names when they don't contain
simple characters.

llvm-svn: 18744
2004-12-10 05:41:10 +00:00
Chris Lattner
9c390fa13f When printing out a function, make sure that local and global symbols
don't conflict.  This fixes Assembler/2004-12-05-LocalGlobalSymtabConflict.ll

llvm-svn: 18532
2004-12-05 06:44:09 +00:00
Misha Brukman
a3b5e5f569 Remove extra space char
llvm-svn: 17834
2004-11-15 19:30:05 +00:00
Misha Brukman
8d4e1d62dd GhostLinkage not allowed in LLVM AsmWriter, either
llvm-svn: 17751
2004-11-14 21:04:34 +00:00
Chris Lattner
93bf5a8066 Add support for undef and unreachable
llvm-svn: 17041
2004-10-16 18:08:06 +00:00
Reid Spencer
7bd9d86b65 Okay, the list of link-time passes wasn't such a hot idea. Its prone to
error. We'll strategize on this when we have multiple front ends to deal
with. For now llvm-ld just runs a standard set of transforms.

llvm-svn: 16333
2004-09-14 05:43:23 +00:00
Chris Lattner
99d5ceac0d Don't print newlines between passes in the pass list.
Note to self: sentences end with ".", not "...".
Note to reid: sentences end with ".", not "".   :)

llvm-svn: 16332
2004-09-14 05:06:58 +00:00
Chris Lattner
c131f05ebb Don't print newlines between each library in the deplibs list.
llvm-svn: 16331
2004-09-14 04:51:44 +00:00
Reid Spencer
4a1593ebd2 Add support for the link-time pass list to Modules.
llvm-svn: 16321
2004-09-13 23:44:23 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
0c3bada696 Add an assert to cature null Operands. It is better to catch it here than
to SIGSEGV in the bowels of isa<...> later.

llvm-svn: 16098
2004-08-29 19:37:59 +00:00
Reid Spencer
448910c216 Fix a bug found exposed by: Regression/Other/2004-08-20-PackedControlFlow.ll
Packed types need to be allowed in type statements too.

Patch provided by Brad Jones.

llvm-svn: 15953
2004-08-20 15:37:30 +00:00
Brian Gaeke
01636f4e0f Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Reid Spencer
b9ab0ef60d Fix PR422.
Ouch! Changes in the lazy initialization code caused each incorporated
function to reprocess the entire function on every lookup of a value's
slot number. This caused a horrible slowdown in all functions. This
fix made llvm-dis go from "longer than I care to wait" (minutes) on a large
test case to 0.53 seconds.

llvm-svn: 15818
2004-08-16 07:46:33 +00:00
Misha Brukman
8346db7afe Fix #includes of i*.h files => Instructions.h as per PR403
llvm-svn: 15327
2004-07-29 16:53:53 +00:00
Reid Spencer
a23e595275 Avoid use of size(), which counts, in favor of other mechanisms.
llvm-svn: 15221
2004-07-25 21:44:54 +00:00
Reid Spencer
07e3e1c29b Adjust to new Module.h interface for dependent libraries
Only write the target triple and deplibs if they are non-empty.

llvm-svn: 15216
2004-07-25 21:29:43 +00:00
Reid Spencer
9077f12bb0 bug 263:
Add ability to write target triple and dependent libraries information.

llvm-svn: 15211
2004-07-25 18:08:18 +00:00
Reid Spencer
78477eb62b Shrink some code.
llvm-svn: 14956
2004-07-18 01:04:19 +00:00
Reid Spencer
bc38cd572f bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14927
2004-07-17 23:47:01 +00:00
Chris Lattner
94212f7102 Fixes for PR341
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Chris Lattner
183766f21e Make Argument::print more resilient to non-verifiable IR
llvm-svn: 14801
2004-07-13 23:14:34 +00:00
Reid Spencer
93c3d80eb4 Adjust the slot machine to handle Types separately from Values. This was
done by doubling up the data structures so that Type based equivalents are
used. A consequence of this is overloading of function members that take a
Type* instead of a Value*. Various other cleanups related to Type != Value
(bug 122) were also implemented.

llvm-svn: 14613
2004-07-04 11:50:43 +00:00
Chris Lattner
ed76ea9025 Don't call getValueType directly. the LLVM optimizer will turn it into the same code anyway :)
llvm-svn: 14426
2004-06-26 19:40:40 +00:00
Misha Brukman
f12181a902 Use a reference instead of a pointer for the ostream. The pointer was only
there to assist in the development of llvm-tv, and it no longer has a need to
modify the AsmWriter output stream.

llvm-svn: 14304
2004-06-21 21:53:56 +00:00
Chris Lattner
3c61b2dd70 Fix printing of Argument objects, problem found by Patrick Meredith
llvm-svn: 14215
2004-06-18 04:07:20 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
8ca8002f88 Do not dereference end iterators. It's really bad for the asmwriter's health.
This possibly fixes PR370

llvm-svn: 14181
2004-06-15 21:07:32 +00:00
Chris Lattner
75e5aa4d22 Tolerate more errors
llvm-svn: 14104
2004-06-09 22:22:10 +00:00
Chris Lattner
3aa77d0e5e Make the asmwriter much more tolerant of errors (which are common when working
on new front-ends and stuff).  Also get rid of some tabs that snuck in.

llvm-svn: 14100
2004-06-09 19:41:19 +00:00
Reid Spencer
a07033fecd Made it possible for the printInfoComment method to invoke getSlot in
such a way that if the Value being printed is standalone that we don't
assert and abort but just print ":??" for the slot number instead.

llvm-svn: 14097
2004-06-09 15:26:53 +00:00
Chris Lattner
f609ec6329 Squelch a warning
llvm-svn: 14032
2004-06-04 23:53:20 +00:00
Misha Brukman
99137fd27a * No more CachedWriter::setStream()
* ostream is back to being a reference instead of a pointer
* Output single characters as chars, not as length-1 strings

llvm-svn: 14030
2004-06-04 21:11:51 +00:00
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