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

50 Commits

Author SHA1 Message Date
Devang Patel
10ee76f7f4 Use separate namespace for named metadata.
llvm-svn: 92931
2010-01-07 19:39:36 +00:00
Devang Patel
311b5584e5 Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}
llvm-svn: 92783
2010-01-05 21:47:32 +00:00
Benjamin Kramer
e90a3c66c4 Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
Chris Lattner
c12382b7c8 rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.

llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Chris Lattner
6108ad9dd5 tidy
llvm-svn: 92320
2009-12-31 00:51:46 +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
739292d361 change the strange MetadataContext::getMDs function to expose less
irrelevant internal implementation details to clients.

llvm-svn: 92210
2009-12-28 08:14:54 +00:00
Chris Lattner
0a47dbff64 eliminate the elem_* iterator stuff from NamedMDNode.
llvm-svn: 92208
2009-12-28 07:57:01 +00:00
Chris Lattner
2bbe57b2b8 Revert 85678/85680. The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)".  Eliminate it
for simplicity.

llvm-svn: 85699
2009-11-01 01:27:45 +00:00
Chris Lattner
cbab35746f Make blockaddress(@func, null) be valid, and make 'deleting a basic
block with a blockaddress still referring to it' replace the invalid 
blockaddress with a new blockaddress(@func, null) instead of a 
inttoptr(1).

This changes the bitcode encoding format, and still needs codegen 
support (this should produce a non-zero value, referring to the entry
block of the function would also be quite reasonable).

llvm-svn: 85678
2009-10-31 20:08:37 +00:00
Chris Lattner
075e225442 bitcode writer support for blockaddress.
llvm-svn: 85376
2009-10-28 05:24:40 +00:00
Chris Lattner
fa5b1df64a Type.h doesn't need to #include LLVMContext.h
llvm-svn: 85254
2009-10-27 17:08:31 +00:00
Devang Patel
2a0e2f1794 Fix getMDs() interface such that it does not expose implementation details.
llvm-svn: 84885
2009-10-22 18:55:16 +00:00
Devang Patel
1fa3e26912 Using TrackingVH instead of WeakVH or WeakMetadataVH.
llvm-svn: 84884
2009-10-22 18:25:28 +00:00
Devang Patel
d10159397a Do not use SmallVector to store MDNode elements.
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Devang Patel
1070b7a713 s/class Metadata/class MetadataContext/g
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Daniel Dunbar
378331a13d Tabs -> spaces, and remove trailing whitespace.
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Devang Patel
c195f74dee Write and read metadata attachments.
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Devang Patel
ada7454774 Use separate ValueList for metadata.
This fixes PR4666.

llvm-svn: 78056
2009-08-04 06:00:18 +00:00
Benjamin Kramer
162dc26fb9 Work around a dangling pointer dereference when enumerating NamedMDNodes.
llvm-svn: 77675
2009-07-31 14:22:13 +00:00
Devang Patel
da86d84743 Enumerate NamedMDNode elements first.
llvm-svn: 77636
2009-07-30 23:03:43 +00:00
Devang Patel
d5b7c64109 Read and write NamedMDNode.
llvm-svn: 77517
2009-07-29 22:34:41 +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
Devang Patel
6b2162686a Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Devang Patel
04a1939c08 Use isa<> instead of dyn_cast<>.
llvm-svn: 76767
2009-07-22 18:35:25 +00:00
Sanjiv Gupta
2168098478 Fixed build warning. No functionality change.
llvm-svn: 76761
2009-07-22 17:58:47 +00:00
Devang Patel
5794cb80ad Introduce MetadataBase, a base class for MDString and MDNode.
Derive MDString directly from MetadataBase. 
Introduce new bitcode block to hold metadata.

llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Nick Lewycky
bbce41f698 Don't remove aggregate-typed module level constants before encoding functions
since functions may contain aggregate constants too.

llvm-svn: 73220
2009-06-12 05:20:12 +00:00
Nick Lewycky
f417462ddf Make MDNode use CallbackVH. Also change MDNode to store Value* instead of
Constant* in preperation of a future change to support holding non-Constants
in an MDNode.

llvm-svn: 71407
2009-05-10 20:57:05 +00:00
Devang Patel
64dd7a2e89 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Dan Gohman
c7007dd0dc Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.

llvm-svn: 51468
2008-05-23 01:55:30 +00:00
Dan Gohman
bab18cae46 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.

llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Chris Lattner
7925cc72c0 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Duncan Sands
3602011bec Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Chris Lattner
af0a11cd65 Fix a nasty problem where we would miss enumeration of some types. This fixes
issues with CE_CAST etc.

llvm-svn: 36864
2007-05-06 08:35:19 +00:00
Chris Lattner
50460e7c48 enumerate the operands of a constant before we enumerate the constant itself
This avoids fwd references in the reader.

llvm-svn: 36822
2007-05-06 01:00:28 +00:00
Chris Lattner
34b256e1a6 implement the 'string constant' optimization. This shrinks kc.bit from
2878544 to 2815788

llvm-svn: 36818
2007-05-06 00:35:24 +00:00
Chris Lattner
ddc5d5ce50 optimize constant layout. This fixes encoding of 181.mcf (by ensuring
integer structure idx's are emitted before constant expr geps) and shrinks
files slightly.  For example kc++ shrinks from 4326188 to 4240128 bytes.

llvm-svn: 36742
2007-05-04 05:21:47 +00:00
Chris Lattner
f59434ceca simple optimization for the type table
llvm-svn: 36741
2007-05-04 05:05:48 +00:00
Chris Lattner
21928b0039 enumerate parameter attr lists.
llvm-svn: 36709
2007-05-03 22:46:43 +00:00
Chris Lattner
888ca49f41 fix encoding of BB names in the symtab
llvm-svn: 36704
2007-05-03 22:18:21 +00:00
Chris Lattner
a9228a9ef7 start code for writing out instructions. Separate BB#s from normal value
#'s.

llvm-svn: 36472
2007-04-26 05:53:54 +00:00
Chris Lattner
0a07635bdd enumerate BB's separately from other function values.
llvm-svn: 36467
2007-04-26 04:42:16 +00:00
Chris Lattner
c1acf6a1af add support for incorporating and purging functions to the value enumerator
llvm-svn: 36465
2007-04-26 03:50:57 +00:00
Chris Lattner
726ec35588 move some code around, fix a bug in the reader reading globalinits (which
I just introduced), stub out function reading, purge aggregate values from
the value table before reading functions.

llvm-svn: 36463
2007-04-26 03:27:58 +00:00
Chris Lattner
c5a4c7c69a add bitcode alias support
llvm-svn: 36461
2007-04-26 02:46:40 +00:00
Chris Lattner
dd8df9ae56 Emit module-level constants.
llvm-svn: 36384
2007-04-24 00:16:04 +00:00
Chris Lattner
b7c184cbc1 Initial support for writing bitcode files. This currently only writes types,
the type symtab, and global/function protos, and is missing the important
size optimization, but it is a place to start.

llvm-svn: 36331
2007-04-22 06:24:45 +00:00