6 changes: 3 additions & 3 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ void AArch64InstPrinter::printSVERegOp(const MCInst *MI, unsigned OpNum,

template <typename T>
void AArch64InstPrinter::printImmSVE(T Value, raw_ostream &O) {
typename std::make_unsigned<T>::type HexValue = Value;
std::make_unsigned_t<T> HexValue = Value;

if (getPrintImmHex())
O << '#' << formatHex((uint64_t)HexValue);
Expand Down Expand Up @@ -1556,8 +1556,8 @@ template <typename T>
void AArch64InstPrinter::printSVELogicalImm(const MCInst *MI, unsigned OpNum,
const MCSubtargetInfo &STI,
raw_ostream &O) {
typedef typename std::make_signed<T>::type SignedT;
typedef typename std::make_unsigned<T>::type UnsignedT;
typedef std::make_signed_t<T> SignedT;
typedef std::make_unsigned_t<T> UnsignedT;

uint64_t Val = MI->getOperand(OpNum).getImm();
UnsignedT PrintVal = AArch64_AM::decodeLogicalImmediate(Val, 64);
Expand Down
14 changes: 6 additions & 8 deletions llvm/lib/XRay/FDRTraceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ namespace {
template <size_t Index> struct IndexedWriter {
template <
class Tuple,
typename std::enable_if<
(Index <
std::tuple_size<typename std::remove_reference<Tuple>::type>::value),
int>::type = 0>
std::enable_if_t<(Index <
std::tuple_size<std::remove_reference_t<Tuple>>::value),
int> = 0>
static size_t write(support::endian::Writer &OS, Tuple &&T) {
OS.write(std::get<Index>(T));
return sizeof(std::get<Index>(T)) + IndexedWriter<Index + 1>::write(OS, T);
}

template <
class Tuple,
typename std::enable_if<
(Index >=
std::tuple_size<typename std::remove_reference<Tuple>::type>::value),
int>::type = 0>
std::enable_if_t<(Index >=
std::tuple_size<std::remove_reference_t<Tuple>>::value),
int> = 0>
static size_t write(support::endian::Writer &OS, Tuple &&) {
return 0;
}
Expand Down
5 changes: 2 additions & 3 deletions llvm/tools/dsymutil/CFBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ template <typename T> struct CFDeleter {
/// any valid pointer it owns unless that pointer is explicitly released using
/// the release() member function.
template <typename T>
using CFReleaser =
std::unique_ptr<typename std::remove_pointer<T>::type,
CFDeleter<typename std::remove_pointer<T>::type>>;
using CFReleaser = std::unique_ptr<std::remove_pointer_t<T>,
CFDeleter<std::remove_pointer_t<T>>>;

/// RAII wrapper around CFBundleRef.
class CFString : public CFReleaser<CFStringRef> {
Expand Down
3 changes: 1 addition & 2 deletions llvm/tools/llvm-pdbutil/FormatUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ std::string truncateQuotedNameBack(StringRef Label, StringRef Name,
return Ret;

template <typename T> std::string formatUnknownEnum(T Value) {
return formatv("unknown ({0})",
static_cast<typename std::underlying_type<T>::type>(Value))
return formatv("unknown ({0})", static_cast<std::underlying_type_t<T>>(Value))
.str();
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-xray/trie-node.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ template <typename T, typename Callable>
TrieNode<T> *
mergeTrieNodes(const TrieNode<T> &Left, const TrieNode<T> &Right,
/*Non-deduced pointer type for nullptr compatibility*/
typename std::remove_reference<TrieNode<T> *>::type NewParent,
std::remove_reference_t<TrieNode<T> *> NewParent,
std::forward_list<TrieNode<T>> &NodeStore,
Callable &&MergeCallable) {
llvm::function_ref<T(const T &, const T &)> MergeFn(
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/ADT/DenseSetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template <typename T> class DenseSetTest : public testing::Test {

private:
static T GetTestSet() {
typename std::remove_const<T>::type Set;
std::remove_const_t<T> Set;
Set.insert(0);
Set.insert(1);
Set.insert(2);
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/IR/PatternMatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,8 +1319,8 @@ TYPED_TEST_CASE(MutableConstTest, MutableConstTestTypes);
TYPED_TEST(MutableConstTest, ICmp) {
auto &IRB = PatternMatchTest::IRB;

typedef typename std::tuple_element<0, TypeParam>::type ValueType;
typedef typename std::tuple_element<1, TypeParam>::type InstructionType;
typedef std::tuple_element_t<0, TypeParam> ValueType;
typedef std::tuple_element_t<1, TypeParam> InstructionType;

Value *L = IRB.getInt32(1);
Value *R = IRB.getInt32(2);
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/XRay/GraphTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ template <typename T> class GraphTest : public testing::Test {
private:
static T getTestGraph() {
using std::make_pair;
typename std::remove_const<T>::type G;
std::remove_const_t<T> G;
G.insert(make_pair(1u, VAttr({3u})));
G.insert(make_pair(2u, VAttr({5u})));
G.insert(make_pair(3u, VAttr({7u})));
Expand Down
3 changes: 1 addition & 2 deletions llvm/utils/benchmark/include/benchmark/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,7 @@ inline internal::Benchmark* RegisterBenchmark(const char* name,
#ifdef BENCHMARK_HAS_CXX11
template <class Lambda>
internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) {
using BenchType =
internal::LambdaBenchmark<typename std::decay<Lambda>::type>;
using BenchType = internal::LambdaBenchmark<std::decay_t<Lambda>>;
return internal::RegisterBenchmarkInternal(
::new BenchType(name, std::forward<Lambda>(fn)));
}
Expand Down
5 changes: 2 additions & 3 deletions llvm/utils/benchmark/src/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ bool GetSysctl(std::string const& Name, std::string* Out) {
return true;
}

template <class Tp,
class = typename std::enable_if<std::is_integral<Tp>::value>::type>
bool GetSysctl(std::string const& Name, Tp* Out) {
template <class Tp, class = std::enable_if_t<std::is_integral<Tp>::value>>
bool GetSysctl(std::string const &Name, Tp *Out) {
*Out = 0;
auto Buff = GetSysctlImp(Name);
if (!Buff) return false;
Expand Down
20 changes: 12 additions & 8 deletions llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3118,8 +3118,9 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
typedef typename View::const_reference StlContainerReference;
typedef decltype(std::begin(
std::declval<StlContainerReference>())) StlContainerConstIterator;
typedef typename std::remove_reference<decltype(
*std::declval<StlContainerConstIterator &>())>::type Element;
typedef std::remove_reference_t<decltype(
*std::declval<StlContainerConstIterator &>())>
Element;

// Constructs the matcher from a sequence of element values or
// element matchers.
Expand Down Expand Up @@ -3360,8 +3361,9 @@ class UnorderedElementsAreMatcherImpl
typedef typename View::const_reference StlContainerReference;
typedef decltype(std::begin(
std::declval<StlContainerReference>())) StlContainerConstIterator;
typedef typename std::remove_reference<decltype(
*std::declval<StlContainerConstIterator &>())>::type Element;
typedef std::remove_reference_t<decltype(
*std::declval<StlContainerConstIterator &>())>
Element;

// Constructs the matcher from a sequence of element values or
// element matchers.
Expand Down Expand Up @@ -3470,8 +3472,9 @@ class UnorderedElementsAreMatcher {
typedef typename View::const_reference StlContainerReference;
typedef decltype(std::begin(
std::declval<StlContainerReference>())) StlContainerConstIterator;
typedef typename std::remove_reference<decltype(
*std::declval<StlContainerConstIterator &>())>::type Element;
typedef std::remove_reference_t<decltype(
*std::declval<StlContainerConstIterator &>())>
Element;
typedef ::std::vector<Matcher<const Element&> > MatcherVec;
MatcherVec matchers;
matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
Expand Down Expand Up @@ -3499,8 +3502,9 @@ class ElementsAreMatcher {
typedef typename View::const_reference StlContainerReference;
typedef decltype(std::begin(
std::declval<StlContainerReference>())) StlContainerConstIterator;
typedef typename std::remove_reference<decltype(
*std::declval<StlContainerConstIterator &>())>::type Element;
typedef std::remove_reference_t<decltype(
*std::declval<StlContainerConstIterator &>())>
Element;
typedef ::std::vector<Matcher<const Element&> > MatcherVec;
MatcherVec matchers;
matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
Expand Down