From b1aa0b0b88a0bca2553f8c6d6c52ec3b7205064b Mon Sep 17 00:00:00 2001 From: Sergei Barannikov Date: Tue, 13 Aug 2024 20:10:35 +0300 Subject: [DataLayout] Remove `clear` and `reset` methods (NFC) (#102993) `clear` was never necessary as it is always called on a fresh instance of the class or just before freeing an instance's memory. `reset` is effectively the same as the constructor. Pull Reuquest: https://github.com/llvm/llvm-project/pull/102993 --- llvm/lib/IR/Module.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/IR/Module.cpp') diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index 80b5408..4738ec7 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -388,9 +388,7 @@ void Module::setModuleFlag(ModFlagBehavior Behavior, StringRef Key, setModuleFlag(Behavior, Key, ConstantInt::get(Int32Ty, Val)); } -void Module::setDataLayout(StringRef Desc) { - DL.reset(Desc); -} +void Module::setDataLayout(StringRef Desc) { DL = DataLayout(Desc); } void Module::setDataLayout(const DataLayout &Other) { DL = Other; } -- cgit v1.1