Commit Graph

3352 Commits

Author SHA1 Message Date
David Greene
6892c7a92d Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:09 +00:00
David Greene
efc258146d Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:06 +00:00
David Greene
840d41e7d1 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:04 +00:00
David Greene
170c48af5a Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:02 +00:00
David Greene
43078d6931 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92659 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:00 +00:00
David Greene
ef1894ed7e Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92658 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:58 +00:00
David Greene
fc524526e4 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:55 +00:00
David Greene
c0a6a2afcb Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:39 +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
David Greene
d2e63b7fdb Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:19 +00:00
David Greene
4b12168ce5 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:14 +00:00
Devang Patel
44a29e066a Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start 
 Intrinsic::dbg_region_end 
 Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:10:40 +00:00
Dan Gohman
7ba4e17285 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 18:38:39 +00:00
Chris Lattner
fa5dd977e4 it isn't safe to speculative load from a malloc, it might have
returned null, and may not have been big enough in any case.  
Thanks to Jay Foad for pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-03 18:14:24 +00:00
Chris Lattner
5099b31f98 differences between two blockaddress's don't cause a
global variable initializer to require relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-03 18:09:40 +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
183912af79 Remove #include of metadata.h from intrinsicinst.h. The only
method that needs it (DbgValueInst::getValue) has been moved out
of line.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:32:41 +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
b76359e36e Optimize MDNode to coallocate the operand list immediately
after the MDNode in memory.  This eliminates the operands
pointer and saves a new[] per node.

Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary.  A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related!  Debug info should use something non-mdnode for
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:05:46 +00:00
Chris Lattner
54a1f9f9c1 do not bother reuniquing mdnodes whose operands drop to null. Doing
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway.  This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g

from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 21:42:11 +00:00
Chris Lattner
83738a20dd remove some misleading comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 20:25:09 +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
Chris Lattner
b17f65829c privatize another interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:56:15 +00:00
Chris Lattner
44f3d23b60 the only call to this function (from clang) has been removed, zap it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:50:09 +00:00
Chris Lattner
508b19a5a4 remove some unneeded Metadata interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:44:16 +00:00
Chris Lattner
4ee93c4303 tidy up debug info comments, use ->isVoidTy() where reasonable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:25:48 +00:00
Chris Lattner
a43a3f2379 When doing v1->RAUW(v2), don't do anything to metadata. We don't know
why one was replaced with the other.  Even in the specific case of 
debug information, it doesn't make sense to transfer the location over,
this will just result in jumbled loc info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:53:52 +00:00
Chris Lattner
b2406d9895 sink the Instruction::HasMetadata bit into SubclassData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:46:09 +00:00
Chris Lattner
cafe9bba32 add a layer of accessors around the Value::SubClassData member, and use
a convention (shadowing the setter with private forwarding function) to
prevent subclasses from accidentally using it.

This exposed some bogosity in ConstantExprs, which was propaging the
opcode of the constant expr into the NUW/NSW/Exact field in the
getWithOperands/getWithOperandReplaced methods.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:14:09 +00:00
Chris Lattner
3990b121cf This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27.  Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().

This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte.  Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.

This also fixes some confusion in getMDs and its clients about 
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.

This introduces a number of fixme's which I'll follow up on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 23:41:32 +00:00
Chris Lattner
0f15a59862 add IRBuilder.cpp to cmake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:52:41 +00:00
Chris Lattner
2ad32752b9 remove #include of Function.h from IRBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:50:56 +00:00
Chris Lattner
43469b6957 move debug info stuff out of line, allowing two #includes
to go away from IRBuilder.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:45:40 +00:00
Chris Lattner
a53cfd16f0 split code that doesn't need to be templated out of IRBuilder into a new
non-templated IRBuilderBase class.  Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:28:46 +00:00
Chris Lattner
0eb419800a rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind.  Tidy up a bunch
of random stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 20:45:51 +00:00
Chris Lattner
7d05c46d60 rename getHandlerNames to getMDKindNames, simplify its interface
and simplify all the clients that use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 20:10:43 +00:00
Chris Lattner
06ac32cc86 tidy up and delete a dead smallvector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92223 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 19:49:00 +00:00
Chris Lattner
df58389ef1 avoid a completely unneeded linear walk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 09:32:10 +00:00