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

55407 Commits

Author SHA1 Message Date
Chris Lattner
2aaf4a0490 add facilities to start factoring instruction metadata parsing
out of each opcode's handler.  Change ret over so far.

llvm-svn: 92298
2009-12-30 05:23:43 +00:00
Chris Lattner
03a91d987f reimplement insertvalue/extractvalue metadata handling to not blindly
accept invalid input.  Actually add a testcase.

llvm-svn: 92297
2009-12-30 05:14:00 +00:00
Chris Lattner
2ed8fad119 remove two bogus calls that accepted metadata in the middle of insert/extract value
*constant exprs*.

llvm-svn: 92296
2009-12-30 05:04:46 +00:00
Chris Lattner
63289c0f1e rename NamedOrCustomMD -> MetadataVar to follow conventions of all the rest of the code.
llvm-svn: 92295
2009-12-30 05:02:06 +00:00
Chris Lattner
2e5b6d96ac rename lltok::Metadata -> lltok::exclaim. We name tokens
after their syntactic form, not their semantic form.

llvm-svn: 92294
2009-12-30 04:56:59 +00:00
Chris Lattner
6664b8bd4d rename MetadataCache -> NumberedMetadata to follow the convention
used by other things.  Convert it to a vector since it is a dense 
numbering.

llvm-svn: 92293
2009-12-30 04:51:58 +00:00
Chris Lattner
bc506fa595 rewrite ParseMDNodeVector to follow the normal patter used in the .ll parser.
llvm-svn: 92292
2009-12-30 04:42:57 +00:00
Chris Lattner
9583b65fb9 rename ParseMDNode -> ParseMDNodeID, since it parses !42, not !{... } as you'd expect.
llvm-svn: 92291
2009-12-30 04:15:23 +00:00
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