Commit Graph

74995 Commits

Author SHA1 Message Date
Chris Lattner 8cb6c3476d Optimize MDNode to coallocate the operand list immediately
after the MDNode in memory.  This eliminates the operands
pointer and saves a new[] per node.

Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary.  A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related!  Debug info should use something non-mdnode for
declarations.

llvm-svn: 92321
2009-12-31 01:05:46 +00:00
Chris Lattner 8dace893fa tidy
llvm-svn: 92320
2009-12-31 00:51:46 +00:00
Anders Carlsson a442499072 Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.
llvm-svn: 92319
2009-12-30 23:47:56 +00:00
Zhongxing Xu da3ddfce43 The element type should also be canonicalized. Add a case for VariableArrayType.
llvm-svn: 92318
2009-12-30 22:59:54 +00:00
Chris Lattner d866c5a678 testcase for previous patch!
llvm-svn: 92317
2009-12-30 22:10:22 +00:00
Chris Lattner 8977c433d3 when making a decl for __builtin_fabsf() make sure to
attach the appropriate attributes to it.  I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.

llvm-svn: 92316
2009-12-30 22:06:22 +00:00
Chris Lattner 30ae06be14 do not bother reuniquing mdnodes whose operands drop to null. Doing
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway.  This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g

from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/

llvm-svn: 92315
2009-12-30 21:42:11 +00:00
Zhongxing Xu 1563a76fd3 Fix a comment.
llvm-svn: 92314
2009-12-30 21:24:23 +00:00
Chris Lattner c3847ba3fa fix PR5917, L'x' was getting the wrong type in c++ mode. Per
C++2.13.2p2: "A wide-character literal has type wchar_t"

llvm-svn: 92313
2009-12-30 21:19:39 +00:00
Fariborz Jahanian 92368a15f9 When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.

llvm-svn: 92312
2009-12-30 20:38:08 +00:00
Chris Lattner 09660c9b06 remove some misleading comments.
llvm-svn: 92311
2009-12-30 20:25:09 +00:00
Chris Lattner 1ca1d7adc2 remove extraneous #include
llvm-svn: 92310
2009-12-30 19:54:10 +00:00
Douglas Gregor 165882c240 Implement edit distance for StringRef
llvm-svn: 92309
2009-12-30 17:23:44 +00:00
Douglas Gregor 2d435306e5 Typo correction for type names when they appear in declarations, e.g., given
tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
  tring str2;
  ^~~~~
  string


To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.

llvm-svn: 92308
2009-12-30 17:04:44 +00:00
Douglas Gregor ad183ac3c7 Fix typo in comment
llvm-svn: 92307
2009-12-30 16:01:52 +00:00
Zhongxing Xu 4629e92e78 Remove an duplicated #include.
llvm-svn: 92306
2009-12-30 06:48:20 +00:00
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