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
This commit is contained in:
Renato Golin 2014-05-19 22:36:19 +00:00
parent 62b2317fd8
commit 156a853ccb
2 changed files with 5 additions and 3 deletions

View File

@ -1780,7 +1780,9 @@ static LValue EmitGlobalNamedRegister(const VarDecl *VD,
CharUnits Alignment) {
AsmLabelAttr *Asm = VD->getAttr<AsmLabelAttr>();
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());

View File

@ -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) {