From 629cdbae948a101e6e20784e6d0e86929030462e Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 27 Feb 2015 18:18:39 +0000 Subject: Centralize handling of the eh_begin and eh_end labels. This removes a bit of duplicated code and more importantly, remembers the labels so that they don't need to be looked up by name. This in turn allows for any name to be used and avoids a crash if the name we wanted was already taken. llvm-svn: 230772 --- llvm/lib/MC/MCContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/MC/MCContext.cpp') diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 721edd451ee..b2c6958ab7d 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -160,6 +160,12 @@ MCSymbol *MCContext::CreateSymbol(StringRef Name) { return Result; } +MCSymbol *MCContext::createTempSymbol(const Twine &Name) { + SmallString<128> NameSV; + raw_svector_ostream(NameSV) << MAI->getPrivateGlobalPrefix() << Name; + return CreateSymbol(NameSV); +} + MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) { SmallString<128> NameSV; return GetOrCreateSymbol(Name.toStringRef(NameSV)); -- cgit v1.2.3