From 156a853ccb1030220fc6b407e2a9517dff380bb5 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Mon, 19 May 2014 22:36:19 +0000 Subject: [PATCH] Fix usage of string when StringRef was needed Also adding a variable to the test, so release bots match %1. This should also calm the gdb buildbot. . llvm-svn: 209171 --- clang/lib/CodeGen/CGExpr.cpp | 4 +++- clang/test/CodeGen/named_reg_global.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 4822769f3927..2025f39355ec 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1780,7 +1780,9 @@ static LValue EmitGlobalNamedRegister(const VarDecl *VD, CharUnits Alignment) { AsmLabelAttr *Asm = VD->getAttr(); llvm::Twine Name("llvm.named.register."+Asm->getLabel()); - llvm::NamedMDNode *M = CGM.getModule().getOrInsertNamedMetadata(Name.str()); + SmallString<256> DummyVec; + llvm::NamedMDNode *M = + CGM.getModule().getOrInsertNamedMetadata(Name.toStringRef(DummyVec)); if (M->getNumOperands() == 0) { llvm::MDString *Str = llvm::MDString::get(CGM.getLLVMContext(), Asm->getLabel()); diff --git a/clang/test/CodeGen/named_reg_global.c b/clang/test/CodeGen/named_reg_global.c index 0a4646f7bdb0..38b1828fc5e7 100644 --- a/clang/test/CodeGen/named_reg_global.c +++ b/clang/test/CodeGen/named_reg_global.c @@ -13,8 +13,8 @@ unsigned long get_stack_pointer_addr() { } // CHECK: declare{{.*}} i[[bits]] @llvm.read_register.i[[bits]](metadata) -// CHECK: define{{.*}} void @set_stack_pointer_addr(i[[bits]] %addr) #0 { -// CHECK: [[sto:%[0-9]+]] = load i[[bits]]* %addr +// CHECK: define{{.*}} void @set_stack_pointer_addr(i[[bits]] %[[addr:[0-9a-z]+]]) #0 { +// CHECK: [[sto:%[0-9]+]] = load i[[bits]]* %[[addr]] // CHECK: call void @llvm.write_register.i[[bits]](metadata !0, i[[bits]] [[sto]]) // CHECK: ret void void set_stack_pointer_addr(unsigned long addr) {