summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/Error.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-14 02:34:09 +0000
committerRui Ueyama <ruiu@google.com>2015-04-14 02:34:09 +0000
commite75e50c045aa815a268a6d86de620aa484a0f774 (patch)
tree8ca5f131155f946e0d7dc5d663ef81832fb3fb12 /lld/lib/Core/Error.cpp
parent7348ddaa74814cda8de8c2e33c5a4dee3b0ca3bc (diff)
downloadbcm5719-llvm-e75e50c045aa815a268a6d86de620aa484a0f774.tar.gz
bcm5719-llvm-e75e50c045aa815a268a6d86de620aa484a0f774.zip
Define make_dynamic_error_code(const char *).
The function took either StringRef or Twine. Since string literals are ambiguous when resolving the overloading, many code calls used this function with explicit type conversion. That led awkward code like make_dynamic_error_code(Twine("Error occurred")). This patch adds a function definition for string literals, so that you can directly call the function with literals. llvm-svn: 234841
Diffstat (limited to 'lld/lib/Core/Error.cpp')
-rw-r--r--lld/lib/Core/Error.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/lib/Core/Error.cpp b/lld/lib/Core/Error.cpp
index e1734283f55..cb67d8c89aa 100644
--- a/lld/lib/Core/Error.cpp
+++ b/lld/lib/Core/Error.cpp
@@ -107,6 +107,10 @@ private:
static dynamic_error_category categorySingleton;
+std::error_code make_dynamic_error_code(const char *msg) {
+ return make_dynamic_error_code(StringRef(msg));
+}
+
std::error_code make_dynamic_error_code(StringRef msg) {
return std::error_code(categorySingleton.add(msg), categorySingleton);
}
OpenPOWER on IntegriCloud