From d9a0c40bce5f0b1325b89c36785d82fa146547aa Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 21 Dec 2020 14:04:13 -0800 Subject: [MC] Split MCContext::createTempSymbol, default AlwaysAddSuffix to true, and add comments CanBeUnnamed is rarely false. Splitting to a createNamedTempSymbol makes the intention clearer and matches the direction of reverted r240130 (to drop the unneeded parameters). No behavior change. --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index f75acbb..5c2e2fb 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -104,7 +104,8 @@ ArrayRef MMIAddrLabelMap::getAddrLabelSymbolToEmit(BasicBlock *BB) { BBCallbacks.back().setMap(this); Entry.Index = BBCallbacks.size() - 1; Entry.Fn = BB->getParent(); - MCSymbol *Sym = Context.createTempSymbol(!BB->hasAddressTaken()); + MCSymbol *Sym = BB->hasAddressTaken() ? Context.createNamedTempSymbol() + : Context.createTempSymbol(); Entry.Symbols.push_back(Sym); return Entry.Symbols; } -- cgit v1.1