summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-31 03:34:40 +0000
committerChris Lattner <sabre@nondot.org>2010-03-31 03:34:40 +0000
commit870cfcf9a6189b65a8ee805b93a2c737c0183e62 (patch)
treeb9af4814e3f7a7b952fa656e18144b5dbb3457db /include
parentd363b4ebc7a98483437a5a88aba01dd9facdcd01 (diff)
downloadllvm-870cfcf9a6189b65a8ee805b93a2c737c0183e62.tar.gz
llvm-870cfcf9a6189b65a8ee805b93a2c737c0183e62.tar.bz2
llvm-870cfcf9a6189b65a8ee805b93a2c737c0183e62.tar.xz
add new apis for getting/setting !dbg metadata on
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instruction.h10
-rw-r--r--include/llvm/Support/ValueHandle.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 41841126b3..472ab83f2e 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -156,6 +156,16 @@ public:
void setMetadata(unsigned KindID, MDNode *Node);
void setMetadata(const char *Kind, MDNode *Node);
+ /// setDbgMetadata - This is just an optimized helper function that is
+ /// equivalent to setMetadata("dbg", Node);
+ void setDbgMetadata(MDNode *Node);
+
+ /// getDbgMetadata - This is just an optimized helper function that is
+ /// equivalent to calling getMetadata("dbg").
+ MDNode *getDbgMetadata() const {
+ return DbgInfo;
+ }
+
private:
/// hasMetadataHashEntry - Return true if we have an entry in the on-the-side
/// metadata hash.
diff --git a/include/llvm/Support/ValueHandle.h b/include/llvm/Support/ValueHandle.h
index 0e61d093b9..130a620ab2 100644
--- a/include/llvm/Support/ValueHandle.h
+++ b/include/llvm/Support/ValueHandle.h
@@ -284,8 +284,7 @@ class TrackingVH : public ValueHandleBase {
Value *VP = ValueHandleBase::getValPtr();
// Null is always ok.
- if (!VP)
- return;
+ if (!VP) return;
// Check that this value is valid (i.e., it hasn't been deleted). We
// explicitly delay this check until access to avoid requiring clients to be