Don't use 'using std::error_code' in include/llvm.

This should make sure that most new uses use the std prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-06-12 21:46:39 +00:00
parent 7418e1f4bd
commit 5c792faa0e
107 changed files with 692 additions and 563 deletions

View File

@@ -23,7 +23,6 @@
#include <type_traits>
namespace llvm {
using std::error_code;
template<class T, class V>
typename std::enable_if< std::is_constructible<T, V>::value
, typename std::remove_reference<V>::type>::type &&
@@ -101,11 +100,11 @@ public:
void *>::type = 0)
: HasError(true) {
using std::make_error_code;
new (getErrorStorage()) error_code(make_error_code(ErrorCode));
new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
}
ErrorOr(std::error_code EC) : HasError(true) {
new (getErrorStorage()) error_code(EC);
new (getErrorStorage()) std::error_code(EC);
}
ErrorOr(T Val) : HasError(false) {
@@ -165,8 +164,8 @@ public:
reference get() { return *getStorage(); }
const_reference get() const { return const_cast<ErrorOr<T> >(this)->get(); }
error_code getError() const {
return HasError ? *getErrorStorage() : error_code();
std::error_code getError() const {
return HasError ? *getErrorStorage() : std::error_code();
}
pointer operator ->() {
@@ -187,7 +186,7 @@ private:
} else {
// Get other's error.
HasError = true;
new (getErrorStorage()) error_code(Other.getError());
new (getErrorStorage()) std::error_code(Other.getError());
}
}
@@ -219,7 +218,7 @@ private:
} else {
// Get other's error.
HasError = true;
new (getErrorStorage()) error_code(Other.getError());
new (getErrorStorage()) std::error_code(Other.getError());
}
}
@@ -250,19 +249,19 @@ private:
return reinterpret_cast<const storage_type*>(TStorage.buffer);
}
error_code *getErrorStorage() {
std::error_code *getErrorStorage() {
assert(HasError && "Cannot get error when a value exists!");
return reinterpret_cast<error_code*>(ErrorStorage.buffer);
return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
}
const error_code *getErrorStorage() const {
const std::error_code *getErrorStorage() const {
return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
}
union {
AlignedCharArrayUnion<storage_type> TStorage;
AlignedCharArrayUnion<error_code> ErrorStorage;
AlignedCharArrayUnion<std::error_code> ErrorStorage;
};
bool HasError : 1;
};
@@ -272,7 +271,7 @@ typename std::enable_if<std::is_error_code_enum<E>::value ||
std::is_error_condition_enum<E>::value,
bool>::type
operator==(ErrorOr<T> &Err, E Code) {
return error_code(Err) == Code;
return std::error_code(Err) == Code;
}
} // end namespace llvm