summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Metadata.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for empty metadata nodes: !{}.Dan Gohman2010-07-131-1/+2
| | | | llvm-svn: 108259
* Add fixme.Devang Patel2010-07-061-0/+1
| | | | llvm-svn: 107697
* Fix a problem exposed by my previous commit and noticed by a release-assertsDuncan Sands2010-05-041-11/+3
| | | | | | | | | buildbot: the debugging and non-debugging versions of getFunction were not functionally equivalent: the non-debugging version wrongly assumed that if a metadata operand was not metadata, then it had a non-null containing function. This is not true, since the operand might be a global value, constant etc. llvm-svn: 103008
* Fix a variant of PR6112 found by thinking about it: when doingDuncan Sands2010-05-041-7/+21
| | | | | | | | | | RAUW of a global variable with a local variable in function F, if function local metadata M in function G was using the global then M would become function-local to both F and G, which is not allowed. See the testcase for an example. Fixed by detecting this situation and zapping the metadata operand when it occurs. llvm-svn: 103007
* fix PR6112 - When globalopt (or any other pass) does RAUW(@G, %G), Chris Lattner2010-04-281-2/+15
| | | | | | | metadata references in non-function-local MDNodes should drop to null. llvm-svn: 102519
* rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.Chris Lattner2010-04-021-3/+3
| | | | | | | This keeps around temporary typedef for clang/llvm-gcc so the build won't break when I commit this :) llvm-svn: 100218
* Switch the representation of the location in instruction fromChris Lattner2010-04-011-6/+26
| | | | | | | | | | | | | being a TrackingVH<MDNode> to a NewDebugLoc, shrinking sizeof(Instruction) a lot, and providing clients the ability to deal with locations in terms of NewDebugLoc instead of having to deal with Metadata. This is still fully compatible with all clients that *do* use MDNodes for everything of course. No functionality change. llvm-svn: 100088
* add new apis for getting/setting !dbg metadata on Chris Lattner2010-03-311-0/+4
| | | | | | | | | instructions. In addition to being a convenience, they are faster than the old apis, particularly when not going from an MDKindID like people should be doing. llvm-svn: 99982
* Fix a major source of compile-time slowness at -O0 -g by optimizingChris Lattner2010-03-301-11/+36
| | | | | | | | | | | | | | the storage of !dbg metadata kinds in the instruction themselves. The on-the-side hash table works great for metadata that not-all instructions get, or for metadata that only exists when optimizing. But when compile-time is everything, it isn't great. I'm not super thrilled with the fact that this plops a TrackingVH in Instruction, because it grows it by 3 words. I'm investigating alternatives, but this should be a step in the right direction in any case. llvm-svn: 99957
* move some method definitions to files that make sense.Chris Lattner2010-03-301-44/+0
| | | | llvm-svn: 99927
* Include isFunctionLocal while calculating folding node set profile for a MDNode.Devang Patel2010-03-251-13/+14
| | | | llvm-svn: 99490
* Include isFunctionLocal while calculating folding node set provide for a MDNode.Devang Patel2010-03-251-0/+1
| | | | llvm-svn: 99484
* Delete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, ↵Jeffrey Yasskin2010-03-131-8/+8
| | | | | | | | | | r97788. Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit` after configuring with --with-llvmgccdir (and this did run the FrontendC* tests this time) llvm-svn: 98410
* Remove duplicated code. No functionality change.Benjamin Kramer2010-03-101-9/+0
| | | | llvm-svn: 98156
* Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to runJeffrey Yasskin2010-03-071-8/+8
| | | | | | the FrontendC* tests. :( llvm-svn: 97921
* Reapply r97788 to free MDNodes when the LLVMContext is destroyed. ItJeffrey Yasskin2010-03-071-8/+8
| | | | | | bootstraps llvm-gcc this time. llvm-svn: 97918
* Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.Jeffrey Yasskin2010-03-051-8/+8
| | | | llvm-svn: 97792
* Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.Jeffrey Yasskin2010-03-051-8/+8
| | | | llvm-svn: 97788
* Destroy MDNodes gracefully while deleting llvm context.Devang Patel2010-02-181-0/+7
| | | | llvm-svn: 96609
* Add MDNode::getIfExists(), an efficient way to determine if a value is used ↵Victor Hernandez2010-01-261-28/+40
| | | | | | by metadata (since metadata does not appear in a value's use list) llvm-svn: 94492
* Remove MetadataBase class because it is not adding significant value.Devang Patel2010-01-221-2/+2
| | | | llvm-svn: 94243
* tidy upChris Lattner2010-01-211-9/+16
| | | | llvm-svn: 94100
* Fix if/else brackets; getFunctionForValue() is to be called for non-metadata ↵Victor Hernandez2010-01-201-1/+3
| | | | | | values llvm-svn: 93984
* Fix the conditions to unambiguously show the logic they represent. This is theChandler Carruth2010-01-201-3/+3
| | | | | | | logic enforced in the test case as well, so hopefully it is correct. Please review Victor. llvm-svn: 93980
* Refactor common parts of MDNode::getFunction() and assertLocalFunction() ↵Victor Hernandez2010-01-201-33/+23
| | | | | | into getFunctionForValue() llvm-svn: 93977
* Add comment that MDNode::getFunction() is not to be used by ↵Victor Hernandez2010-01-181-1/+2
| | | | | | performance-critical code (currently only used by AsmWriter) llvm-svn: 93802
* Simplify MDNode::getFunction() and assertLocalFunction() by avoiding extra ↵Victor Hernandez2010-01-181-46/+39
| | | | | | Function* variable and smallptrset since function-local metadata cannot be cyclic llvm-svn: 93762
* In debug builds, assert that function-local metadata has only 1 parent functionVictor Hernandez2010-01-141-1/+30
| | | | llvm-svn: 93449
* Add MDNode::getFunction(), which figures out the metadata's function, if it ↵Victor Hernandez2010-01-141-0/+34
| | | | | | has function that it is local to. llvm-svn: 93400
* Introduce Twine::toStringRef, a variant of toVector which avoids the copy if theBenjamin Kramer2010-01-131-5/+1
| | | | | | | twine can be represented as a single StringRef. Use the new methode to simplify some twine users. llvm-svn: 93317
* Use Twine, instead of StringRef, for consistency.Devang Patel2010-01-121-5/+18
| | | | llvm-svn: 93249
* Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.Devang Patel2010-01-121-6/+25
| | | | llvm-svn: 93247
* Suppress a warning on gcc 4.4.Mikhail Glushenkov2010-01-101-26/+26
| | | | | warning: suggest parentheses around ‘&&’ within ‘||’. llvm-svn: 93121
* Compute isFunctionLocal in MDNode ctor or via argument in new function ↵Victor Hernandez2010-01-101-3/+32
| | | | | | | | getWhenValsUnresolved(). Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue(). llvm-svn: 93108
* Derive NamedMDNode from Value.Devang Patel2010-01-091-1/+1
| | | | llvm-svn: 93032
* Use separate namespace for named metadata.Devang Patel2010-01-071-3/+15
| | | | llvm-svn: 92931
* NamedMDNode is a collection MDNodes.Devang Patel2010-01-051-11/+11
| | | | llvm-svn: 92761
* rename "elements" of metadata to "operands". "Elements" areChris Lattner2009-12-311-35/+35
| | | | | | | things that occur in types. "operands" are things that occur in values. llvm-svn: 92322
* Optimize MDNode to coallocate the operand list immediatelyChris Lattner2009-12-311-35/+49
| | | | | | | | | | | | | 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
* do not bother reuniquing mdnodes whose operands drop to null. DoingChris Lattner2009-12-301-9/+27
| | | | | | | | | | | 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
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-291-147/+73
| | | | | | | | 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
* privatize another interface.Chris Lattner2009-12-291-1/+4
| | | | llvm-svn: 92255
* the only call to this function (from clang) has been removed, zap it.Chris Lattner2009-12-291-22/+0
| | | | llvm-svn: 92254
* remove some unneeded Metadata interfaces.Chris Lattner2009-12-291-41/+7
| | | | llvm-svn: 92252
* When doing v1->RAUW(v2), don't do anything to metadata. We don't knowChris Lattner2009-12-291-16/+0
| | | | | | | | 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
* sink the Instruction::HasMetadata bit into SubclassData.Chris Lattner2009-12-291-5/+5
| | | | llvm-svn: 92240
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-291-1/+1
| | | | | | | | | | | 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
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-281-120/+128
| | | | | | | | | | | | | | | | | | | | | | 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
* rename getMDKind -> getMDKindID, make it autoinsert if an MD KindChris Lattner2009-12-281-33/+11
| | | | | | | doesn't exist already, eliminate registerMDKind. Tidy up a bunch of random stuff. llvm-svn: 92225
* rename getHandlerNames to getMDKindNames, simplify its interfaceChris Lattner2009-12-281-8/+8
| | | | | | and simplify all the clients that use it. llvm-svn: 92224
OpenPOWER on IntegriCloud