From bdc35b0efca9445950990fe642f18c3d82ab1299 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Mon, 11 Oct 2021 16:34:41 +0200 Subject: [Object] Deduplicate the three createError functions The Object library currently has three identical functions that translate a Twine into a parser error. Until recently these functions have coexisted peacefully, but since D110320 Clang with enabled modules is now diagnosing that we have several definitions of `createError` in Object. This patch just merges them all and puts them into Object's `Error.h` where the error code for `parse_failed` is also defined which seems cleaner and unbreaks the bots. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D111541 --- llvm/lib/Object/COFFModuleDefinition.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'llvm/lib/Object/COFFModuleDefinition.cpp') diff --git a/llvm/lib/Object/COFFModuleDefinition.cpp b/llvm/lib/Object/COFFModuleDefinition.cpp index 8f29f7a..55ddd3b 100644 --- a/llvm/lib/Object/COFFModuleDefinition.cpp +++ b/llvm/lib/Object/COFFModuleDefinition.cpp @@ -80,11 +80,6 @@ static bool isDecorated(StringRef Sym, bool MingwDef) { (!MingwDef && Sym.contains('@')); } -static Error createError(const Twine &Err) { - return make_error(StringRef(Err.str()), - object_error::parse_failed); -} - class Lexer { public: Lexer(StringRef S) : Buf(S) {} -- cgit v1.1