aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2021-10-11 16:34:41 +0200
committerRaphael Isemann <teemperor@gmail.com>2021-10-11 16:36:57 +0200
commitbdc35b0efca9445950990fe642f18c3d82ab1299 (patch)
tree293f044380e788f485c83b2d38f90f5a04abbb56 /llvm/lib/Object/XCOFFObjectFile.cpp
parentc3abfe4207d35c221f1667d5b0c79a6511be5ea3 (diff)
downloadllvm-bdc35b0efca9445950990fe642f18c3d82ab1299.zip
llvm-bdc35b0efca9445950990fe642f18c3d82ab1299.tar.gz
llvm-bdc35b0efca9445950990fe642f18c3d82ab1299.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index a0ce8be..1a3a394 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -43,10 +43,6 @@ static uintptr_t getWithOffset(uintptr_t Base, ptrdiff_t Offset) {
Offset);
}
-static Error createError(const Twine &Err) {
- return make_error<StringError>(Err, object_error::parse_failed);
-}
-
template <typename T> static const T *viewAs(uintptr_t in) {
return reinterpret_cast<const T *>(in);
}