diff --git a/llvm/include/llvm/Analysis/IR2Vec.h b/llvm/include/llvm/Analysis/IR2Vec.h index e3a0b3fef3abe..7a68773a2643a 100644 --- a/llvm/include/llvm/Analysis/IR2Vec.h +++ b/llvm/include/llvm/Analysis/IR2Vec.h @@ -110,8 +110,8 @@ struct Embedding { return Data[Itr]; } - using iterator = typename std::vector::iterator; - using const_iterator = typename std::vector::const_iterator; + using iterator = std::vector::iterator; + using const_iterator = std::vector::const_iterator; iterator begin() { return Data.begin(); } iterator end() { return Data.end(); } diff --git a/llvm/include/llvm/Analysis/LoopIterator.h b/llvm/include/llvm/Analysis/LoopIterator.h index 523d2a21825d0..1ac8e68bfa2f1 100644 --- a/llvm/include/llvm/Analysis/LoopIterator.h +++ b/llvm/include/llvm/Analysis/LoopIterator.h @@ -45,12 +45,12 @@ struct LoopBodyTraits { class WrappedSuccIterator : public iterator_adaptor_base< WrappedSuccIterator, succ_iterator, - typename std::iterator_traits::iterator_category, - NodeRef, std::ptrdiff_t, NodeRef *, NodeRef> { + std::iterator_traits::iterator_category, NodeRef, + std::ptrdiff_t, NodeRef *, NodeRef> { using BaseT = iterator_adaptor_base< WrappedSuccIterator, succ_iterator, - typename std::iterator_traits::iterator_category, - NodeRef, std::ptrdiff_t, NodeRef *, NodeRef>; + std::iterator_traits::iterator_category, NodeRef, + std::ptrdiff_t, NodeRef *, NodeRef>; const Loop *L; diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h index cbb942f022244..07d39ab3e10a9 100644 --- a/llvm/include/llvm/Analysis/MemorySSA.h +++ b/llvm/include/llvm/Analysis/MemorySSA.h @@ -1247,7 +1247,7 @@ class upward_defs_iterator return DefIterator == Other.DefIterator; } - typename std::iterator_traits::reference operator*() const { + std::iterator_traits::reference operator*() const { assert(DefIterator != OriginalAccess->defs_end() && "Tried to access past the end of our iterator"); return CurrentPair; diff --git a/llvm/include/llvm/CodeGen/DIE.h b/llvm/include/llvm/CodeGen/DIE.h index 32f46517677f2..92265fd86ebb9 100644 --- a/llvm/include/llvm/CodeGen/DIE.h +++ b/llvm/include/llvm/CodeGen/DIE.h @@ -653,7 +653,7 @@ template class IntrusiveBackList : IntrusiveBackListBase { public: const_iterator() = default; // Placate MSVC by explicitly scoping 'iterator'. - const_iterator(typename IntrusiveBackList::iterator X) : N(X.N) {} + const_iterator(IntrusiveBackList::iterator X) : N(X.N) {} explicit const_iterator(const T *N) : N(N) {} const_iterator &operator++() { diff --git a/llvm/include/llvm/CodeGen/RDFRegisters.h b/llvm/include/llvm/CodeGen/RDFRegisters.h index 82027cad53bdb..3b7454e1e552f 100644 --- a/llvm/include/llvm/CodeGen/RDFRegisters.h +++ b/llvm/include/llvm/CodeGen/RDFRegisters.h @@ -294,7 +294,7 @@ struct RegisterAggr { ref_iterator ref_begin() const { return ref_iterator(*this, false); } ref_iterator ref_end() const { return ref_iterator(*this, true); } - using unit_iterator = typename BitVector::const_set_bits_iterator; + using unit_iterator = BitVector::const_set_bits_iterator; unit_iterator unit_begin() const { return Units.set_bits_begin(); } unit_iterator unit_end() const { return Units.set_bits_end(); } diff --git a/llvm/include/llvm/CodeGen/RegAllocRegistry.h b/llvm/include/llvm/CodeGen/RegAllocRegistry.h index cd81e084a859b..db6264085b8a1 100644 --- a/llvm/include/llvm/CodeGen/RegAllocRegistry.h +++ b/llvm/include/llvm/CodeGen/RegAllocRegistry.h @@ -67,7 +67,7 @@ class RegisterRegAlloc : public RegisterRegAllocBase { /// RegisterRegAlloc's global Registry tracks allocator registration. template MachinePassRegistry::FunctionPassCtor> -RegisterRegAllocBase::Registry; + RegisterRegAllocBase::Registry; } // end namespace llvm diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h index be78647cf9fea..b7d6e725faeeb 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h @@ -136,8 +136,8 @@ class DWARFUnitVector final : public SmallVector, 1> public: using UnitVector = SmallVectorImpl>; - using iterator = typename UnitVector::iterator; - using iterator_range = llvm::iterator_range; + using iterator = UnitVector::iterator; + using iterator_range = llvm::iterator_range; using compile_unit_range = decltype(make_filter_range(std::declval(), isCompileUnit)); diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h index 8992faead73bb..bbed56b517093 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h +++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h @@ -32,7 +32,7 @@ struct FileInfoSubstreamHeader; class DbiModuleSourceFilesIterator : public iterator_facade_base { - using BaseType = typename DbiModuleSourceFilesIterator::iterator_facade_base; + using BaseType = DbiModuleSourceFilesIterator::iterator_facade_base; public: LLVM_ABI DbiModuleSourceFilesIterator(const DbiModuleList &Modules, diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryResolver.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryResolver.h index 91829953a2405..7cc78d4be2792 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryResolver.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryResolver.h @@ -100,7 +100,7 @@ class LibraryManager { class FilteredView { public: using Map = StringMap>; - using Iterator = typename Map::const_iterator; + using Iterator = Map::const_iterator; class FilterIterator { public: FilterIterator(Iterator it_, Iterator end_, LibState S, PathType K) diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h index 6e1d6421b8d33..bbb8bee515258 100644 --- a/llvm/include/llvm/MC/MCAssembler.h +++ b/llvm/include/llvm/MC/MCAssembler.h @@ -198,8 +198,8 @@ class MCAssembler { const_iterator end() const { return Sections.end(); } SmallVectorImpl &getSymbols() { return Symbols; } - iterator_range::const_iterator>> + iterator_range< + pointee_iterator::const_iterator>> symbols() const { return make_pointee_range(Symbols); } diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h index 51fb40bad201d..e3e8d895a63f4 100644 --- a/llvm/lib/IR/ConstantsContext.h +++ b/llvm/lib/IR/ConstantsContext.h @@ -535,7 +535,7 @@ struct ConstantPtrAuthKeyType { unsigned getHash() const { return hash_combine_range(Operands); } - using TypeClass = typename ConstantInfo::TypeClass; + using TypeClass = ConstantInfo::TypeClass; ConstantPtrAuth *create(TypeClass *Ty) const { return new ConstantPtrAuth(Operands[0], cast(Operands[1]), diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index 655e818ceb96b..e8352be692aaf 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -2227,7 +2227,7 @@ static std::optional instCombineSVEPTest(InstCombiner &IC, return std::nullopt; } -template +template static std::optional instCombineSVEVectorFuseMulAddSub(InstCombiner &IC, IntrinsicInst &II, bool MergeIntoAddendOp) { diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExceptionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyExceptionInfo.h index 7845cdfaebec7..1bfc61f0ab611 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyExceptionInfo.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblyExceptionInfo.h @@ -76,7 +76,7 @@ class WebAssemblyException { BlockSet.insert(MBB); } ArrayRef getBlocks() const { return Blocks; } - using block_iterator = typename ArrayRef::const_iterator; + using block_iterator = ArrayRef::const_iterator; block_iterator block_begin() const { return getBlocks().begin(); } block_iterator block_end() const { return getBlocks().end(); } inline iterator_range blocks() const { @@ -96,7 +96,7 @@ class WebAssemblyException { void addSubException(std::unique_ptr E) { SubExceptions.push_back(std::move(E)); } - using iterator = typename decltype(SubExceptions)::const_iterator; + using iterator = decltype(SubExceptions)::const_iterator; iterator begin() const { return SubExceptions.begin(); } iterator end() const { return SubExceptions.end(); } diff --git a/llvm/lib/Target/WebAssembly/WebAssemblySortRegion.h b/llvm/lib/Target/WebAssembly/WebAssemblySortRegion.h index e92bf17641854..96b8a4e33cbb7 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblySortRegion.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblySortRegion.h @@ -35,7 +35,7 @@ class SortRegion { virtual MachineBasicBlock *getHeader() const = 0; virtual bool contains(const MachineBasicBlock *MBB) const = 0; virtual unsigned getNumBlocks() const = 0; - using block_iterator = typename ArrayRef::const_iterator; + using block_iterator = ArrayRef::const_iterator; virtual iterator_range blocks() const = 0; virtual bool isLoop() const = 0; }; diff --git a/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp b/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp index 090060eaa65e1..b655183b6b49b 100644 --- a/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp +++ b/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp @@ -115,9 +115,9 @@ struct MachineGadgetGraph : ImmutableGraph { static constexpr MachineInstr *const ArgNodeSentinel = nullptr; using GraphT = ImmutableGraph; - using Node = typename GraphT::Node; - using Edge = typename GraphT::Edge; - using size_type = typename GraphT::size_type; + using Node = GraphT::Node; + using Edge = GraphT::Edge; + using size_type = GraphT::size_type; MachineGadgetGraph(std::unique_ptr Nodes, std::unique_ptr Edges, size_type NodesSize, size_type EdgesSize, int NumFences = 0, int NumGadgets = 0) @@ -191,10 +191,10 @@ template <> struct DOTGraphTraits : DefaultDOTGraphTraits { using GraphType = MachineGadgetGraph; using Traits = llvm::GraphTraits; - using NodeRef = typename Traits::NodeRef; - using EdgeRef = typename Traits::EdgeRef; - using ChildIteratorType = typename Traits::ChildIteratorType; - using ChildEdgeIteratorType = typename Traits::ChildEdgeIteratorType; + using NodeRef = Traits::NodeRef; + using EdgeRef = Traits::EdgeRef; + using ChildIteratorType = Traits::ChildIteratorType; + using ChildEdgeIteratorType = Traits::ChildEdgeIteratorType; DOTGraphTraits(bool IsSimple = false) : DefaultDOTGraphTraits(IsSimple) {} @@ -335,7 +335,7 @@ X86LoadValueInjectionLoadHardeningPass::getGadgetGraph( L.computePhiInfo(); GraphBuilder Builder; - using GraphIter = typename GraphBuilder::BuilderNodeRef; + using GraphIter = GraphBuilder::BuilderNodeRef; DenseMap NodeMap; int FenceCount = 0, GadgetCount = 0; auto MaybeAddNode = [&NodeMap, &Builder](MachineInstr *MI) { diff --git a/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp b/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp index cda07e81faf1e..f55bc9c1a28c2 100644 --- a/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp +++ b/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp @@ -32,7 +32,7 @@ using namespace llvm::MachO; using namespace llvm::MachO::DylibReader; using TripleVec = std::vector; -static typename TripleVec::iterator emplace(TripleVec &Container, Triple &&T) { +static TripleVec::iterator emplace(TripleVec &Container, Triple &&T) { auto I = partition_point(Container, [=](const Triple &CT) { return std::forward_as_tuple(CT.getArch(), CT.getOS(), CT.getEnvironment()) < diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp index 50485615a9d4c..5ed47aec08b25 100644 --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -3619,7 +3619,7 @@ struct AAIntraFnReachabilityFunction final return true; RQITy StackRQI(A, From, To, ExclusionSet, false); - typename RQITy::Reachable Result; + RQITy::Reachable Result; if (!NonConstThis->checkQueryCache(A, StackRQI, Result)) return NonConstThis->isReachableImpl(A, StackRQI, /*IsTemporaryRQI=*/true); @@ -10701,7 +10701,7 @@ struct AAInterFnReachabilityFunction auto *NonConstThis = const_cast(this); RQITy StackRQI(A, From, To, ExclusionSet, false); - typename RQITy::Reachable Result; + RQITy::Reachable Result; if (!NonConstThis->checkQueryCache(A, StackRQI, Result)) return NonConstThis->isReachableImpl(A, StackRQI, /*IsTemporaryRQI=*/true); diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp index 894d83fa530b1..d35ae4730a9f3 100644 --- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp +++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp @@ -1034,11 +1034,11 @@ class IndexCallsiteContextGraph } // namespace template <> -struct llvm::DenseMapInfo::CallInfo> : public DenseMapInfo> {}; template <> -struct llvm::DenseMapInfo::CallInfo> : public DenseMapInfo> {}; template <> diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp index 0f3978f56045e..5f6f66a4bc213 100644 --- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp +++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp @@ -143,8 +143,8 @@ struct SubGraphTraits { class WrappedSuccIterator : public iterator_adaptor_base< WrappedSuccIterator, BaseSuccIterator, - typename std::iterator_traits::iterator_category, - NodeRef, std::ptrdiff_t, NodeRef *, NodeRef> { + std::iterator_traits::iterator_category, NodeRef, + std::ptrdiff_t, NodeRef *, NodeRef> { SmallDenseSet *Nodes; public: diff --git a/llvm/lib/Transforms/Vectorize/VPlanSLP.h b/llvm/lib/Transforms/Vectorize/VPlanSLP.h index 77ff36cc2c600..44972c68ba9c9 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanSLP.h +++ b/llvm/lib/Transforms/Vectorize/VPlanSLP.h @@ -89,8 +89,7 @@ class VPlanSlp { /// Width of the widest combined bundle in bits. unsigned WidestBundleBits = 0; - using MultiNodeOpTy = - typename std::pair>; + using MultiNodeOpTy = std::pair>; // Input operand bundles for the current multi node. Each multi node operand // bundle contains values not matching the multi node's opcode. They will diff --git a/llvm/tools/llvm-xray/xray-graph.h b/llvm/tools/llvm-xray/xray-graph.h index fd9644908426f..bf25f8d11c5b9 100644 --- a/llvm/tools/llvm-xray/xray-graph.h +++ b/llvm/tools/llvm-xray/xray-graph.h @@ -86,7 +86,7 @@ class GraphRenderer { }; GraphT G; - using VertexIdentifier = typename decltype(G)::VertexIdentifier; + using VertexIdentifier = decltype(G)::VertexIdentifier; using EdgeIdentifier = decltype(G)::EdgeIdentifier; /// Use a Map to store the Function stack for each thread whilst building the diff --git a/llvm/unittests/Object/XCOFFObjectFileTest.cpp b/llvm/unittests/Object/XCOFFObjectFileTest.cpp index f696cde99e0ec..10217f6c2c396 100644 --- a/llvm/unittests/Object/XCOFFObjectFileTest.cpp +++ b/llvm/unittests/Object/XCOFFObjectFileTest.cpp @@ -18,10 +18,10 @@ using namespace llvm::XCOFF; TEST(XCOFFObjectFileTest, XCOFFObjectType) { // Create an arbitrary object of a non-XCOFF type and test that // dyn_cast returns null for it. - char Buf[sizeof(typename ELF64LE::Ehdr)] = {}; + char Buf[sizeof(ELF64LE::Ehdr)] = {}; memcpy(Buf, "\177ELF", 4); - auto *EHdr = reinterpret_cast(Buf); + auto *EHdr = reinterpret_cast(Buf); EHdr->e_ident[llvm::ELF::EI_CLASS] = llvm::ELF::ELFCLASS64; EHdr->e_ident[llvm::ELF::EI_DATA] = llvm::ELF::ELFDATA2LSB; diff --git a/llvm/unittests/XRay/GraphTest.cpp b/llvm/unittests/XRay/GraphTest.cpp index 37f07cc721c61..0d46a3d9ad377 100644 --- a/llvm/unittests/XRay/GraphTest.cpp +++ b/llvm/unittests/XRay/GraphTest.cpp @@ -23,8 +23,8 @@ struct EAttr { unsigned EA; }; typedef Graph GraphT; -typedef typename GraphT::VertexIdentifier VI; -typedef typename GraphT::EdgeIdentifier EI; +typedef GraphT::VertexIdentifier VI; +typedef GraphT::EdgeIdentifier EI; // Test Fixture template class GraphTest : public testing::Test { @@ -56,8 +56,8 @@ template class GraphTest : public testing::Test { typedef ::testing::Types GraphTestTypes; -using VVT = typename GraphT::VertexValueType; -using EVT = typename GraphT::EdgeValueType; +using VVT = GraphT::VertexValueType; +using EVT = GraphT::EdgeValueType; TYPED_TEST_SUITE(GraphTest, GraphTestTypes, ); diff --git a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp index 8d0ec9abd23ae..2eb94b7e92674 100644 --- a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp +++ b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp @@ -1651,8 +1651,7 @@ template <> struct llvm::GraphTraits { struct ChildIteratorType : public iterator_adaptor_base< ChildIteratorType, CompMapIt, - typename std::iterator_traits::iterator_category, - NodeRef> { + std::iterator_traits::iterator_category, NodeRef> { ChildIteratorType(CompMapIt I) : ChildIteratorType::iterator_adaptor_base(I) {} diff --git a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h index fdcca1d3aa8c0..84dfca46dfbfa 100644 --- a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h +++ b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h @@ -621,7 +621,7 @@ class RuleMatcher : public Matcher { DefinedInsnVariablesMap::const_iterator defined_insn_vars_end() const { return InsnVariableIDs.end(); } - iterator_range + iterator_range defined_insn_vars() const { return make_range(defined_insn_vars_begin(), defined_insn_vars_end()); } @@ -632,8 +632,7 @@ class RuleMatcher : public Matcher { MutatableInsnSet::const_iterator mutatable_insns_end() const { return MutatableInsns.end(); } - iterator_range - mutatable_insns() const { + iterator_range mutatable_insns() const { return make_range(mutatable_insns_begin(), mutatable_insns_end()); } void reserveInsnMatcherForMutation(InstructionMatcher *InsnMatcher) { diff --git a/llvm/utils/TableGen/Common/InfoByHwMode.cpp b/llvm/utils/TableGen/Common/InfoByHwMode.cpp index 4c8197dc60c14..2b3155cace9f3 100644 --- a/llvm/utils/TableGen/Common/InfoByHwMode.cpp +++ b/llvm/utils/TableGen/Common/InfoByHwMode.cpp @@ -174,7 +174,7 @@ bool RegSizeInfoByHwMode::hasStricterSpillThan( } void RegSizeInfoByHwMode::writeToStream(raw_ostream &OS) const { - typedef typename decltype(Map)::value_type PairType; + typedef decltype(Map)::value_type PairType; std::vector Pairs; for (const auto &P : Map) Pairs.push_back(&P); diff --git a/llvm/utils/TableGen/RegisterBankEmitter.cpp b/llvm/utils/TableGen/RegisterBankEmitter.cpp index 61b0b661c0f32..60aa2d80aee3e 100644 --- a/llvm/utils/TableGen/RegisterBankEmitter.cpp +++ b/llvm/utils/TableGen/RegisterBankEmitter.cpp @@ -100,8 +100,7 @@ class RegisterBank { return RCsWithLargestRegSize[HwMode]; } - iterator_range - register_classes() const { + iterator_range register_classes() const { return RCs; } };