1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

55399 Commits

Author SHA1 Message Date
Chris Lattner
c42b8ff24e fix parsing of mdstring values.
llvm-svn: 92290
2009-12-30 04:13:37 +00:00
Chris Lattner
41a3666fc1 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
4f406c8c74 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
c549263f8a factor code even more.
llvm-svn: 92280
2009-12-29 22:40:21 +00:00
Chris Lattner
4dd14b6835 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
aa342be382 remove a really wrong parenthesis.
llvm-svn: 92277
2009-12-29 22:17:06 +00:00
Chris Lattner
66fa49bda4 clean up some really strange code.
llvm-svn: 92275
2009-12-29 22:01:50 +00:00
Chris Lattner
4803e84704 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
bfd6a6f096 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
Chris Lattner
c6b925c592 Each instruction is allowed to have *multiple* different
metadata objects on them.  Though the entire compiler supports this,
the asmparser didn't.

llvm-svn: 92270
2009-12-29 21:25:40 +00:00
Chris Lattner
86c74f4783 Do not crash when .ll printing metadata that smells like debug info, but isn't.
llvm-svn: 92268
2009-12-29 21:17:33 +00:00
Chris Lattner
baa1820ccb fix indentation, fit in 80 cols.
llvm-svn: 92267
2009-12-29 21:09:57 +00:00
Benjamin Kramer
1d24aae2db Replace a few more SmallVectors with arrays.
llvm-svn: 92265
2009-12-29 16:57:26 +00:00
Benjamin Kramer
e59de5e9b0 Use an array instead of a SmallVector.
llvm-svn: 92264
2009-12-29 11:04:52 +00:00
Chris Lattner
d981b3fc91 remove a bunch of unneeded functions.
llvm-svn: 92263
2009-12-29 09:32:19 +00:00
Chris Lattner
430379c2d5 major cleanups, much of this file was incorrectly indented.
llvm-svn: 92262
2009-12-29 09:22:47 +00:00
Chris Lattner
f0034478f8 one pass of cleanup over DebugInfo.h. Much more is still needed.
llvm-svn: 92261
2009-12-29 09:15:46 +00:00
Chris Lattner
31895ba512 prune #includes.
llvm-svn: 92260
2009-12-29 09:12:29 +00:00
Chris Lattner
84e9de4a58 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.

llvm-svn: 92259
2009-12-29 09:01:33 +00:00
Chris Lattner
6848ea84ec just cleanup.
llvm-svn: 92258
2009-12-29 08:06:56 +00:00
Chris Lattner
a78c161348 remove useless argument.
llvm-svn: 92256
2009-12-29 08:03:58 +00:00
Chris Lattner
fde39fb4f6 privatize another interface.
llvm-svn: 92255
2009-12-29 07:56:15 +00:00
Chris Lattner
c39498971e the only call to this function (from clang) has been removed, zap it.
llvm-svn: 92254
2009-12-29 07:50:09 +00:00
Chris Lattner
dcc5032728 remove some unneeded Metadata interfaces.
llvm-svn: 92252
2009-12-29 07:44:16 +00:00
Chris Lattner
20668429a2 fix .cpp file to not wrap the entire file in namespace blocks.
llvm-svn: 92250
2009-12-29 07:28:33 +00:00
Chris Lattner
110fc20bd8 tidy up debug info comments, use ->isVoidTy() where reasonable.
llvm-svn: 92249
2009-12-29 07:25:48 +00:00
Chris Lattner
1c7e595a47 sink twine.h down out of Value.h. It is annoying that you need
to #include Twine.h just to give a twine a default value.

llvm-svn: 92247
2009-12-29 07:12:03 +00:00
Sanjiv Gupta
543a6716fb Extern declaration for unordered.f32 libcall was not being emitted. Fixed that.
llvm-svn: 92242
2009-12-29 03:24:34 +00:00
Chris Lattner
e7990f78bf 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.

llvm-svn: 92241
2009-12-29 02:53:52 +00:00
Chris Lattner
692c53dbf0 sink the Instruction::HasMetadata bit into SubclassData.
llvm-svn: 92240
2009-12-29 02:46:09 +00:00
Chris Lattner
2c82be93e6 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.

llvm-svn: 92239
2009-12-29 02:14:09 +00:00
Chris Lattner
9ec640a902 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.

llvm-svn: 92235
2009-12-28 23:41:32 +00:00
Chris Lattner
cb59c59db8 rearrange some code.
llvm-svn: 92234
2009-12-28 21:56:07 +00:00
Chris Lattner
8ca10b9e64 add IRBuilder.cpp to cmake
llvm-svn: 92233
2009-12-28 21:52:41 +00:00
Chris Lattner
f1704b24be remove #include that comes in from ConstantFolder.h
llvm-svn: 92232
2009-12-28 21:52:06 +00:00
Chris Lattner
28de6cdbf5 remove #include of Function.h from IRBuilder
llvm-svn: 92231
2009-12-28 21:50:56 +00:00
Chris Lattner
e70c40e8ac move debug info stuff out of line, allowing two #includes
to go away from IRBuilder.h

llvm-svn: 92230
2009-12-28 21:45:40 +00:00
Chris Lattner
e0b9847223 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

llvm-svn: 92227
2009-12-28 21:28:46 +00:00
Chris Lattner
13e5945d1d rename ivar to be more descriptive.
llvm-svn: 92226
2009-12-28 21:12:29 +00:00
Chris Lattner
cd3aa9d1ff rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind.  Tidy up a bunch
of random stuff.

llvm-svn: 92225
2009-12-28 20:45:51 +00:00
Chris Lattner
2b65f2d7d4 rename getHandlerNames to getMDKindNames, simplify its interface
and simplify all the clients that use it.

llvm-svn: 92224
2009-12-28 20:10:43 +00:00
Chris Lattner
5420d062f6 tidy up and delete a dead smallvector.
llvm-svn: 92223
2009-12-28 19:49:00 +00:00
Benjamin Kramer
798349c4d1 Add missing include (for inline PATypeHolder::get).
llvm-svn: 92222
2009-12-28 12:27:56 +00:00
Chris Lattner
8c6fbdc63e avoid a completely unneeded linear walk.
llvm-svn: 92221
2009-12-28 09:32:10 +00:00
Chris Lattner
9229f79945 Eliminate two bits of ugliness in MDNode::replaceElement:
eliminate the temporary smallvector, and only do FindNodeOrInsertPos
twice if the first one succeeds and we delete a node.

llvm-svn: 92220
2009-12-28 09:24:53 +00:00
Chris Lattner
e36f3cf0ca rearrange some methods, no functionality change.
llvm-svn: 92219
2009-12-28 09:12:35 +00:00
Chris Lattner
2cfabb2151 avoid temporary CallbackVH's.
llvm-svn: 92218
2009-12-28 09:10:16 +00:00
Chris Lattner
14d3bc91c4 Rewrite the function-local validation logic for MDNodes (most of r91708).
Among other benefits, this doesn't leak the SmallPtrSet, has the verifier
code in the verifier pass, actually does the verification at the end,
and is considerably simpler.

llvm-svn: 92217
2009-12-28 09:07:21 +00:00
Chris Lattner
fcc7918518 rename MDNode instance variables to something meaningful.
llvm-svn: 92216
2009-12-28 08:48:12 +00:00
Chris Lattner
2f436b213d snip one more #include from Metadata.h
llvm-svn: 92214
2009-12-28 08:30:43 +00:00