aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-22 20:54:13 +0000
committerDevang Patel <dpatel@apple.com>2009-09-22 20:54:13 +0000
commit5ffdd0e9c3eb03b473ddf666c885cecbc15f8df7 (patch)
tree79f357a913e5249bf90ce02ff67350a37f295740
parentd80fa7f67d06ef47913578a8212be349722a9df5 (diff)
downloadexternal_llvm-5ffdd0e9c3eb03b473ddf666c885cecbc15f8df7.zip
external_llvm-5ffdd0e9c3eb03b473ddf666c885cecbc15f8df7.tar.gz
external_llvm-5ffdd0e9c3eb03b473ddf666c885cecbc15f8df7.tar.bz2
Check exisiting dbg MDKind first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82568 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/IRBuilder.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index b1f4354..a948e9f 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -134,10 +134,10 @@ public:
/// SetCurrentLocation - This specifies the location information used
/// by debugging information.
void SetCurrentLocation(MDNode *L) {
- if (MDKind == 0) {
- Context.getMetadata().RegisterMDKind("dbg");
+ if (MDKind == 0)
MDKind = Context.getMetadata().getMDKind("dbg");
- }
+ if (MDKind == 0)
+ MDKind = Context.getMetadata().RegisterMDKind("dbg");
CurLocation = L;
}