diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-02-27 18:18:39 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-02-27 18:18:39 +0000 |
commit | 629cdbae948a101e6e20784e6d0e86929030462e (patch) | |
tree | 895a7612aadcd8bed73c0c3dcee31c2eaa734b93 /llvm/lib/MC/MCContext.cpp | |
parent | af0ff1093ec4042c6abacf67ad30c6543887e674 (diff) | |
download | bcm5719-llvm-629cdbae948a101e6e20784e6d0e86929030462e.tar.gz bcm5719-llvm-629cdbae948a101e6e20784e6d0e86929030462e.zip |
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
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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)); |