forked from OSchip/llvm-project
[llvm] Use std::remove_reference_t (NFC)
This commit is contained in:
parent
f11925e0f0
commit
03c3c2db10
|
@ -94,7 +94,7 @@ public:
|
|||
bool operator==(const iterator& I) const { return L == I.L; }
|
||||
bool operator!=(const iterator& I) const { return L != I.L; }
|
||||
const value_type& operator*() const { return L->getHead(); }
|
||||
const typename std::remove_reference<value_type>::type* operator->() const {
|
||||
const std::remove_reference_t<value_type> *operator->() const {
|
||||
return &L->getHead();
|
||||
}
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ template <typename RangeT>
|
|||
using IterOfRange = decltype(std::begin(std::declval<RangeT &>()));
|
||||
|
||||
template <typename RangeT>
|
||||
using ValueOfRange = typename std::remove_reference<decltype(
|
||||
*std::begin(std::declval<RangeT &>()))>::type;
|
||||
using ValueOfRange =
|
||||
std::remove_reference_t<decltype(*std::begin(std::declval<RangeT &>()))>;
|
||||
|
||||
} // end namespace detail
|
||||
|
||||
|
@ -359,8 +359,7 @@ public:
|
|||
|
||||
/// Metafunction to determine if T& or T has a member called rbegin().
|
||||
template <typename Ty>
|
||||
struct has_rbegin : has_rbegin_impl<typename std::remove_reference<Ty>::type> {
|
||||
};
|
||||
struct has_rbegin : has_rbegin_impl<std::remove_reference_t<Ty>> {};
|
||||
|
||||
// Returns an iterator_range over the given container which iterates in reverse.
|
||||
template <typename ContainerTy> auto reverse(ContainerTy &&C) {
|
||||
|
@ -785,7 +784,7 @@ auto deref_or_none(const Iter &I, const Iter &End) -> llvm::Optional<
|
|||
|
||||
template <typename Iter> struct ZipLongestItemType {
|
||||
using type = llvm::Optional<std::remove_const_t<
|
||||
typename std::remove_reference<decltype(*std::declval<Iter>())>::type>>;
|
||||
std::remove_reference_t<decltype(*std::declval<Iter>())>>>;
|
||||
};
|
||||
|
||||
template <typename... Iters> struct ZipLongestTupleType {
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
std::is_convertible<decltype(std::declval<Callable>()(
|
||||
std::declval<Params>()...)),
|
||||
Ret>::value> * = nullptr)
|
||||
: callback(callback_fn<typename std::remove_reference<Callable>::type>),
|
||||
: callback(callback_fn<std::remove_reference_t<Callable>>),
|
||||
callable(reinterpret_cast<intptr_t>(&callable)) {}
|
||||
|
||||
Ret operator()(Params ...params) const {
|
||||
|
|
|
@ -1271,8 +1271,8 @@ inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
|
|||
|
||||
template <typename RangeType>
|
||||
using ValueTypeFromRangeType =
|
||||
std::remove_const_t<typename std::remove_reference<decltype(*std::begin(
|
||||
std::declval<RangeType &>()))>::type>;
|
||||
std::remove_const_t<std::remove_reference_t<decltype(*std::begin(
|
||||
std::declval<RangeType &>()))>>;
|
||||
|
||||
/// Given a range of type R, iterate the entire range and return a
|
||||
/// SmallVector with elements of the vector. This is useful, for example,
|
||||
|
|
|
@ -822,8 +822,8 @@ T& cantFail(Expected<T&> ValOrErr, const char *Msg = nullptr) {
|
|||
/// ErrorInfo types.
|
||||
template <typename HandlerT>
|
||||
class ErrorHandlerTraits
|
||||
: public ErrorHandlerTraits<decltype(
|
||||
&std::remove_reference<HandlerT>::type::operator())> {};
|
||||
: public ErrorHandlerTraits<
|
||||
decltype(&std::remove_reference_t<HandlerT>::operator())> {};
|
||||
|
||||
// Specialization functions of the form 'Error (const ErrT&)'.
|
||||
template <typename ErrT> class ErrorHandlerTraits<Error (&)(ErrT &)> {
|
||||
|
|
|
@ -1189,12 +1189,12 @@ Error PassBuilder::parseModulePass(ModulePassManager &MPM,
|
|||
if (Name == "require<" NAME ">") { \
|
||||
MPM.addPass( \
|
||||
RequireAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type, Module>()); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
|
||||
return Error::success(); \
|
||||
} \
|
||||
if (Name == "invalidate<" NAME ">") { \
|
||||
MPM.addPass(InvalidateAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type>()); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>>()); \
|
||||
return Error::success(); \
|
||||
}
|
||||
#define CGSCC_PASS(NAME, CREATE_PASS) \
|
||||
|
@ -1323,14 +1323,14 @@ Error PassBuilder::parseCGSCCPass(CGSCCPassManager &CGPM,
|
|||
#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
|
||||
if (Name == "require<" NAME ">") { \
|
||||
CGPM.addPass(RequireAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type, \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>, \
|
||||
LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
|
||||
CGSCCUpdateResult &>()); \
|
||||
return Error::success(); \
|
||||
} \
|
||||
if (Name == "invalidate<" NAME ">") { \
|
||||
CGPM.addPass(InvalidateAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type>()); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>>()); \
|
||||
return Error::success(); \
|
||||
}
|
||||
#define FUNCTION_PASS(NAME, CREATE_PASS) \
|
||||
|
@ -1445,12 +1445,12 @@ Error PassBuilder::parseFunctionPass(FunctionPassManager &FPM,
|
|||
if (Name == "require<" NAME ">") { \
|
||||
FPM.addPass( \
|
||||
RequireAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type, Function>()); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>, Function>()); \
|
||||
return Error::success(); \
|
||||
} \
|
||||
if (Name == "invalidate<" NAME ">") { \
|
||||
FPM.addPass(InvalidateAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type>()); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>>()); \
|
||||
return Error::success(); \
|
||||
}
|
||||
// FIXME: UseMemorySSA is set to false. Maybe we could do things like:
|
||||
|
@ -1541,14 +1541,14 @@ Error PassBuilder::parseLoopPass(LoopPassManager &LPM,
|
|||
#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
|
||||
if (Name == "require<" NAME ">") { \
|
||||
LPM.addPass(RequireAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type, Loop, \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
|
||||
LoopAnalysisManager, LoopStandardAnalysisResults &, \
|
||||
LPMUpdater &>()); \
|
||||
return Error::success(); \
|
||||
} \
|
||||
if (Name == "invalidate<" NAME ">") { \
|
||||
LPM.addPass(InvalidateAnalysisPass< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type>()); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>>()); \
|
||||
return Error::success(); \
|
||||
}
|
||||
#include "PassRegistry.def"
|
||||
|
@ -1564,13 +1564,13 @@ bool PassBuilder::parseAAPassName(AAManager &AA, StringRef Name) {
|
|||
#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
|
||||
if (Name == NAME) { \
|
||||
AA.registerModuleAnalysis< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type>(); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>>(); \
|
||||
return true; \
|
||||
}
|
||||
#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
|
||||
if (Name == NAME) { \
|
||||
AA.registerFunctionAnalysis< \
|
||||
std::remove_reference<decltype(CREATE_PASS)>::type>(); \
|
||||
std::remove_reference_t<decltype(CREATE_PASS)>>(); \
|
||||
return true; \
|
||||
}
|
||||
#include "PassRegistry.def"
|
||||
|
|
Loading…
Reference in New Issue