Commit Graph

74979 Commits

Author SHA1 Message Date
Zhongxing Xu 7b8b4d70ef Simplify code by using an equivalent template class.
llvm-svn: 92305
2009-12-30 06:38:20 +00:00
Chris Lattner 16bafa6f14 remove some fixme's
llvm-svn: 92304
2009-12-30 06:00:36 +00:00
Chris Lattner c5c08899e4 fix two bogus tests that the asmparser now rejects.
llvm-svn: 92303
2009-12-30 05:54:51 +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
Chandler Carruth c712ce1b60 More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.

Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.

llvm-svn: 92289
2009-12-30 04:10:01 +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
Anders Carlsson 1e4cd33f13 Add base class checks.
llvm-svn: 92286
2009-12-30 01:29:05 +00:00
Anders Carlsson a4bbe58c3b Add more vtable tests.
llvm-svn: 92285
2009-12-30 01:25:42 +00:00
Anders Carlsson ac2f681777 More RTTI cleanup, test that RTTI classes have the correct vtables.
llvm-svn: 92284
2009-12-30 01:00:12 +00:00
John McCall 91f1a02648 Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.

llvm-svn: 92283
2009-12-30 00:31:22 +00:00
Eli Friedman be55976627 Test for PR5908.
llvm-svn: 92282
2009-12-30 00:20:14 +00:00
Eli Friedman 84341cd668 Make sure to explicitly pass type/value dependence to Expr constructor. This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.

llvm-svn: 92281
2009-12-30 00:13:48 +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
Anders Carlsson 79c184e975 Match gcc and treat vector types as fundamental types.
llvm-svn: 92278
2009-12-29 22:30:11 +00:00
Benjamin Kramer 84dd9a3d28 remove a really wrong parenthesis.
llvm-svn: 92277
2009-12-29 22:17:06 +00:00
Anders Carlsson ef88695860 Handle enum types as well.
llvm-svn: 92276
2009-12-29 22:13:01 +00:00
Chris Lattner 1c6b864abe clean up some really strange code.
llvm-svn: 92275
2009-12-29 22:01:50 +00:00
Anders Carlsson 0e4151c685 Test linkage of RTTI descriptors of array types.
llvm-svn: 92274
2009-12-29 21:58:32 +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 93163c401e 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 0709a2790a fix indentation, fit in 80 cols.
llvm-svn: 92267
2009-12-29 21:09:57 +00:00
Anders Carlsson 26cf4ab8e2 Fix function type RTTI linkage and add tests.
llvm-svn: 92266
2009-12-29 20:20:19 +00:00
Benjamin Kramer 6b37c9e6fc Replace a few more SmallVectors with arrays.
llvm-svn: 92265
2009-12-29 16:57:26 +00:00
Benjamin Kramer 756d7086c1 Use an array instead of a SmallVector.
llvm-svn: 92264
2009-12-29 11:04:52 +00:00
Chris Lattner 8e805be369 remove a bunch of unneeded functions.
llvm-svn: 92263
2009-12-29 09:32:19 +00:00
Chris Lattner 047fd2fd97 major cleanups, much of this file was incorrectly indented.
llvm-svn: 92262
2009-12-29 09:22:47 +00:00
Chris Lattner 573f294c00 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 22e13ba4e5 prune #includes.
llvm-svn: 92260
2009-12-29 09:12:29 +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 9330b2f7ec just cleanup.
llvm-svn: 92258
2009-12-29 08:06:56 +00:00
Chandler Carruth 585fb1e97e Fix support for const_cast<>s of array types which actual change the
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)

llvm-svn: 92257
2009-12-29 08:05:19 +00:00
Chris Lattner 6311212bf9 remove useless argument.
llvm-svn: 92256
2009-12-29 08:03:58 +00:00
Chris Lattner 5508da383a privatize another interface.
llvm-svn: 92255
2009-12-29 07:56:15 +00:00
Chris Lattner c88199e999 the only call to this function (from clang) has been removed, zap it.
llvm-svn: 92254
2009-12-29 07:50:09 +00:00