Commit Graph

39 Commits

Author SHA1 Message Date
Chris Lattner
db125cfaf5 land David Blaikie's patch to de-constify Type, with a few tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 04:54:35 +00:00
Chris Lattner
c1d414ad71 deconstify getType()'s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135323 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 23:15:45 +00:00
Chris Lattner
1afcace3a3 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:24 +00:00
Eric Christopher
ec281c8934 Another possible bug. Stopgap until we can autogenerate tables and
constraint lengths.

Part of rdar://9037836 and rdar://9119939



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132598 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 22:09:12 +00:00
Eric Christopher
ce1ecf59c8 Fix an off by one error.
Part of rdar://9037836 and rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 20:44:52 +00:00
Eric Christopher
5fab03d54c Add a new parse hint for multi-letter constraints in inline asm.
Testcase will come when we use it.

Part of rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132476 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 19:26:37 +00:00
Dale Johannesen
1aabe1b493 Apply patch for use-after-free in InlineAsm constant handling,
PR 8522 / 8616046.  Test reduction, analysis and patch by Tim Deegan!
(However, review by someone who understands the classes here better
is welcome.  John Krum will return!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:59:27 +00:00
John Thompson
44ab89eb37 Inline asm multiple alternative constraints development phase 2 - improved basic logic, added initial platform support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:29:13 +00:00
Eric Christopher
3ec73169a3 Silence some constructor ordering warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:25:05 +00:00
John Thompson
eac6e1d0c7 Added skeleton for inline asm multiple alternative constraint support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:15:37 +00:00
Benjamin Kramer
82d5baec32 Reduce string trashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-25 23:18:32 +00:00
Jeffrey Yasskin
bf48a9b6db Memoize InlineAsms into the LLVMContext and delete them on shutdown.
Fixes PR803.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 20:37:19 +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
Benjamin Kramer
f012705c7e Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 13:12:22 +00:00
Daniel Dunbar
2928c83b01 Pass StringRef by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 10:58:06 +00:00
Dale Johannesen
8ba2d5befc Rename msasm to alignstack per review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:28:00 +00:00
Dale Johannesen
4360298d2b Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible.  No functional change yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:46:56 +00:00
Owen Anderson
1d0be15f89 Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Daniel Dunbar
92ccf70ad4 Finish migrating VMCore to StringRef/Twine based APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 06:02:13 +00:00
Chris Lattner
6bdcda3d3e Keep track of *which* input constraint matches an output
constraint.  Reject asms where an output has multiple
input constraints tied to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 16:47:46 +00:00
Chris Lattner
ea21ad4926 Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here: 
test/CodeGen/X86/asm-indirect-mem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 04:46:38 +00:00
Chris Lattner
96bb622646 Allow asms to return multiple results by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:33:55 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Chris Lattner
e395598c98 remove a dead annotation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 19:04:24 +00:00
Christopher Lamb
43ad6b3e0d Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 01:12:55 +00:00
Gordon Henriksen
afba8fe662 Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 02:14:30 +00:00
Gordon Henriksen
ed455c8fa2 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 22:46:10 +00:00
Chris Lattner
73d0d0d4b8 represent indirect operands explicitly in inline asm strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36522 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-28 01:02:58 +00:00
Reid Spencer
af303d53e6 For PR780:
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o
2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage
3. Make each of the tools with --load options include LinkAllVMCore.h
This should be the last set of changes for this bug and 800.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28719 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 23:03:13 +00:00
Chris Lattner
3bdac5171b Add a virtual dtor to the InlineAsm class so that the principle method of
the class can be defined in InlineAsm.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28718 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 22:47:44 +00:00
Chris Lattner
fe3db46fe0 Parse the %*# constraint modifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26341 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-23 23:36:53 +00:00
Chris Lattner
2f0eec6520 validate matching constraints and remember when we see them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25892 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-02 00:23:53 +00:00
Jeff Cohen
09f0bd39b1 Fix VC++ compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25869 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 04:37:04 +00:00
Chris Lattner
a55079a5cc Beef up the interface to inline asm constraint parsing, making it more general, useful, and easier to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25866 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 01:29:47 +00:00
Chris Lattner
f0b415f178 add method for constraint parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25637 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 02:21:59 +00:00
Chris Lattner
3b91778659 parse and verify the constraint string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25631 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 00:48:33 +00:00
Chris Lattner
80cd115618 Print InlineAsm objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25617 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 22:26:05 +00:00
Chris Lattner
863517aea0 Change inline asms to be uniqued like constants, not embedded in a Module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 18:57:27 +00:00
Chris Lattner
cc041ba03a Initial checkin of the InlineAsm class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25570 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 04:13:11 +00:00