Victor Hernandez
b324e66f4c
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
...
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.
llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Victor Hernandez
8d4904b639
Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
...
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Victor Hernandez
5d6551816b
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
...
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Victor Hernandez
8296da7b56
In debug builds, assert that function-local metadata has only 1 parent function
...
llvm-svn: 93449
2010-01-14 20:12:34 +00:00
Victor Hernandez
61e6e829c6
Fix printing of function-local metadata in AsmWriter
...
llvm-svn: 93402
2010-01-14 01:47:37 +00:00
Victor Hernandez
8c85e25589
Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.
...
llvm-svn: 93400
2010-01-14 01:45:14 +00:00
Benjamin Kramer
2e06b93f43
Introduce Twine::toStringRef, a variant of toVector which avoids the copy if the
...
twine can be represented as a single StringRef. Use the new methode to simplify
some twine users.
llvm-svn: 93317
2010-01-13 12:45:23 +00:00
Chris Lattner
98b05e017b
don't add the \1 to the name.
...
llvm-svn: 93304
2010-01-13 07:50:21 +00:00
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
Chris Lattner
2c48c64821
unify two copies of the NamedMDNode printing code.
...
llvm-svn: 92327
2009-12-31 01:54:05 +00:00
Chris Lattner
b9196679f9
fix printing of function-local metadata to print all the operands of the
...
mdnode, not just operand 0 over and over.
llvm-svn: 92326
2009-12-31 01:44:44 +00:00
Chris Lattner
31fcc28a84
simplify printing of mdstring and Argument.
...
llvm-svn: 92325
2009-12-31 01:41:14 +00:00
Chris Lattner
be2de79b77
simplify asmprinting of NamedMDNode
...
llvm-svn: 92324
2009-12-31 01:36:50 +00:00
Chris Lattner
cc8c8146d2
Remove #include of metadata.h from intrinsicinst.h. The only
...
method that needs it (DbgValueInst::getValue) has been moved out
of line.
llvm-svn: 92323
2009-12-31 01:32:41 +00:00
Chris Lattner
9b493028df
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
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
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
Chris Lattner
09660c9b06
remove some misleading comments.
...
llvm-svn: 92311
2009-12-30 20:25:09 +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
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
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
Chris Lattner
68017800cd
remove some unneeded Metadata interfaces.
...
llvm-svn: 92252
2009-12-29 07:44:16 +00:00
Chris Lattner
031560c2c7
tidy up debug info comments, use ->isVoidTy() where reasonable.
...
llvm-svn: 92249
2009-12-29 07:25:48 +00:00
Chris Lattner
241264ee32
When doing v1->RAUW(v2), don't do anything to metadata. We don't know
...
why one was replaced with the other. Even in the specific case of
debug information, it doesn't make sense to transfer the location over,
this will just result in jumbled loc info.
llvm-svn: 92241
2009-12-29 02:53:52 +00:00
Chris Lattner
d8eb2cf571
sink the Instruction::HasMetadata bit into SubclassData.
...
llvm-svn: 92240
2009-12-29 02:46:09 +00:00
Chris Lattner
b9c8651b8c
add a layer of accessors around the Value::SubClassData member, and use
...
a convention (shadowing the setter with private forwarding function) to
prevent subclasses from accidentally using it.
This exposed some bogosity in ConstantExprs, which was propaging the
opcode of the constant expr into the NUW/NSW/Exact field in the
getWithOperands/getWithOperandReplaced methods.
llvm-svn: 92239
2009-12-29 02:14:09 +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
a16bdb9f96
add IRBuilder.cpp to cmake
...
llvm-svn: 92233
2009-12-28 21:52:41 +00:00
Chris Lattner
49f9f76030
remove #include of Function.h from IRBuilder
...
llvm-svn: 92231
2009-12-28 21:50:56 +00:00
Chris Lattner
7ef1cac576
move debug info stuff out of line, allowing two #includes
...
to go away from IRBuilder.h
llvm-svn: 92230
2009-12-28 21:45:40 +00:00
Chris Lattner
17079fc0fa
split code that doesn't need to be templated out of IRBuilder into a new
...
non-templated IRBuilderBase class. Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h
llvm-svn: 92227
2009-12-28 21:28:46 +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
c9558df1f0
rename getHandlerNames to getMDKindNames, simplify its interface
...
and simplify all the clients that use it.
llvm-svn: 92224
2009-12-28 20:10:43 +00:00
Chris Lattner
9a258777a5
tidy up and delete a dead smallvector.
...
llvm-svn: 92223
2009-12-28 19:49:00 +00:00
Chris Lattner
95c445d280
avoid a completely unneeded linear walk.
...
llvm-svn: 92221
2009-12-28 09:32:10 +00:00
Chris Lattner
c6d17e29df
Eliminate two bits of ugliness in MDNode::replaceElement:
...
eliminate the temporary smallvector, and only do FindNodeOrInsertPos
twice if the first one succeeds and we delete a node.
llvm-svn: 92220
2009-12-28 09:24:53 +00:00
Chris Lattner
f543eff71c
rearrange some methods, no functionality change.
...
llvm-svn: 92219
2009-12-28 09:12:35 +00:00
Chris Lattner
d944cf76de
avoid temporary CallbackVH's.
...
llvm-svn: 92218
2009-12-28 09:10:16 +00:00
Chris Lattner
588096e51d
Rewrite the function-local validation logic for MDNodes (most of r91708).
...
Among other benefits, this doesn't leak the SmallPtrSet, has the verifier
code in the verifier pass, actually does the verification at the end,
and is considerably simpler.
llvm-svn: 92217
2009-12-28 09:07:21 +00:00
Chris Lattner
66a4c3d084
rename MDNode instance variables to something meaningful.
...
llvm-svn: 92216
2009-12-28 08:48:12 +00:00
Chris Lattner
5a409bd17a
snip one more #include from Metadata.h
...
llvm-svn: 92214
2009-12-28 08:30:43 +00:00
Chris Lattner
1300f45ba9
prune some #includes
...
llvm-svn: 92212
2009-12-28 08:24:16 +00:00
Chris Lattner
53bb5e4ae0
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
1bc810bb89
change NamedMDNode to use a pimpl for its operand list instead
...
of making it a declared part of the value.
llvm-svn: 92209
2009-12-28 08:07:14 +00:00
Chris Lattner
74a6ad6f29
move ElementVH out of the MDNode class into the MDNode.cpp file. Among
...
other things, this avoids vtable and rtti data for it being splatted in
every translation unit that uses it.
llvm-svn: 92207
2009-12-28 07:41:54 +00:00
Bill Wendling
6ce6d268a6
Avoid assigning to Changed when it won't be used after the return.
...
llvm-svn: 92160
2009-12-25 13:50:18 +00:00
John McCall
086bb4ef82
Qualify a bunch of explicit template instantiations to satisfy clang++.
...
llvm-svn: 91736
2009-12-19 00:55:12 +00:00
John McCall
791e5c9dd5
Put TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
...
the templates in TypesContext.h can find them. Caught by clang++.
llvm-svn: 91735
2009-12-19 00:51:42 +00:00
Eli Friedman
3a7cdaca33
Fix gcc warning.
...
llvm-svn: 91715
2009-12-18 21:07:18 +00:00
Rafael Espindola
2c5792a6bd
Catch more cases of a pointer being marked garbage twice. This helps when
...
debugging some leaks (PR5770 in particular).
llvm-svn: 91713
2009-12-18 20:35:38 +00:00