summaryrefslogtreecommitdiff
path: root/lib/IR/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/Module.cpp')
-rw-r--r--lib/IR/Module.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp
index 9889f00974..d853bf4cfa 100644
--- a/lib/IR/Module.cpp
+++ b/lib/IR/Module.cpp
@@ -453,3 +453,11 @@ unsigned Module::getDwarfVersion() const {
return dwarf::DWARF_VERSION;
return cast<ConstantInt>(Val)->getZExtValue();
}
+
+Comdat *Module::getOrInsertComdat(StringRef Name) {
+ Comdat C;
+ StringMapEntry<Comdat> &Entry =
+ ComdatSymTab.GetOrCreateValue(Name, std::move(C));
+ Entry.second.Name = &Entry;
+ return &Entry.second;
+}