Commit Graph

553 Commits

Author SHA1 Message Date
Anton Korobeynikov
ded05e34b6 Add support for thiscall calling convention.
Patch by Charles Davis and Steven Watanabe!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-16 09:08:45 +00:00
Chris Lattner
fd450c026a fix PR7105 by enumerating MDNodes on all @llvm.foo
function calls, not just recognized intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:53:17 +00:00
Dan Gohman
66797ff2e1 Minimally fix this code to not abort on mdnodes with integer data
wider than 64 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 22:15:24 +00:00
Eric Christopher
551754c495 Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:37:20 +00:00
Gabor Greif
4ec2258ffb reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 15:33:14 +00:00
Gabor Greif
607a7ab3da back out r101423 and r101397, they break llvm-gcc self-host on darwin10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 01:16:20 +00:00
Gabor Greif
2ff961f668 reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 20:51:13 +00:00
Gabor Greif
9ee1720811 back out r101364, as it trips the linux nightlybot on some clang C++ tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 12:46:56 +00:00
Gabor Greif
165dac08d1 rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 10:49:53 +00:00
Dan Gohman
29e13e0c18 Print empty structs as {} rather than { }.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:03:05 +00:00
Gabor Greif
44424646ac rename pred_const_iterator to const_pred_iterator for consistency's sake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 23:25:28 +00:00
Gabor Greif
c9f7500d17 Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.

Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 13:21:49 +00:00
Gabor Greif
1cde4af157 backing out r99170 because it still fails on clang-x86_64-darwin10-fnt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 09:11:00 +00:00
Gabor Greif
9b1061e2e3 Now that hopefully all direct accesses to InvokeInst operands are fixed
we can reapply the InvokeInst operand reordering patch. (see r98957).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 08:28:00 +00:00
Gabor Greif
cc52ed0c4f back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 13:50:02 +00:00
Gabor Greif
f4f10e3779 Recommit r80858 again (which has been backed out in r80871).
This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.

Maybe the valgrind bots give me a hint of what may be wrong
(it at all).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 11:55:53 +00:00
Chris Lattner
94c484d3b8 add asmprinter suport for unions, fixing Feature/unions.ll to actually
be doing something useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98677 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:21:35 +00:00
Erick Tryzelaar
f3d5c91550 Fix looking up MD names to not need a module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 05:32:52 +00:00
Nick Lewycky
fa0c54e3b8 Dump the presence of attached metadata even if we don't know what it is. This
format is not parsable, even if the module is legal. To get parsable output,
dump the module instead of the function or smaller, since metadata kind are
attached to the module (not the context).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 06:53:04 +00:00
Duncan Sands
47c5188789 Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
methods to try to have the type predicates be more logically positioned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 14:50:09 +00:00
Duncan Sands
1df9859c40 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 11:11:14 +00:00
Duncan Sands
b0bc6c361d Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 16:12:20 +00:00
Chris Lattner
fdfeb6976f Add support for a union type in LLVM IR. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 20:49:41 +00:00
Dan Gohman
659d1e8bbb Minor whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 20:42:57 +00:00
Dan Gohman
7a5666e7f3 Add a hook to AssemblyAnnotationWriter to allow custom info comments
to be printed, in place of the familiar "uses=" comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 20:41:46 +00:00
Dan Gohman
4483c7b15a Print a comment next to "materializable" global values, to distinguish
them from values that are not actually defined in the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 23:12:36 +00:00
Benjamin Kramer
5908839ced Convert some users of ftostr to raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 14:42:22 +00:00
Jeffrey Yasskin
f0356fe140 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:34:15 +00:00
Victor Hernandez
8fffff5371 Refactor common parts of MDNode::getFunction() and assertLocalFunction() into getFunctionForValue()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 04:45:57 +00:00
Victor Hernandez
38812dff7d Make printing of metadata more robust when function is not found (which is the normal situation for non function-local metadata)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93748 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 19:15:57 +00:00
Victor Hernandez
559588b156 Fix printing of function-local metadata in AsmWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 01:47:37 +00:00
Dale Johannesen
5f72a5ebc8 Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:00:24 +00:00
Devang Patel
69d02e0a17 Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 21:47:32 +00:00
Benjamin Kramer
11acaa374c Convert a ton of simple integer type equality tests to the new predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:07:06 +00:00
David Greene
d865e02ea2 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:26 +00:00
Chris Lattner
dbe85bffd7 fix refactoro
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 08:23:09 +00:00
Chris Lattner
c65b72ca26 use early exits to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:33:14 +00:00
Chris Lattner
85b1912dba eliminate another copy of the mdnode printing logic, simplify the
one that remains.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:31:59 +00:00
Chris Lattner
2b4b1e2e60 random tidying for MDNode printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:27:30 +00:00
Chris Lattner
bd72b3201b eliminate a bunch of useless forwarding functions with one caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92332 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:23:35 +00:00
Chris Lattner
307c9893fc make mdnMap type safe, rename accessors for consistency with the rest of llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92331 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:20:11 +00:00
Chris Lattner
51ea55f0ec metadata can't be a global var initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92330 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:15:45 +00:00
Chris Lattner
6e6b1805da simplify mdnode printing logic. Now N->dump() only
dumps one node instead of all of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 02:13:35 +00:00
Chris Lattner
fdb3356477 unify two copies of the NamedMDNode printing code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:54:05 +00:00
Chris Lattner
7d054b385f fix printing of function-local metadata to print all the operands of the
mdnode, not just operand 0 over and over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:44:44 +00:00
Chris Lattner
4a3d3a54eb simplify printing of mdstring and Argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:41:14 +00:00
Chris Lattner
38cf02ebc9 simplify asmprinting of NamedMDNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:36:50 +00:00
Chris Lattner
5d0cacdbb6 rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:22:29 +00:00
Chris Lattner
837eda93ee Do not crash when .ll printing metadata that smells like debug info, but isn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 21:17:33 +00:00
Chris Lattner
081134741b Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:01:33 +00:00