aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorYusra Syeda <99052248+ysyeda@users.noreply.github.com>2023-12-19 13:58:33 -0500
committerGitHub <noreply@github.com>2023-12-19 13:58:33 -0500
commit0768253c20402c8a7a357210923c6867efc0ef5c (patch)
tree575124a9d3bd32a5402677b7f4c8df195e0a82cc /llvm/lib/MC/MCContext.cpp
parentc88e74c26d5c258d42f069540fc046d52c420927 (diff)
downloadllvm-0768253c20402c8a7a357210923c6867efc0ef5c.zip
llvm-0768253c20402c8a7a357210923c6867efc0ef5c.tar.gz
llvm-0768253c20402c8a7a357210923c6867efc0ef5c.tar.bz2
[SystemZ][z/OS] Add exception handling for XPLINK (#74638)
Adds emitting the exception table and the EH registers for XPLINK. --------- Co-authored-by: Yusra Syeda <yusra.syeda@ibm.com>
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 6e72b50..c1db7e3 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -650,10 +650,16 @@ MCSectionGOFF *MCContext::getGOFFSection(StringRef Section, SectionKind Kind,
MCSection *Parent,
const MCExpr *SubsectionId) {
// Do the lookup. If we don't have a hit, return a new section.
- auto &GOFFSection = GOFFUniquingMap[Section.str()];
- if (!GOFFSection)
- GOFFSection = new (GOFFAllocator.Allocate())
- MCSectionGOFF(Section, Kind, Parent, SubsectionId);
+ auto IterBool =
+ GOFFUniquingMap.insert(std::make_pair(Section.str(), nullptr));
+ auto Iter = IterBool.first;
+ if (!IterBool.second)
+ return Iter->second;
+
+ StringRef CachedName = Iter->first;
+ MCSectionGOFF *GOFFSection = new (GOFFAllocator.Allocate())
+ MCSectionGOFF(CachedName, Kind, Parent, SubsectionId);
+ Iter->second = GOFFSection;
return GOFFSection;
}