Commit Graph

3272 Commits

Author SHA1 Message Date
Chris Lattner 1126534dce add new isSingleStringRef()/getSingleStringRef() methods to twine,
and use them to avoid a copy of a string in getNameWithPrefix in
the common case.  It seems like Value::setName and other places 
should use this as well?

llvm-svn: 93301
2010-01-13 07:12:06 +00:00
Chris Lattner 33535b3250 ugh, my last patch just sped up a method and changed all the clients
that I want to completely eliminate.  Add fixme's so I remember this
in the future, and add the missing helper that they should be upgraded
to use instead.

llvm-svn: 93300
2010-01-13 07:01:09 +00:00
Chris Lattner 209aecad0c change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.

llvm-svn: 93298
2010-01-13 06:38:18 +00:00
Chris Lattner b252cbb04c my mistake, Mangler::makeNameProper wants to take a twine, not a stringref!
llvm-svn: 93296
2010-01-13 05:02:57 +00:00
Chris Lattner 04a7ce850d change makeNameProper to take a stringref instead of std::string.
llvm-svn: 93295
2010-01-13 04:55:33 +00:00
Dale Johannesen 7b1a7ed330 Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.

llvm-svn: 93272
2010-01-13 00:00:24 +00:00
Devang Patel f76941ed83 Use Twine, instead of StringRef, for consistency.
llvm-svn: 93249
2010-01-12 18:57:56 +00:00
Devang Patel 943ddf666d Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.
llvm-svn: 93247
2010-01-12 18:34:06 +00:00
Benjamin Kramer c6fe3c3273 Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.

llvm-svn: 93161
2010-01-11 18:03:24 +00:00
Victor Hernandez 9ce5b5134d Respond to Chris' review:
Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t.
Get constness correct for getVariable() and getValue().

llvm-svn: 93149
2010-01-11 07:45:19 +00:00
Chris Lattner 5370ae7b70 fix a buggy assertion, CreateIntegerCast should allow
integer vectors as well as just integers.

llvm-svn: 93126
2010-01-10 20:21:42 +00:00
Mikhail Glushenkov ed3bd13c3a Suppress a warning on gcc 4.4.
warning: suggest parentheses around ‘&&’ within ‘||’.
llvm-svn: 93121
2010-01-10 18:48:49 +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 25963c6113 "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight!

llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Devang Patel 71ff547575 Delete NamedMDSymTable while destrucing Module.
Disable  copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public.

llvm-svn: 93041
2010-01-09 01:44:59 +00:00
Devang Patel 99ff5a864b Derive NamedMDNode from Value.
llvm-svn: 93032
2010-01-09 00:30:14 +00:00
Devang Patel fcfee0ff35 Use separate namespace for named metadata.
llvm-svn: 92931
2010-01-07 19:39:36 +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
Victor Hernandez c2044a1193 Fix comment for CheckDebugInfoIntrinsics
llvm-svn: 92774
2010-01-05 21:13:46 +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 a81a6dff0d Convert a ton of simple integer type equality tests to the new predicate.
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
Benjamin Kramer 76aa677ec3 Add a new predicate for integer type equality tests.
llvm-svn: 92759
2010-01-05 20:04:48 +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
David Greene 338a9030a2 Fix a build error and change errs() to dbgs().
llvm-svn: 92669
2010-01-05 01:34:26 +00:00
David Greene 5f2433ef29 Change errs() to dbgs().
llvm-svn: 92665
2010-01-05 01:30:18 +00:00
David Greene 2c8121fdcb Change errs() to dbgs().
llvm-svn: 92664
2010-01-05 01:30:14 +00:00
David Greene 3f907a9779 Change errs() to dbgs().
llvm-svn: 92663
2010-01-05 01:30:09 +00:00
David Greene 73631b995f Change errs() to dbgs().
llvm-svn: 92662
2010-01-05 01:30:06 +00:00
David Greene dfe4ad71b0 Change errs() to dbgs().
llvm-svn: 92661
2010-01-05 01:30:04 +00:00
David Greene 994e1bbdd1 Change errs() to dbgs().
llvm-svn: 92660
2010-01-05 01:30:02 +00:00
David Greene 3652f2aeb6 Change errs() to dbgs().
llvm-svn: 92659
2010-01-05 01:30:00 +00:00
David Greene f701473f9f Change errs() to dbgs().
llvm-svn: 92658
2010-01-05 01:29:58 +00:00
David Greene 58e9cbbede Change errs() to dbgs().
llvm-svn: 92657
2010-01-05 01:29:55 +00:00
David Greene 6abc01ebf9 Change errs() to dbgs().
llvm-svn: 92656
2010-01-05 01:29:39 +00:00
David Greene c7f9b12207 Change errs() to dbgs().
llvm-svn: 92652
2010-01-05 01:29:26 +00:00
David Greene 1e27a13838 Change errs() to dbgs().
llvm-svn: 92650
2010-01-05 01:29:19 +00:00
David Greene 7749903658 Change errs() to dbgs().
llvm-svn: 92649
2010-01-05 01:29:14 +00:00
Devang Patel be94f23992 Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start 
 Intrinsic::dbg_region_end 
 Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.

llvm-svn: 92557
2010-01-05 01:10:40 +00:00
Dan Gohman fc76441623 Add a comment.
llvm-svn: 92492
2010-01-04 18:38:39 +00:00
Chris Lattner fd11f49b4e it isn't safe to speculative load from a malloc, it might have
returned null, and may not have been big enough in any case.  
Thanks to Jay Foad for pointing this out!

llvm-svn: 92452
2010-01-03 18:14:24 +00:00
Chris Lattner a7cfc43af8 differences between two blockaddress's don't cause a
global variable initializer to require relocations.

llvm-svn: 92450
2010-01-03 18:09:40 +00:00
Chris Lattner d5bace7092 fix refactoro
llvm-svn: 92349
2009-12-31 08:23:09 +00:00
Chris Lattner b419a1e44f use early exits to reduce indentation.
llvm-svn: 92335
2009-12-31 02:33:14 +00:00
Chris Lattner cdec581a35 eliminate another copy of the mdnode printing logic, simplify the
one that remains.

llvm-svn: 92334
2009-12-31 02:31:59 +00:00
Chris Lattner 0d50bddda6 random tidying for MDNode printing.
llvm-svn: 92333
2009-12-31 02:27:30 +00:00
Chris Lattner efb5e39428 eliminate a bunch of useless forwarding functions with one caller.
llvm-svn: 92332
2009-12-31 02:23:35 +00:00
Chris Lattner cf4a76e441 make mdnMap type safe, rename accessors for consistency with the rest of llvm.
llvm-svn: 92331
2009-12-31 02:20:11 +00:00
Chris Lattner 01635a8428 metadata can't be a global var initializer.
llvm-svn: 92330
2009-12-31 02:15:45 +00:00
Chris Lattner bddea6a530 simplify mdnode printing logic. Now N->dump() only
dumps one node instead of all of them.

llvm-svn: 92329
2009-12-31 02:13:35 +00:00