Dan Gohman
2140a74979
Eliminate the restriction that the array size in an alloca must be i32.
...
This will help reduce the amount of casting required on 64-bit targets.
llvm-svn: 104911
2010-05-28 01:14:11 +00:00
Anton Korobeynikov
8f35fabbc1
Add support for thiscall calling convention.
...
Patch by Charles Davis and Steven Watanabe!
llvm-svn: 103902
2010-05-16 09:08:45 +00:00
Dan Gohman
a2414ea190
Remove the API compatibility layer which converted add, sub, and mul
...
to fadd, fsub, and fmul, when used with a floating-point type. LLVM
has supported the new instructions since 2.6, so it's time to get
on board.
llvm-svn: 102971
2010-05-03 22:44:19 +00:00
Chris Lattner
95b0ff445c
reject invalid comma stuff with a message. We reject the case in
...
PR6888 with:
$ llvm-as t.ll
llvm-as: t.ll:2:29: error: expected metadata or 'align'
store <3 x i32> %x, i32 1, i32 1>, <3 x i32>* %p
^
instead of:
$ llvm-as t.ll
llvm-as:
llvm-svn: 102154
2010-04-23 00:50:50 +00:00
Chris Lattner
c239eb79bd
reapply 'reject forward references to functions whose type don't match'
...
now that the testsuite has been updated.
llvm-svn: 101866
2010-04-20 04:49:11 +00:00
Daniel Dunbar
c459a0ff81
Revert "reject forward references to functions whose type don't match", because DJG told me to!
...
llvm-svn: 101675
2010-04-17 21:24:55 +00:00
Chris Lattner
5a44950aae
reject forward references to functions whose type don't match
...
up with the definition (and fix a broken testcase). PR6491.
llvm-svn: 101670
2010-04-17 20:45:56 +00:00
Chris Lattner
f60b74806f
turn an assert into a proper check, fixing crash on invalid here:
...
$ llvm-as t.ll
llvm-as: t.ll:1:6: error: expected 'type' after '='
%0 = = type { i32, float, float, double }
^
PR6810.
llvm-svn: 100934
2010-04-10 18:01:25 +00:00
Chris Lattner
2e664bd915
fix a crash on invalid metadata, e.g.: call i32 @foo(), XXXX
...
We would return the error without inserting the new instruction
into the program, so it wouldn't get deallocated, and an abort
would trigger when the module was deleted.
llvm-svn: 100602
2010-04-07 04:08:57 +00:00
Chris Lattner
8eff0157b2
rewrite handling of forward ref'd instruction metadata
...
to used deferred resolution instead of creating a temporary
node + rauw. There is no reason to create the temporary
mdnode, then do rauw, then destroy it.
llvm-svn: 100086
2010-04-01 05:14:45 +00:00
Chris Lattner
ef0ec99665
eliminate a temporary smallvector
...
llvm-svn: 100082
2010-04-01 04:51:13 +00:00
Duncan Sands
cbd43f89ac
Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
...
methods to try to have the type predicates be more logically positioned.
llvm-svn: 96349
2010-02-16 14:50:09 +00:00
Duncan Sands
19d0b47b1f
There are two ways of checking for a given type, for example isa<PointerType>(T)
...
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.
llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Duncan Sands
9dff9bec31
Uniformize the names of type predicates: rather than having isFloatTy and
...
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner
392be58cad
Add support for a union type in LLVM IR. Patch by Talin!
...
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Charles Davis
be5557e86b
Add a new function attribute, 'alignstack'. It will indicate (when the backends
...
implement support for it) that the stack should be forcibly realigned in the
prologue (and the process reversed in the epilogue).
llvm-svn: 95945
2010-02-12 00:31:15 +00:00
Jakob Stoklund Olesen
74bb06c0f0
Reintroduce the InlineHint function attribute.
...
This time it's for real! I am going to hook this up in the frontends as well.
The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.
We need some experiments to determine if that is the right thing to do.
llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Jeffrey Yasskin
091217be6f
Kill ModuleProvider and ghost linkage by inverting the relationship between
...
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.
Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods. The bindings to
other languages still use the ModuleProvider concept. It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.
Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735 .
llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Eric Christopher
8444d7536c
Remove the InlineHint attribute. There are no current or planned
...
users.
llvm-svn: 93558
2010-01-15 21:36:30 +00:00
Victor Hernandez
9d75c966e0
Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work
...
llvm-svn: 93197
2010-01-11 22:31:58 +00:00
Victor Hernandez
b8fd152d94
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
...
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().
llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Chris Lattner
bbddd96406
fix PR5983, reject function bodies with no blocks per the grammar.
...
llvm-svn: 93067
2010-01-09 19:20:07 +00:00
Victor Hernandez
127286c58b
When parsing function-local metadata, create a function-local MDNode
...
llvm-svn: 92838
2010-01-06 17:00:21 +00:00
Victor Hernandez
dc6e65a6a8
Re-add parsing of function-local metadata; this time with testcase.
...
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Devang Patel
6edcd3994c
Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1 , null}
...
llvm-svn: 92783
2010-01-05 21:47:32 +00:00
Benjamin Kramer
d2564e3afb
Move remaining stuff to the isInteger predicate.
...
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Devang Patel
e307348325
NamedMDNode is a collection MDNodes.
...
llvm-svn: 92761
2010-01-05 20:41:31 +00:00
Benjamin Kramer
ccce8bae14
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
...
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
Chris Lattner
16bafa6f14
remove some fixme's
...
llvm-svn: 92304
2009-12-30 06:00:36 +00:00
Chris Lattner
94b9c5a73b
now that instruction metadata is only parsed in one place, eliminate the
...
parser-global MDsOnInst vector and make ParseInstructionMetadata return
its result by-ref through an argument like the entire rest of the parser.
llvm-svn: 92302
2009-12-30 05:48:36 +00:00
Chris Lattner
b2f3950da7
reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctly
...
handle the comma case for metadata.
llvm-svn: 92301
2009-12-30 05:44:30 +00:00
Chris Lattner
5c42763452
rename ParseOptionalCustomMetadata -> ParseInstructionMetadata,
...
and make it non-optional. This fixes the bug where we'd accept
and ignore a spurious comma after some instructions.
llvm-svn: 92300
2009-12-30 05:31:19 +00:00
Chris Lattner
f4f0342b08
convert 4 more instructions over.
...
llvm-svn: 92299
2009-12-30 05:27:33 +00:00
Chris Lattner
77b89dc58b
add facilities to start factoring instruction metadata parsing
...
out of each opcode's handler. Change ret over so far.
llvm-svn: 92298
2009-12-30 05:23:43 +00:00
Chris Lattner
28f1eebe3e
reimplement insertvalue/extractvalue metadata handling to not blindly
...
accept invalid input. Actually add a testcase.
llvm-svn: 92297
2009-12-30 05:14:00 +00:00
Chris Lattner
bafee45d2c
remove two bogus calls that accepted metadata in the middle of insert/extract value
...
*constant exprs*.
llvm-svn: 92296
2009-12-30 05:04:46 +00:00
Chris Lattner
eafe4de021
rename NamedOrCustomMD -> MetadataVar to follow conventions of all the rest of the code.
...
llvm-svn: 92295
2009-12-30 05:02:06 +00:00
Chris Lattner
1eed2d65c0
rename lltok::Metadata -> lltok::exclaim. We name tokens
...
after their syntactic form, not their semantic form.
llvm-svn: 92294
2009-12-30 04:56:59 +00:00
Chris Lattner
fc58af26d5
rename MetadataCache -> NumberedMetadata to follow the convention
...
used by other things. Convert it to a vector since it is a dense
numbering.
llvm-svn: 92293
2009-12-30 04:51:58 +00:00
Chris Lattner
a01ddfc2a3
rewrite ParseMDNodeVector to follow the normal patter used in the .ll parser.
...
llvm-svn: 92292
2009-12-30 04:42:57 +00:00
Chris Lattner
6dac02a4f7
rename ParseMDNode -> ParseMDNodeID, since it parses !42 , not !{... } as you'd expect.
...
llvm-svn: 92291
2009-12-30 04:15:23 +00:00
Chris Lattner
0f3bb7b25e
fix parsing of mdstring values.
...
llvm-svn: 92290
2009-12-30 04:13:37 +00:00
Chris Lattner
95471e49c5
remove the code added in r90497. It has several major issues and no tests.
...
llvm-svn: 92288
2009-12-30 02:20:07 +00:00
Chris Lattner
5b4a962bdd
split t_Metadata into t_MDNode and t_MDString, eliminating some unsafe casting.
...
llvm-svn: 92287
2009-12-30 02:11:14 +00:00
Chris Lattner
278bc953bc
factor code even more.
...
llvm-svn: 92280
2009-12-29 22:40:21 +00:00
Chris Lattner
f2fe7fffab
simplify some code and unbreak the build by not consuming an
...
extra token.
llvm-svn: 92279
2009-12-29 22:35:39 +00:00
Benjamin Kramer
84dd9a3d28
remove a really wrong parenthesis.
...
llvm-svn: 92277
2009-12-29 22:17:06 +00:00
Chris Lattner
1c6b864abe
clean up some really strange code.
...
llvm-svn: 92275
2009-12-29 22:01:50 +00:00
Chris Lattner
1797fc7009
change ParseMDString and ParseMDNode to take arguments of the right type.
...
This exposed a raft of other problems, which I'll deal with in subsequent
patches.
llvm-svn: 92273
2009-12-29 21:53:55 +00:00
Chris Lattner
218b22f33b
switch to TrackingVH instead of WeakVH, since these can never
...
be RAUW'd and go to null. This also gets us some sorely lacking
type safety.
llvm-svn: 92272
2009-12-29 21:43:58 +00:00