Devang Patel
98fb10c182
Add prefix only if it is needed.
...
llvm-svn: 79289
2009-08-17 23:17:17 +00:00
Owen Anderson
c7e733e4fe
Privatize the last bits of static type state.
...
llvm-svn: 79258
2009-08-17 17:59:35 +00:00
Owen Anderson
5d27af4989
Move the TypeMap lock to a member on LLVMContextImpl.
...
llvm-svn: 79256
2009-08-17 17:34:27 +00:00
Owen Anderson
43d358bde0
Add locking around the attributes list.
...
llvm-svn: 79255
2009-08-17 17:10:58 +00:00
Chris Lattner
0ed3ef52af
the MinPad argument to PadToColumn only really makes sense to be 1,
...
just remove the argument and replace it with 1.
llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Dan Gohman
1749b4bb8a
Fix printing of instructions with null operands.
...
llvm-svn: 79243
2009-08-17 15:28:08 +00:00
Dan Gohman
6c4c30550e
Always print at least one space before adding a comment.
...
llvm-svn: 79242
2009-08-17 15:27:30 +00:00
Erick Tryzelaar
f9173af0b5
Expose creating constant ints and floats from strings in llvm-c.
...
llvm-svn: 79213
2009-08-16 23:36:46 +00:00
Erick Tryzelaar
d7980d95e8
Add helper functions to ConstantInt and ConstantFP to accept strings.
...
llvm-svn: 79212
2009-08-16 23:36:33 +00:00
Dan Gohman
a7f21f1767
Add a getOffsetOf, for building a target-independent expression for
...
offsetof, similar to getSizeOf for sizeof.
llvm-svn: 79208
2009-08-16 21:26:11 +00:00
Erick Tryzelaar
175dd821cc
Add an llvm-c function that lets you insert an instruction with a name.
...
llvm-svn: 79163
2009-08-16 02:20:57 +00:00
Erick Tryzelaar
c0815ef591
Expose most of the Constant creation functions to llvm-c.
...
llvm-svn: 79160
2009-08-16 02:20:12 +00:00
Erick Tryzelaar
a439c22dbf
Expose most of the rest of IRBuilder's functions to llvm-c.
...
llvm-svn: 79159
2009-08-16 02:19:59 +00:00
Chris Lattner
c807a76334
switch DominanceFrontier::splitBlock to use a smallvector for
...
the pred list instead of a vector, saving a boat load of malloc/free's.
llvm-svn: 79062
2009-08-15 01:39:28 +00:00
Erick Tryzelaar
f5b44db848
Expose LLVMContext to llvm-c.
...
llvm-svn: 78964
2009-08-14 00:01:31 +00:00
Owen Anderson
dc11fe967d
Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
...
llvm-svn: 78955
2009-08-13 23:27:32 +00:00
Dan Gohman
f55822e7cd
Make formatted_raw_ostream restore the buffer settings of the
...
underlying stream when it is finished, so that clients don't
have to do this manually.
llvm-svn: 78952
2009-08-13 23:16:59 +00:00
Dan Gohman
4d57894a63
Take the fast path for any named value and any GlobalValue, which doesn't
...
need TypePrinting despite being a subclass of Constant. This fixes
compile-time problems especially visible on 403.gcc when -asm-verbose is
enabled.
llvm-svn: 78951
2009-08-13 23:07:11 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
d559e66749
Fix a 4x slowdown in llc -asm-verbose caused by the use of
...
WriteAsOperand in more places.
Now that more things are using WriteAsOperand, its behavior of
constructing a TypePrinting object and populating it with strings for all
the numbered types in the Module on each call is a significant bottleneck.
Fancier solutions could be pursued here, but for now, just bypass the
TypePrinting overhead in obvious cases.
llvm-svn: 78906
2009-08-13 15:27:57 +00:00
Dan Gohman
ea15a77701
Change the indentation for LLVM Assembly files from 1 tab to 2 spaces.
...
This is vaguely consistent with LLVM's own source code, but more
importantly it lets more lines stay within 80 columns.
llvm-svn: 78879
2009-08-13 01:41:52 +00:00
Dan Gohman
9c9c3f30bd
Now that numbered types have their number printed, it's no longer
...
interesting to print the number in a comment. Numbered instructions
don't need their number in a comment either.
Also, tidy up newline printing.
llvm-svn: 78865
2009-08-12 23:54:22 +00:00
Dan Gohman
4ee8471442
Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
...
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.
llvm-svn: 78859
2009-08-12 23:32:33 +00:00
Dan Gohman
9b4700f3ce
Make AsmWriter more careful with formatted_raw_ostream so that
...
it doesn't leave the underlying stream in unbuffered mode when
the stream was originally buffered.
Also, change WriteAsOperand back to plain raw_ostream. This
lets it work for either formatted_raw_ostream or plain
raw_ostream, so that it doesn't have to force a buffer flush
on a plain raw_ostream.
llvm-svn: 78837
2009-08-12 20:56:03 +00:00
Dan Gohman
9f80d2be6b
Make LLVM Assembly dramatically easier to read by aligning the comments,
...
using formatted_raw_ostream's PadToColumn.
Before:
bb1: ; preds = %bb
%2 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1]
%6 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1]
After:
bb1: ; preds = %bb
%2 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1]
%6 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1]
Several tests required whitespace adjustments.
llvm-svn: 78816
2009-08-12 17:23:50 +00:00
Dan Gohman
9a6b2f19e5
Remove a bunch more now-unnecessary Context arguments.
...
llvm-svn: 78809
2009-08-12 16:23:25 +00:00
Owen Anderson
dbf9a912fb
Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first.
...
llvm-svn: 78759
2009-08-12 00:36:31 +00:00
Dan Gohman
33d1456220
Simplify this code, and use an in-bounds GEP.
...
llvm-svn: 78755
2009-08-12 00:32:55 +00:00
Owen Anderson
48f2f0ae72
Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
...
the latter is capable of representing either a primitive or an extended type.
llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Dan Gohman
b0c54f532c
Add convenience functions for creating nsw add operators.
...
llvm-svn: 78707
2009-08-11 20:20:39 +00:00
Dan Gohman
76887b6f2b
Don't set the isexact flag if an sdiv operator has been folded into
...
something else.
llvm-svn: 78702
2009-08-11 19:56:00 +00:00
Daniel Dunbar
490f80eb1c
Simplify ConstantExpr::getInBoundsGetElementPtr and fix a possible crash, if
...
constant folding eliminated the GEP instruction.
- clang was hitting this on its test suite (for x86_64, at least).
llvm-svn: 78698
2009-08-11 18:28:09 +00:00
Daniel Dunbar
952aa01cb9
Revert 78680 until I figure out why it completely broke things.
...
llvm-svn: 78697
2009-08-11 18:11:15 +00:00
Devang Patel
df6d338da2
Link NamedMDNodes.
...
llvm-svn: 78696
2009-08-11 18:01:24 +00:00
Dan Gohman
aed57ee5b0
Add convenience functions for creating inbounds GEPs.
...
llvm-svn: 78695
2009-08-11 17:57:01 +00:00
Benjamin Kramer
9a590500ea
Make LLVMContext and LLVMContextImpl classes instead of structs.
...
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Daniel Dunbar
92bda7b2e0
Remove some unnecessary LoadInst constructors, missed during Twinification.
...
llvm-svn: 78689
2009-08-11 17:38:47 +00:00
Dan Gohman
82b3823bb7
Add convenience functions for creating exact sdiv operators, and
...
use them in CreatePtrDiff.
llvm-svn: 78682
2009-08-11 17:05:24 +00:00
Dan Gohman
24939b2c4f
Tidy #includes.
...
llvm-svn: 78677
2009-08-11 16:02:12 +00:00
Dan Gohman
31d5a5e718
Fix a typo in an assertion string.
...
llvm-svn: 78671
2009-08-11 15:53:15 +00:00
Devang Patel
4609ecd4bd
Remove dead metadata.
...
llvm-svn: 78651
2009-08-11 06:31:57 +00:00
Bob Wilson
4a3ccbda6a
Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
...
arguments that are vectors of any size and element type.
llvm-svn: 78631
2009-08-11 01:14:02 +00:00
Devang Patel
d59b85298b
Remove MDNode from ValueMap when MDNode is destroyed.
...
llvm-svn: 78612
2009-08-10 22:59:46 +00:00
Owen Anderson
b4bce99769
Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
...
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Devang Patel
7c51e1fb95
Rename MDNodeSet as MDNodes.
...
llvm-svn: 78607
2009-08-10 22:31:31 +00:00
Daniel Dunbar
d71d99853c
Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.
...
llvm-svn: 78596
2009-08-10 20:56:46 +00:00
Devang Patel
762e9641fd
We are not using FoldingSet for metadata uniquing anymore.
...
llvm-svn: 78585
2009-08-10 18:59:07 +00:00
Benjamin Kramer
2d14670d93
g++ 4.0 doesn't have std::vector::data.
...
llvm-svn: 78579
2009-08-10 18:27:33 +00:00
Owen Anderson
4cd02c843b
Change the MDNode uniquing to a ValueMap, at Devang's request.
...
llvm-svn: 78577
2009-08-10 18:16:08 +00:00
Dan Gohman
1c41d60c4a
Fix a bunch of namespace pollution.
...
llvm-svn: 78363
2009-08-07 01:32:21 +00:00