llvm.org GIT mirror llvm / 2f8cc26
remove uses of deprecated functions, this generates slightly different BlockAddress labels, but nothing semantically important. Add a FIXME that BlockAddress codegen is broken if the LLVM BB has an empty name (e.g. strip was run). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93303 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
3 changed file(s) with 15 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
16761676 // This code must use the function name itself, and not the function number,
16771677 // since it must be possible to generate the label name from within other
16781678 // functions.
1679 std::string FuncName = Mang->getMangledName(F);
1680
1679 SmallString<60> FnName;
1680 Mang->getNameWithPrefix(FnName, F, false);
1681
1682 // FIXME: THIS IS BROKEN IF THE LLVM BASIC BLOCK DOESN'T HAVE A NAME!
16811683 SmallString<60> NameResult;
1682 raw_svector_ostream(NameResult) << MAI->getPrivateGlobalPrefix() << "BA"
1683 << FuncName.size() << '_' << FuncName << '_';
1684 Mang->getNameWithPrefix(NameResult, BB->getName());
1685 if (Suffix[0])
1686 NameResult += Suffix;
1684 Mang->getNameWithPrefix(NameResult,
1685 StringRef("BA") + Twine((unsigned)FnName.size()) +
1686 "_" + FnName.str() + "_" + BB->getName() + Suffix,
1687 Mangler::Private);
16871688
16881689 return OutContext.GetOrCreateSymbol(NameResult.str());
16891690 }
5454 store i8* blockaddress(@foo, %L5), i8** @nextaddr, align 4
5555 ret i32 %res.3
5656 }
57 ; ARM: .long LBA4__foo__L5-(LPC{{.*}}+8)
58 ; THUMB: .long LBA4__foo__L5-(LPC{{.*}}+4)
59 ; THUMB2: .long LBA4__foo__L5
57 ; ARM: .long L_BA4__foo_L5-(LPC{{.*}}+8)
58 ; THUMB: .long L_BA4__foo_L5-(LPC{{.*}}+4)
59 ; THUMB2: .long L_BA4__foo_L5
4242
4343 L1: ; preds = %L2, %bb2
4444 %res.3 = phi i32 [ %phitmp, %L2 ], [ 2, %bb2 ] ; [#uses=1]
45 ; PIC: addis r4, r2, ha16(LBA4__foo__L5-"L1$pb")
46 ; PIC: li r5, lo16(LBA4__foo__L5-"L1$pb")
45 ; PIC: addis r4, r2, ha16(L_BA4__foo_L5-"L1$pb")
46 ; PIC: li r5, lo16(L_BA4__foo_L5-"L1$pb")
4747 ; PIC: add r4, r4, r5
4848 ; PIC: stw r4
49 ; STATIC: li r2, lo16(LBA4__foo__L5)
50 ; STATIC: addis r2, r2, ha16(LBA4__foo__L5)
49 ; STATIC: li r2, lo16(L_BA4__foo_L5)
50 ; STATIC: addis r2, r2, ha16(L_BA4__foo_L5)
5151 ; STATIC: stw r2
5252 store i8* blockaddress(@foo, %L5), i8** @nextaddr, align 4
5353 ret i32 %res.3