aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/Module.cpp')
-rw-r--r--lib/IR/Module.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp
index b0abe8c..3e8f91f 100644
--- a/lib/IR/Module.cpp
+++ b/lib/IR/Module.cpp
@@ -365,31 +365,11 @@ void Module::addModuleFlag(MDNode *Node) {
void Module::setDataLayout(StringRef Desc) {
DL.reset(Desc);
-
- if (Desc.empty()) {
- DataLayoutStr = "";
- } else {
- DataLayoutStr = DL.getStringRepresentation();
- // DataLayoutStr is now equivalent to Desc, but since the representation
- // is not unique, they may not be identical.
- }
}
-void Module::setDataLayout(const DataLayout *Other) {
- if (!Other) {
- DataLayoutStr = "";
- DL.reset("");
- } else {
- DL = *Other;
- DataLayoutStr = DL.getStringRepresentation();
- }
-}
+void Module::setDataLayout(const DataLayout &Other) { DL = Other; }
-const DataLayout *Module::getDataLayout() const {
- if (DataLayoutStr.empty())
- return nullptr;
- return &DL;
-}
+const DataLayout &Module::getDataLayout() const { return DL; }
//===----------------------------------------------------------------------===//
// Methods to control the materialization of GlobalValues in the Module.
@@ -433,6 +413,12 @@ std::error_code Module::materializeAllPermanently() {
return std::error_code();
}
+std::error_code Module::materializeMetadata() {
+ if (!Materializer)
+ return std::error_code();
+ return Materializer->materializeMetadata();
+}
+
//===----------------------------------------------------------------------===//
// Other module related stuff.
//