Commit Graph

945 Commits

Author SHA1 Message Date
Duncan Sands 9dff9bec31 Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!

llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner 392be58cad Add support for a union type in LLVM IR. Patch by Talin!
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Charles Davis be5557e86b Add a new function attribute, 'alignstack'. It will indicate (when the backends
implement support for it) that the stack should be forcibly realigned in the
prologue (and the process reversed in the epilogue).

llvm-svn: 95945
2010-02-12 00:31:15 +00:00
Jakob Stoklund Olesen 74bb06c0f0 Reintroduce the InlineHint function attribute.
This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Jeffrey Yasskin 091217be6f Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Chris Lattner 823aed16f9 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Devang Patel ac277eb930 Remove MetadataBase class because it is not adding significant value.
llvm-svn: 94243
2010-01-22 22:52:10 +00:00
Chris Lattner 7ba0661f27 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Dan Gohman 9b85ae26b1 Make the parser include the lower level error message in its own error
message, to be more informative.

llvm-svn: 94072
2010-01-21 10:15:06 +00:00
Eric Christopher 8444d7536c Remove the InlineHint attribute. There are no current or planned
users.

llvm-svn: 93558
2010-01-15 21:36:30 +00:00
Victor Hernandez 9d75c966e0 Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work
llvm-svn: 93197
2010-01-11 22:31:58 +00:00
Victor Hernandez b8fd152d94 Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().

llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Chris Lattner bbddd96406 fix PR5983, reject function bodies with no blocks per the grammar.
llvm-svn: 93067
2010-01-09 19:20:07 +00:00
Victor Hernandez 127286c58b When parsing function-local metadata, create a function-local MDNode
llvm-svn: 92838
2010-01-06 17:00:21 +00:00
Victor Hernandez dc6e65a6a8 Re-add parsing of function-local metadata; this time with testcase.
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Devang Patel 6edcd3994c 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 d2564e3afb Move remaining stuff to the isInteger predicate.
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Devang Patel e307348325 NamedMDNode is a collection MDNodes.
llvm-svn: 92761
2010-01-05 20:41:31 +00:00
Benjamin Kramer ccce8bae14 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 16bafa6f14 remove some fixme's
llvm-svn: 92304
2009-12-30 06:00:36 +00:00
Chris Lattner 94b9c5a73b now that instruction metadata is only parsed in one place, eliminate the
parser-global MDsOnInst vector and make ParseInstructionMetadata return
its result by-ref through an argument like the entire rest of the parser.

llvm-svn: 92302
2009-12-30 05:48:36 +00:00
Chris Lattner b2f3950da7 reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctly
handle the comma case for metadata.

llvm-svn: 92301
2009-12-30 05:44:30 +00:00
Chris Lattner 5c42763452 rename ParseOptionalCustomMetadata -> ParseInstructionMetadata,
and make it non-optional.  This fixes the bug where we'd accept
and ignore a spurious comma after some instructions.

llvm-svn: 92300
2009-12-30 05:31:19 +00:00
Chris Lattner f4f0342b08 convert 4 more instructions over.
llvm-svn: 92299
2009-12-30 05:27:33 +00:00
Chris Lattner 77b89dc58b 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 28f1eebe3e 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 bafee45d2c 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 eafe4de021 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 1eed2d65c0 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 fc58af26d5 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 a01ddfc2a3 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 6dac02a4f7 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 0f3bb7b25e fix parsing of mdstring values.
llvm-svn: 92290
2009-12-30 04:13:37 +00:00
Chris Lattner 95471e49c5 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 5b4a962bdd 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 278bc953bc factor code even more.
llvm-svn: 92280
2009-12-29 22:40:21 +00:00
Chris Lattner f2fe7fffab 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 84dd9a3d28 remove a really wrong parenthesis.
llvm-svn: 92277
2009-12-29 22:17:06 +00:00
Chris Lattner 1c6b864abe clean up some really strange code.
llvm-svn: 92275
2009-12-29 22:01:50 +00:00
Chris Lattner 1797fc7009 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 218b22f33b 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 596760d9bb 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 a0566979b7 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 2f2aa2b067 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 7093946ab1 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 f8d22fc77d Metadata.h doesn't need to include ValueHandle.h anymore.
llvm-svn: 92211
2009-12-28 08:20:46 +00:00
David Greene 2960a3d96b Change errs() to dbgs().
llvm-svn: 92088
2009-12-23 23:38:28 +00:00
Anton Korobeynikov 27a0ecfa39 Add MSP430 interrupt calling conv. No functionality change yet.
llvm-svn: 90738
2009-12-07 02:27:35 +00:00
Victor Hernandez fa23223d4a Add ParseInlineMetadata() which can parses metadata that refers to an instruction. Extend ParseParameterList() to use this new function so that calls to llvm.dbg.declare can pass inline metadata
llvm-svn: 90497
2009-12-03 23:40:58 +00:00
Chris Lattner 0f77ac2640 Add a hack for PR5601, a crash on obsolete syntax that we plan to
remove in LLVM 3.0

llvm-svn: 89973
2009-11-26 22:48:23 +00:00