From 14433c96c6c2f1bd250fc4371c2647556d0d5c61 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 22 Sep 2009 20:54:13 +0000 Subject: [PATCH] Check exisiting dbg MDKind first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82568 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/IRBuilder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index b1f4354f484..a948e9f09d2 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; } -- 2.11.0