mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Remove object_error::success and use std::error_code() instead
make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the function is called too frequently. This patch uses std::error_code() instead of object_error::success. In most cases, we return "success", so this patch reduces number of function calls to that function. http://reviews.llvm.org/D10333 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -33,7 +33,6 @@ const char *_object_error_category::name() const LLVM_NOEXCEPT {
|
||||
std::string _object_error_category::message(int EV) const {
|
||||
object_error E = static_cast<object_error>(EV);
|
||||
switch (E) {
|
||||
case object_error::success: return "Success";
|
||||
case object_error::arch_not_found:
|
||||
return "No object file for requested architecture";
|
||||
case object_error::invalid_file_type:
|
||||
|
Reference in New Issue
Block a user