[llvm] e28375d - [AsmParser] Fix a warning
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 13 01:52:58 PDT 2022
Author: Kazu Hirata
Date: 2022-07-13T01:52:53-07:00
New Revision: e28375d3f2fabb655b74d6a6d2fa98c76678cf87
URL: https://github.com/llvm/llvm-project/commit/e28375d3f2fabb655b74d6a6d2fa98c76678cf87
DIFF: https://github.com/llvm/llvm-project/commit/e28375d3f2fabb655b74d6a6d2fa98c76678cf87.diff
LOG: [AsmParser] Fix a warning
This patch fixes:
llvm/lib/AsmParser/LLParser.cpp:466:34: error: moving a temporary
object prevents copy elision [-Werror,-Wpessimizing-move]
Added:
Modified:
llvm/lib/AsmParser/LLParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index ff41ebc5b0c6..388475a26af0 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -463,7 +463,7 @@ bool LLParser::parseTargetDefinition() {
return true;
Expected<DataLayout> MaybeDL = DataLayout::parse(Str);
if (!MaybeDL)
- return error(Loc, toString(std::move(MaybeDL.takeError())));
+ return error(Loc, toString(MaybeDL.takeError()));
M->setDataLayout(MaybeDL.get());
return false;
}
More information about the llvm-commits
mailing list