Nick Lewycky
ee0c1726d8
Force memory use markers to have a ConstantInt for the size argument.
...
llvm-svn: 83960
2009-10-13 07:57:33 +00:00
Chris Lattner
a3cf123e86
strength reduce a ton of type equality tests to check the typeid (Through
...
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.
llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Nick Lewycky
04cea17209
Remove the "metadata*" type and simplify the code it complicated. This was only
...
used to support GlobalVariables storing MDNodes, back when they were derived
from Constant before the introduction of NamedMDNode, but never removed.
llvm-svn: 82943
2009-09-27 23:27:42 +00:00
Victor Hernandez
d2cc74eb2d
No need to verify that malloc's return type is i8*.
...
llvm-svn: 82561
2009-09-22 18:50:03 +00:00
Victor Hernandez
065bc44d01
Update malloc call creation code (AllocType is now the element type of the malloc, not the resulting type).
...
In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants.
Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array.
Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type.
Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls.
Add verification for malloc calls.
Reviewed by Dan Gohman.
llvm-svn: 82257
2009-09-18 19:20:02 +00:00
Nick Lewycky
02986c78c5
Fifth time's a charm! Remove ourselves as abstract type listeners once we've
...
been told that the type is no longer abstract.
llvm-svn: 81749
2009-09-14 02:25:19 +00:00
Nick Lewycky
e38e763387
Don't leak! Always remove oneself as a listener after adding oneself.
...
llvm-svn: 81736
2009-09-14 00:36:52 +00:00
Nick Lewycky
c4bde40e87
Actually remove old types from the set.
...
Also break the type verification stuff into its own TypeSet to keep the
Verifier pass from becoming an AbstractTypeUser.
llvm-svn: 81729
2009-09-13 23:45:39 +00:00
Nick Lewycky
9b6c23aba0
Storing a set of PATypeHolders is a bad idea because their sort order will
...
change as types are refined. Remove abstract types from CheckedTypes when they
we're informed that they have been refined. The only way types get refined in
the verifier is when later function passes start optimizing. Fixes PR4970.
llvm-svn: 81716
2009-09-13 21:07:59 +00:00
Chris Lattner
444bd61976
reject attempts to take the address of an intrinsic, PR4949.
...
llvm-svn: 81530
2009-09-11 17:05:29 +00:00
Nick Lewycky
9cbe7a0090
Hoist out the test+insert to CheckedTypes. This doesn't seem to affect
...
performance.
llvm-svn: 81193
2009-09-08 05:46:15 +00:00
Nick Lewycky
8d3fc4bfab
Simplify from my last change. Assert1 is a macro that makes its caller return,
...
so "Assert1(isa<>); cast<>" is a valid idiom.
Actually check the PHI node's odd-numbered operands for BasicBlock-ness, like
the comment said.
llvm-svn: 81182
2009-09-08 02:02:39 +00:00
Nick Lewycky
5536fa68c5
Verify types. Invalid types can be constructed when assertions are off.
...
Make the verifier more robust by avoiding unprotected cast<> calls. Notably,
Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the program.
llvm-svn: 81179
2009-09-08 01:23:52 +00:00
Nick Lewycky
1528b90211
Express this in the canonical way.
...
llvm-svn: 81157
2009-09-07 21:50:24 +00:00
Nick Lewycky
1bde81d01d
Homogenize whitespace.
...
llvm-svn: 81156
2009-09-07 20:44:51 +00:00
Duncan Sands
750b1f5de2
Public and private corrections, warned about by icc ( #304 ).
...
Patch by Erick Tryzelaar.
llvm-svn: 81107
2009-09-06 08:55:57 +00:00
Gabor Greif
4604e0739b
back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
...
llvm-svn: 80871
2009-09-03 02:02:59 +00:00
Gabor Greif
68c4f27e59
re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Benjamin Kramer
e5458c19a2
Kill off more cerr/cout uses and prune includes a bit.
...
llvm-svn: 79852
2009-08-23 11:37:21 +00:00
Chris Lattner
ea2bfd7a9f
eliminate the std::ostream form of WriteAsOperand and update clients.
...
This also updates dominator related stuff.
llvm-svn: 79825
2009-08-23 05:17:37 +00:00
Chris Lattner
2d541e612d
switch a couple things off std::ostream
...
llvm-svn: 79816
2009-08-23 04:02:03 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +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
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
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
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
Chris Lattner
94f55a81bd
common globals may also not be marked constant.
...
llvm-svn: 78169
2009-08-05 05:41:44 +00:00
Chris Lattner
19d238562d
Clarify common linkage and the requirements on it. Enforce
...
them in the verifier.
llvm-svn: 78160
2009-08-05 05:21:07 +00:00
Nate Begeman
72315231bc
Typo
...
llvm-svn: 77568
2009-07-30 02:00:06 +00:00
Owen Anderson
881d928f9b
Move types back to the 2.5 API.
...
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Bob Wilson
2f023d87ee
Fix an assumption that there is a single return value when verifying
...
overloaded types for intrinsic parameters.
llvm-svn: 77466
2009-07-29 16:25:56 +00:00
Devang Patel
cb23671431
Rename MDNode.h header. It defines MDnode and other metadata classes.
...
New name is Metadata.h.
llvm-svn: 77370
2009-07-28 21:49:47 +00:00
Daniel Dunbar
251177c96e
Initial update to VMCore to use Twines for string arguments.
...
- The only meat here is in Value.{h,cpp} the rest is essential 'const
std::string &' -> 'const Twine &'.
llvm-svn: 77048
2009-07-25 04:41:11 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Torok Edwin
f955a6ef49
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
...
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin
ae8a3ff177
assert(0) -> LLVM_UNREACHABLE.
...
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Owen Anderson
8970999512
Thread LLVMContext through MVT and related parts of SDISel.
...
llvm-svn: 75153
2009-07-09 17:57:24 +00:00
Torok Edwin
358888da3a
Implement changes from Chris's feedback.
...
Finish converting lib/Target.
llvm-svn: 75043
2009-07-08 20:53:28 +00:00
Torok Edwin
ad3be984b7
Start converting to new error handling API.
...
cerr+abort -> llvm_report_error
assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included)
llvm-svn: 75018
2009-07-08 18:01:40 +00:00
Dan Gohman
2e737ac21f
Support vector casts in more places, fixing a variety of assertion
...
failures.
To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.
Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.
llvm-svn: 73431
2009-06-15 22:12:54 +00:00
Duncan Sands
9b5e3effef
Cosmetic changes to parameter attribute verification.
...
llvm-svn: 73188
2009-06-11 08:11:03 +00:00
Nick Lewycky
a96000f2bf
Remove cyclic MDNode detection. Any attempt to create a cyclic MDNode will
...
crash LLVM first.
llvm-svn: 73011
2009-06-07 04:03:01 +00:00
Dan Gohman
23c22e9da0
Fix a copy+pasto in an assertion string that Jay Foad noticed.
...
llvm-svn: 72953
2009-06-05 18:34:16 +00:00
Dan Gohman
947f4aca22
Update the Verifier to be aware of the difference between Add and FAdd, etc.
...
llvm-svn: 72946
2009-06-05 16:10:00 +00:00
Nick Lewycky
a9de2f1c81
Give embedded metadata its own type instead of relying on EmptyStructTy.
...
llvm-svn: 72610
2009-05-30 05:06:04 +00:00
Bill Wendling
8235a05c1a
Untabification.
...
llvm-svn: 72604
2009-05-30 01:09:53 +00:00
Duncan Sands
f4fe76d46b
Dan noticed that the verifier wasn't thoroughly checking uses of
...
invoke results (see the testcases). Tighten up the checking.
llvm-svn: 72586
2009-05-29 19:39:36 +00:00
Torok Edwin
9b75edbd14
Revert this. There's no way to verifiy indirect calls, and an optimizer can turn
...
indirect call into direct call, thus the verifier would reject something it
previously accepted.
llvm-svn: 72249
2009-05-22 07:12:05 +00:00
Torok Edwin
8c1af7f5be
Verify that calling conventions match function prototype.
...
This only rejects mismatches between target specific calling convention
and C/LLVM specific calling convention.
There are too many fastcc/C, coldcc/cc42 mismatches in the testsuite, these are
not reject by the verifier.
llvm-svn: 72248
2009-05-22 06:41:43 +00:00
Bill Wendling
eb4b041ea1
Needed #includes. Thanks Fritz van Bommel!
...
llvm-svn: 71413
2009-05-10 23:27:41 +00:00