diff --git a/include/swift/SIL/CFG.h b/include/swift/SIL/CFG.h index 11fb15d760b..9d191656800 100644 --- a/include/swift/SIL/CFG.h +++ b/include/swift/SIL/CFG.h @@ -92,7 +92,7 @@ struct GraphTraits static NodeRef getEntryNode(GraphType F) { return &F->front(); } - typedef pointer_iterator nodes_iterator; + using nodes_iterator = pointer_iterator; static nodes_iterator nodes_begin(GraphType F) { return nodes_iterator(F->begin()); } @@ -104,12 +104,12 @@ struct GraphTraits template <> struct GraphTraits > : public GraphTraits > { - typedef Inverse GraphType; - typedef NodeRef NodeRef; + using GraphType = Inverse; + using NodeRef = NodeRef; static NodeRef getEntryNode(GraphType F) { return &F.Graph->front(); } - typedef pointer_iterator nodes_iterator; + using nodes_iterator = pointer_iterator; static nodes_iterator nodes_begin(GraphType F) { return nodes_iterator(F.Graph->begin()); } diff --git a/include/swift/SIL/Dominance.h b/include/swift/SIL/Dominance.h index 091a9a60ac9..505c1cd9749 100644 --- a/include/swift/SIL/Dominance.h +++ b/include/swift/SIL/Dominance.h @@ -192,7 +192,7 @@ namespace llvm { /// iterable by generic graph iterators. template <> struct GraphTraits { using ChildIteratorType = swift::DominanceInfoNode::iterator; - typedef swift::DominanceInfoNode *NodeRef; + using NodeRef = swift::DominanceInfoNode *; static NodeRef getEntryNode(NodeRef N) { return N; } static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); } @@ -201,7 +201,7 @@ template <> struct GraphTraits { template <> struct GraphTraits { using ChildIteratorType = swift::DominanceInfoNode::const_iterator; - typedef const swift::DominanceInfoNode *NodeRef; + using NodeRef = const swift::DominanceInfoNode *; static NodeRef getEntryNode(NodeRef N) { return N; } static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); } diff --git a/include/swift/SIL/PatternMatch.h b/include/swift/SIL/PatternMatch.h index 793de6d9b4c..87410237943 100644 --- a/include/swift/SIL/PatternMatch.h +++ b/include/swift/SIL/PatternMatch.h @@ -140,17 +140,17 @@ struct OneOf_match; template struct OneOf_match { - typedef T0 Ty; + using Ty = T0; }; template struct OneOf_match { - typedef match_combine_or Ty; + using Ty = match_combine_or; }; template struct OneOf_match { - typedef typename OneOf_match, Arguments ...>::Ty Ty; + using Ty = typename OneOf_match, Arguments...>::Ty; }; /// This is a vararg version of m_CombineOr. It is a boolean "or" of @@ -584,18 +584,18 @@ struct Apply_match; template struct Apply_match { - typedef Callee_match Ty; + using Ty = Callee_match; }; template struct Apply_match { - typedef match_combine_and, Argument_match> Ty; + using Ty = match_combine_and, Argument_match>; }; template struct Apply_match { - typedef match_combine_and::Ty, - Argument_match > Ty; + using Ty = match_combine_and::Ty, + Argument_match>; }; /// Match only an ApplyInst's Callee. diff --git a/include/swift/SIL/SILCoverageMap.h b/include/swift/SIL/SILCoverageMap.h index 4174797ff25..a0e41c3b61d 100644 --- a/include/swift/SIL/SILCoverageMap.h +++ b/include/swift/SIL/SILCoverageMap.h @@ -145,7 +145,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILCoverageMap> : public ilist_default_traits<::swift::SILCoverageMap> { - typedef ::swift::SILCoverageMap SILCoverageMap; + using SILCoverageMap = ::swift::SILCoverageMap; public: static void deleteNode(SILCoverageMap *VT) { VT->~SILCoverageMap(); } diff --git a/include/swift/SIL/SILDebuggerClient.h b/include/swift/SIL/SILDebuggerClient.h index 7c097067e1b..e6c2bf7a2bd 100644 --- a/include/swift/SIL/SILDebuggerClient.h +++ b/include/swift/SIL/SILDebuggerClient.h @@ -27,7 +27,7 @@ class SILBuilder; class SILDebuggerClient : public DebuggerClient { public: - typedef SmallVectorImpl ResultVector; + using ResultVector = SmallVectorImpl; SILDebuggerClient(ASTContext &C) : DebuggerClient(C) { } virtual ~SILDebuggerClient() = default; diff --git a/include/swift/SIL/SILDeclRef.h b/include/swift/SIL/SILDeclRef.h index 133e501520a..38b00d67412 100644 --- a/include/swift/SIL/SILDeclRef.h +++ b/include/swift/SIL/SILDeclRef.h @@ -80,8 +80,8 @@ enum ForDefinition_t : bool { /// declaration, such as uncurry levels of a function, the allocating and /// initializing entry points of a constructor, etc. struct SILDeclRef { - typedef llvm::PointerUnion Loc; - + using Loc = llvm::PointerUnion; + /// Represents the "kind" of the SILDeclRef. For some Swift decls there /// are multiple SIL entry points, and the kind is used to distinguish them. enum class Kind : unsigned { diff --git a/include/swift/SIL/SILDefaultWitnessTable.h b/include/swift/SIL/SILDefaultWitnessTable.h index 1c747b2e678..0a95ef2e994 100644 --- a/include/swift/SIL/SILDefaultWitnessTable.h +++ b/include/swift/SIL/SILDefaultWitnessTable.h @@ -174,7 +174,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILDefaultWitnessTable> : public ilist_default_traits<::swift::SILDefaultWitnessTable> { - typedef ::swift::SILDefaultWitnessTable SILDefaultWitnessTable; + using SILDefaultWitnessTable = ::swift::SILDefaultWitnessTable; public: static void deleteNode(SILDefaultWitnessTable *WT) { WT->~SILDefaultWitnessTable(); } diff --git a/include/swift/SIL/SILFunction.h b/include/swift/SIL/SILFunction.h index a929b202a42..f4d4e2870f7 100644 --- a/include/swift/SIL/SILFunction.h +++ b/include/swift/SIL/SILFunction.h @@ -97,7 +97,7 @@ private: class SILFunction : public llvm::ilist_node, public SILAllocated { public: - typedef llvm::iplist BlockListType; + using BlockListType = llvm::iplist; private: friend class SILBasicBlock; @@ -694,9 +694,9 @@ public: BlockListType &getBlocks() { return BlockList; } const BlockListType &getBlocks() const { return BlockList; } - typedef BlockListType::iterator iterator; - typedef BlockListType::reverse_iterator reverse_iterator; - typedef BlockListType::const_iterator const_iterator; + using iterator = BlockListType::iterator; + using reverse_iterator = BlockListType::reverse_iterator; + using const_iterator = BlockListType::const_iterator; bool empty() const { return BlockList.empty(); } iterator begin() { return BlockList.begin(); } @@ -881,7 +881,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILFunction> : public ilist_default_traits<::swift::SILFunction> { - typedef ::swift::SILFunction SILFunction; + using SILFunction = ::swift::SILFunction; public: static void deleteNode(SILFunction *V) { V->~SILFunction(); } diff --git a/include/swift/SIL/SILGlobalVariable.h b/include/swift/SIL/SILGlobalVariable.h index de41c5231fe..a1d07bbb497 100644 --- a/include/swift/SIL/SILGlobalVariable.h +++ b/include/swift/SIL/SILGlobalVariable.h @@ -214,7 +214,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILGlobalVariable> : public ilist_default_traits<::swift::SILGlobalVariable> { - typedef ::swift::SILGlobalVariable SILGlobalVariable; + using SILGlobalVariable = ::swift::SILGlobalVariable; public: static void deleteNode(SILGlobalVariable *V) {} diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index f062aa7f9f0..5b406b3c0bb 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -1081,8 +1081,8 @@ class InstructionBaseWithTrailingOperands protected: friend llvm::TrailingObjects; - typedef llvm::TrailingObjects - TrailingObjects; + using TrailingObjects = + llvm::TrailingObjects; using TrailingObjects::totalSizeToAlloc; @@ -1158,8 +1158,9 @@ protected: friend InstructionBaseWithTrailingOperands; - typedef InstructionBaseWithTrailingOperands< - Kind, Derived, Operand, OtherTrailingTypes...> TrailingObjects; + using TrailingObjects = + InstructionBaseWithTrailingOperands; public: template diff --git a/include/swift/SIL/SILLocation.h b/include/swift/SIL/SILLocation.h index d3f44f3e590..fb8418c31f1 100644 --- a/include/swift/SIL/SILLocation.h +++ b/include/swift/SIL/SILLocation.h @@ -65,7 +65,7 @@ private: using type = Pattern; }; - typedef llvm::PointerUnion4 ASTNodeTy; + using ASTNodeTy = llvm::PointerUnion4; public: enum LocationKind : unsigned { @@ -419,7 +419,7 @@ public: } /// Fingerprint a DebugLoc for use in a DenseMap. - typedef std::pair, StringRef> DebugLocKey; + using DebugLocKey = std::pair, StringRef>; struct DebugLocHash : public DebugLocKey { DebugLocHash(DebugLoc L) : DebugLocKey({{L.Line, L.Column}, L.Filename}) {} }; diff --git a/include/swift/SIL/SILModule.h b/include/swift/SIL/SILModule.h index fcb0c91ec78..d88c7bbacd4 100644 --- a/include/swift/SIL/SILModule.h +++ b/include/swift/SIL/SILModule.h @@ -217,7 +217,7 @@ private: // Callbacks registered by the SIL optimizer to run on each deserialized // function body. This is intentionally a stateless type because the // ModuleDecl and SILFunction should be sufficient context. - typedef void (*SILFunctionBodyCallback)(ModuleDecl *, SILFunction *F); + using SILFunctionBodyCallback = void (*)(ModuleDecl *, SILFunction *F); SmallVector DeserializationCallbacks; /// The SILLoader used when linking functions into this module. diff --git a/include/swift/SIL/SILProperty.h b/include/swift/SIL/SILProperty.h index a59c3f415c1..3a3c46b5d36 100644 --- a/include/swift/SIL/SILProperty.h +++ b/include/swift/SIL/SILProperty.h @@ -79,7 +79,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILProperty> : public ilist_default_traits<::swift::SILProperty> { - typedef ::swift::SILProperty SILProperty; + using SILProperty = ::swift::SILProperty; public: static void deleteNode(SILProperty *VT) { VT->~SILProperty(); } diff --git a/include/swift/SIL/SILVTable.h b/include/swift/SIL/SILVTable.h index fb9cc7235b4..285b3f7435d 100644 --- a/include/swift/SIL/SILVTable.h +++ b/include/swift/SIL/SILVTable.h @@ -174,7 +174,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILVTable> : public ilist_default_traits<::swift::SILVTable> { - typedef ::swift::SILVTable SILVTable; + using SILVTable = ::swift::SILVTable; static void deleteNode(SILVTable *VT) { VT->~SILVTable(); } diff --git a/include/swift/SIL/SILValue.h b/include/swift/SIL/SILValue.h index dedf7539c7a..d7d14ba5fe7 100644 --- a/include/swift/SIL/SILValue.h +++ b/include/swift/SIL/SILValue.h @@ -440,7 +440,7 @@ private: inline SILValue getSILValueType(const Operand &op) { return op.get(); } -typedef ArrayRefView OperandValueArrayRef; +using OperandValueArrayRef = ArrayRefView; /// An iterator over all uses of a ValueBase. class ValueBaseUseIterator : public std::iterator struct simplify_type { - typedef ::swift::ValueBase *SimpleType; + using SimpleType = ::swift::ValueBase *; static SimpleType getSimplifiedValue(::swift::SILValue Val) { return Val; } diff --git a/include/swift/SIL/SILWitnessTable.h b/include/swift/SIL/SILWitnessTable.h index 6e509544072..6de1914aa74 100644 --- a/include/swift/SIL/SILWitnessTable.h +++ b/include/swift/SIL/SILWitnessTable.h @@ -318,7 +318,7 @@ namespace llvm { template <> struct ilist_traits<::swift::SILWitnessTable> : public ilist_default_traits<::swift::SILWitnessTable> { - typedef ::swift::SILWitnessTable SILWitnessTable; + using SILWitnessTable = ::swift::SILWitnessTable; public: static void deleteNode(SILWitnessTable *WT) { WT->~SILWitnessTable(); } diff --git a/include/swift/SIL/TypeLowering.h b/include/swift/SIL/TypeLowering.h index 09fa63a308d..26990c6cc4e 100644 --- a/include/swift/SIL/TypeLowering.h +++ b/include/swift/SIL/TypeLowering.h @@ -938,7 +938,7 @@ private: namespace llvm { template<> struct DenseMapInfo { - typedef swift::Lowering::TypeConverter::CachingTypeKey CachingTypeKey; + using CachingTypeKey = swift::Lowering::TypeConverter::CachingTypeKey; using APCachingKey = swift::Lowering::AbstractionPattern::CachingKey; using CachingKeyInfo = DenseMapInfo; @@ -967,7 +967,7 @@ namespace llvm { }; template<> struct DenseMapInfo { - typedef swift::Lowering::TypeConverter::OverrideKey OverrideKey; + using OverrideKey = swift::Lowering::TypeConverter::OverrideKey; using SILDeclRefInfo = DenseMapInfo; diff --git a/include/swift/SIL/TypeSubstCloner.h b/include/swift/SIL/TypeSubstCloner.h index b5b4ae4609d..4f857e9d058 100644 --- a/include/swift/SIL/TypeSubstCloner.h +++ b/include/swift/SIL/TypeSubstCloner.h @@ -34,7 +34,7 @@ class TypeSubstCloner : public SILClonerWithScopes { friend class SILInstructionVisitor; friend class SILCloner; - typedef SILClonerWithScopes super; + using super = SILClonerWithScopes; void postProcess(SILInstruction *Orig, SILInstruction *Cloned) { llvm_unreachable("Clients need to explicitly call a base class impl!"); diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index f0102db6924..e8d99b9c3cb 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -4386,8 +4386,8 @@ public: } // end unnamed namespace -typedef llvm::StringMap FileNameToGroupNameMap; -typedef std::unique_ptr pFileNameToGroupNameMap; +using FileNameToGroupNameMap = llvm::StringMap; +using pFileNameToGroupNameMap = std::unique_ptr; class YamlGroupInputParser { StringRef RecordPath; diff --git a/lib/Serialization/Serialization.h b/lib/Serialization/Serialization.h index 340f88a235d..c571c3b0991 100644 --- a/lib/Serialization/Serialization.h +++ b/lib/Serialization/Serialization.h @@ -32,7 +32,7 @@ namespace swift { namespace serialization { -typedef ArrayRef FilenamesTy; +using FilenamesTy = ArrayRef; class Serializer { SmallVector Buffer; diff --git a/lib/Serialization/SerializedModuleLoader.cpp b/lib/Serialization/SerializedModuleLoader.cpp index eac4d4ce801..bd3ade2871a 100644 --- a/lib/Serialization/SerializedModuleLoader.cpp +++ b/lib/Serialization/SerializedModuleLoader.cpp @@ -28,7 +28,7 @@ using namespace swift; namespace { -typedef std::pair AccessPathElem; +using AccessPathElem = std::pair; } // end unnamed namespace // Defined out-of-line so that we can see ~ModuleFile.