summaryrefslogtreecommitdiff
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 19adf78cd3..2b209d99c7 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -429,11 +429,8 @@ int main(int argc, char **argv) {
Passes.add(TLI);
// Add an appropriate DataLayout instance for this module.
- DataLayout *DL = 0;
- const std::string &ModuleDataLayout = M.get()->getDataLayout();
- if (!ModuleDataLayout.empty())
- DL = new DataLayout(ModuleDataLayout);
- else if (!DefaultDataLayout.empty())
+ const DataLayout *DL = M.get()->getDataLayout();
+ if (!DL && !DefaultDataLayout.empty())
DL = new DataLayout(DefaultDataLayout);
if (DL)