From: NAKAMURA Takumi Date: Mon, 10 Aug 2015 04:21:43 +0000 (+0000) Subject: Reformat linebreaks. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=e4b461c8d72f7b71b94ba4061b1c5d24e5a85e59 Reformat linebreaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244430 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h index a187515f859..83f821b8f15 100644 --- a/include/llvm/ADT/APSInt.h +++ b/include/llvm/ADT/APSInt.h @@ -21,6 +21,7 @@ namespace llvm { class APSInt : public APInt { bool IsUnsigned; + public: /// Default constructor that creates an uninitialized APInt. explicit APSInt() : IsUnsigned(false) {} @@ -246,7 +247,6 @@ public: return this->operator|(RHS); } - APSInt operator^(const APSInt& RHS) const { assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); return APSInt(static_cast(*this) ^ RHS, IsUnsigned); diff --git a/include/llvm/ADT/DenseSet.h b/include/llvm/ADT/DenseSet.h index d34024005df..198c778c92c 100644 --- a/include/llvm/ADT/DenseSet.h +++ b/include/llvm/ADT/DenseSet.h @@ -42,6 +42,7 @@ class DenseSet { static_assert(sizeof(typename MapTy::value_type) == sizeof(ValueT), "DenseMap buckets unexpectedly large!"); MapTy TheMap; + public: typedef ValueT key_type; typedef ValueT value_type; @@ -79,6 +80,7 @@ public: class Iterator { typename MapTy::iterator I; friend class DenseSet; + public: typedef typename MapTy::iterator::difference_type difference_type; typedef ValueT value_type; @@ -99,6 +101,7 @@ public: class ConstIterator { typename MapTy::const_iterator I; friend class DenseSet; + public: typedef typename MapTy::const_iterator::difference_type difference_type; typedef ValueT value_type; diff --git a/include/llvm/ADT/DepthFirstIterator.h b/include/llvm/ADT/DepthFirstIterator.h index d79b9acacfa..ca147620c57 100644 --- a/include/llvm/ADT/DepthFirstIterator.h +++ b/include/llvm/ADT/DepthFirstIterator.h @@ -58,7 +58,6 @@ public: SetType &Visited; }; - // Generic Depth First Iterator template::NodeType*, 8>, @@ -77,6 +76,7 @@ class df_iterator : public std::iterator > VisitStack; + private: inline df_iterator(NodeType *Node) { this->Visited.insert(Node); @@ -195,7 +195,6 @@ public: } }; - // Provide global constructors that automatically figure out correct types... // template @@ -237,7 +236,6 @@ iterator_range> depth_first_ext(const T& G, return make_range(df_ext_begin(G, S), df_ext_end(G, S)); } - // Provide global definitions of inverse depth first iterators... template ::NodeType*, 8>, diff --git a/include/llvm/ADT/FoldingSet.h b/include/llvm/ADT/FoldingSet.h index 52d10c1c124..99d83d2622a 100644 --- a/include/llvm/ADT/FoldingSet.h +++ b/include/llvm/ADT/FoldingSet.h @@ -137,7 +137,6 @@ public: void *NextInFoldingSetBucket; public: - Node() : NextInFoldingSetBucket(nullptr) {} // Accessors @@ -182,13 +181,11 @@ public: bool empty() const { return NumNodes == 0; } private: - /// GrowHashTable - Double the size of the hash table and rehash everything. /// void GrowHashTable(); protected: - /// GetNodeProfile - Instantiations of the FoldingSet template implement /// this function to gather data bits for the given node. virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const = 0; @@ -269,6 +266,7 @@ template struct ContextualFoldingSetTrait class FoldingSetNodeIDRef { const unsigned *Data; size_t Size; + public: FoldingSetNodeIDRef() : Data(nullptr), Size(0) {} FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {} @@ -498,7 +496,6 @@ public: Ctx getContext() const { return Context; } - typedef FoldingSetIterator iterator; iterator begin() { return iterator(Buckets); } iterator end() { return iterator(Buckets+NumBuckets); } @@ -614,7 +611,6 @@ public: } }; - template class FoldingSetIterator : public FoldingSetIteratorImpl { public: @@ -666,7 +662,6 @@ public: } }; - template class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl { public: @@ -694,6 +689,7 @@ public: template class FoldingSetNodeWrapper : public FoldingSetNode { T data; + public: template explicit FoldingSetNodeWrapper(Ts &&... Args) @@ -716,8 +712,10 @@ public: /// information that would otherwise only be required for recomputing an ID. class FastFoldingSetNode : public FoldingSetNode { FoldingSetNodeID FastID; + protected: explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {} + public: void Profile(FoldingSetNodeID &ID) const { ID.AddNodeID(FastID); diff --git a/include/llvm/ADT/ImmutableMap.h b/include/llvm/ADT/ImmutableMap.h index 438dec2333c..1aa3d334163 100644 --- a/include/llvm/ADT/ImmutableMap.h +++ b/include/llvm/ADT/ImmutableMap.h @@ -55,7 +55,6 @@ struct ImutKeyValueInfo { } }; - template > class ImmutableMap { diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 45a40db85c0..d5915bcd89d 100644 --- a/include/llvm/ADT/PointerIntPair.h +++ b/include/llvm/ADT/PointerIntPair.h @@ -62,6 +62,7 @@ class PointerIntPair { // ShiftedIntMask - This is the bits for the integer shifted in place. ShiftedIntMask = (uintptr_t)(IntMask << IntShift) }; + public: PointerIntPair() : Value(0) {} PointerIntPair(PointerTy PtrVal, IntType IntVal) { diff --git a/include/llvm/ADT/ScopedHashTable.h b/include/llvm/ADT/ScopedHashTable.h index 5abe76c1225..8ad2d097e78 100644 --- a/include/llvm/ADT/ScopedHashTable.h +++ b/include/llvm/ADT/ScopedHashTable.h @@ -47,8 +47,8 @@ class ScopedHashTableVal { K Key; V Val; ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} -public: +public: const K &getKey() const { return Key; } const V &getValue() const { return Val; } V &getValue() { return Val; } @@ -92,6 +92,7 @@ class ScopedHashTableScope { ScopedHashTableVal *LastValInScope; void operator=(ScopedHashTableScope&) = delete; ScopedHashTableScope(ScopedHashTableScope&) = delete; + public: ScopedHashTableScope(ScopedHashTable &HT); ~ScopedHashTableScope(); @@ -109,10 +110,10 @@ private: } }; - template > class ScopedHashTableIterator { ScopedHashTableVal *Node; + public: ScopedHashTableIterator(ScopedHashTableVal *node) : Node(node) {} @@ -141,7 +142,6 @@ public: } }; - template class ScopedHashTable { public: @@ -149,6 +149,7 @@ public: /// to the name of the scope for this hash table. typedef ScopedHashTableScope ScopeTy; typedef unsigned size_type; + private: typedef ScopedHashTableVal ValTy; DenseMap TopLevelMap; @@ -159,13 +160,13 @@ private: ScopedHashTable(const ScopedHashTable&); // NOT YET IMPLEMENTED void operator=(const ScopedHashTable&); // NOT YET IMPLEMENTED friend class ScopedHashTableScope; + public: ScopedHashTable() : CurScope(nullptr) {} ScopedHashTable(AllocatorTy A) : CurScope(0), Allocator(A) {} ~ScopedHashTable() { assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); } - /// Access to the allocator. AllocatorTy &getAllocator() { return Allocator; } diff --git a/include/llvm/ADT/SetVector.h b/include/llvm/ADT/SetVector.h index 2125b274f53..20fd91ff05f 100644 --- a/include/llvm/ADT/SetVector.h +++ b/include/llvm/ADT/SetVector.h @@ -172,7 +172,6 @@ public: return true; } - /// \brief Count the number of elements of a given key in the SetVector. /// \returns 0 if the element is not in the SetVector, 1 if it is. size_type count(const key_type &key) const { diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index 3e3c9c154ef..a68bfaeff5b 100644 --- a/include/llvm/ADT/SmallPtrSet.h +++ b/include/llvm/ADT/SmallPtrSet.h @@ -48,6 +48,7 @@ class SmallPtrSetIteratorImpl; /// class SmallPtrSetImplBase { friend class SmallPtrSetIteratorImpl; + protected: /// SmallArray - Points to a fixed size set of buckets, used in 'small mode'. const void **SmallArray; @@ -133,6 +134,7 @@ private: void Grow(unsigned NewSize); void operator=(const SmallPtrSetImplBase &RHS) = delete; + protected: /// swap - Swaps the elements of two sets. /// Note: This method assumes that both sets have the same small size. @@ -148,6 +150,7 @@ class SmallPtrSetIteratorImpl { protected: const void *const *Bucket; const void *const *End; + public: explicit SmallPtrSetIteratorImpl(const void *const *BP, const void*const *E) : Bucket(BP), End(E) { @@ -231,7 +234,6 @@ template struct RoundUpToPowerOfTwo { enum { Val = RoundUpToPowerOfTwoH::Val }; }; - /// \brief A templated base class for \c SmallPtrSet which provides the /// typesafe interface that is common across all small sizes. @@ -243,6 +245,7 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase { typedef PointerLikeTypeTraits PtrTraits; SmallPtrSetImpl(const SmallPtrSetImpl&) = delete; + protected: // Constructors that forward to the base. SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that) @@ -303,6 +306,7 @@ class SmallPtrSet : public SmallPtrSetImpl { enum { SmallSizePowTwo = RoundUpToPowerOfTwo::Val }; /// SmallStorage - Fixed size storage used in 'small mode'. const void *SmallStorage[SmallSizePowTwo]; + public: SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {} SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {} @@ -333,7 +337,6 @@ public: SmallPtrSetImplBase::swap(RHS); } }; - } namespace std { diff --git a/include/llvm/ADT/SmallSet.h b/include/llvm/ADT/SmallSet.h index bc6493554c8..9ee4be713e5 100644 --- a/include/llvm/ADT/SmallSet.h +++ b/include/llvm/ADT/SmallSet.h @@ -37,6 +37,7 @@ class SmallSet { std::set Set; typedef typename SmallVector::const_iterator VIterator; typedef typename SmallVector::iterator mutable_iterator; + public: typedef size_t size_type; SmallSet() {} @@ -108,6 +109,7 @@ public: Vector.clear(); Set.clear(); } + private: bool isSmall() const { return Set.empty(); } diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 9d038560bf9..3b34360b07b 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -30,6 +30,7 @@ namespace llvm { /// StringMapEntryBase - Shared base class of StringMapEntry instances. class StringMapEntryBase { unsigned StrLen; + public: explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {} @@ -48,6 +49,7 @@ protected: unsigned NumItems; unsigned NumTombstones; unsigned ItemSize; + protected: explicit StringMapImpl(unsigned itemSize) : TheTable(nullptr), @@ -85,8 +87,10 @@ protected: /// RemoveKey - Remove the StringMapEntry for the specified key from the /// table, returning it. If the key is not in the table, this returns null. StringMapEntryBase *RemoveKey(StringRef Key); + private: void init(unsigned Size); + public: static StringMapEntryBase *getTombstoneVal() { return (StringMapEntryBase*)-1; @@ -112,6 +116,7 @@ public: template class StringMapEntry : public StringMapEntryBase { StringMapEntry(StringMapEntry &E) = delete; + public: ValueTy second; @@ -205,7 +210,6 @@ public: } }; - /// StringMap - This is an unconventional map that is specialized for handling /// keys that are "strings", which are basically ranges of bytes. This does some /// funky memory allocation and hashing things to make it extremely efficient, @@ -213,6 +217,7 @@ public: template class StringMap : public StringMapImpl { AllocatorTy Allocator; + public: typedef StringMapEntry MapEntryTy; @@ -386,11 +391,11 @@ public: } }; - template class StringMapConstIterator { protected: StringMapEntryBase **Ptr; + public: typedef StringMapEntry value_type; @@ -447,7 +452,6 @@ public: return static_cast*>(*this->Ptr); } }; - } #endif diff --git a/include/llvm/ADT/TinyPtrVector.h b/include/llvm/ADT/TinyPtrVector.h index f29608f3d3d..f7d69876d56 100644 --- a/include/llvm/ADT/TinyPtrVector.h +++ b/include/llvm/ADT/TinyPtrVector.h @@ -150,7 +150,6 @@ public: return Val.getAddrOfPtr1(); return Val.template get()->begin(); - } iterator end() { if (Val.template is()) diff --git a/include/llvm/Support/CrashRecoveryContext.h b/include/llvm/Support/CrashRecoveryContext.h index bedecfa14ad..ea29de50a9a 100644 --- a/include/llvm/Support/CrashRecoveryContext.h +++ b/include/llvm/Support/CrashRecoveryContext.h @@ -108,6 +108,7 @@ protected: CrashRecoveryContext *context; CrashRecoveryContextCleanup(CrashRecoveryContext *context) : context(context), cleanupFired(false) {} + public: bool cleanupFired; @@ -129,6 +130,7 @@ protected: T *resource; CrashRecoveryContextCleanupBase(CrashRecoveryContext *context, T* resource) : CrashRecoveryContextCleanup(context), resource(resource) {} + public: static DERIVED *create(T *x) { if (x) { @@ -180,6 +182,7 @@ public: template > class CrashRecoveryContextCleanupRegistrar { CrashRecoveryContextCleanup *cleanup; + public: CrashRecoveryContextCleanupRegistrar(T *x) : cleanup(Cleanup::create(x)) { diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h index 17e9c1540a4..28d0cee1d48 100644 --- a/include/llvm/Support/Dwarf.h +++ b/include/llvm/Support/Dwarf.h @@ -642,7 +642,6 @@ private: }; }; - } // End of namespace dwarf } // End of namespace llvm diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index 36c669aee08..a41bec921e0 100644 --- a/include/llvm/Support/FileSystem.h +++ b/include/llvm/Support/FileSystem.h @@ -156,6 +156,7 @@ class file_status friend bool equivalent(file_status A, file_status B); file_type Type; perms Perms; + public: #if defined(LLVM_ON_UNIX) file_status() : fs_st_dev(0), fs_st_ino(0), fs_st_mtime(0), diff --git a/include/llvm/Support/Format.h b/include/llvm/Support/Format.h index 4319a3ba274..b4233eed28b 100644 --- a/include/llvm/Support/Format.h +++ b/include/llvm/Support/Format.h @@ -118,6 +118,7 @@ class FormattedString { unsigned Width; bool RightJustify; friend class raw_ostream; + public: FormattedString(StringRef S, unsigned W, bool R) : Str(S), Width(W), RightJustify(R) { } @@ -146,6 +147,7 @@ class FormattedNumber { bool Upper; bool HexPrefix; friend class raw_ostream; + public: FormattedNumber(uint64_t HV, int64_t DV, unsigned W, bool H, bool U, bool Prefix) @@ -188,7 +190,6 @@ inline FormattedNumber format_decimal(int64_t N, unsigned Width) { return FormattedNumber(0, N, Width, false, false, false); } - } // end namespace llvm #endif diff --git a/include/llvm/Support/GenericDomTreeConstruction.h b/include/llvm/Support/GenericDomTreeConstruction.h index 7c065f93925..55e931307f6 100644 --- a/include/llvm/Support/GenericDomTreeConstruction.h +++ b/include/llvm/Support/GenericDomTreeConstruction.h @@ -21,7 +21,6 @@ /// //===----------------------------------------------------------------------===// - #ifndef LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H #define LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H @@ -287,7 +286,6 @@ void Calculate(DominatorTreeBase::NodeType>& DT, DT.updateDFSNumbers(); } - } #endif diff --git a/include/llvm/Support/MachO.h b/include/llvm/Support/MachO.h index 77512750592..ee0851a695f 100644 --- a/include/llvm/Support/MachO.h +++ b/include/llvm/Support/MachO.h @@ -142,7 +142,6 @@ namespace llvm { SG_NORELOC = 0x4u, SG_PROTECTED_VERSION_1 = 0x8u, - // Constant masks for the "flags" field in llvm::MachO::section and // llvm::MachO::section_64 SECTION_TYPE = 0x000000ffu, // SECTION_TYPE @@ -334,7 +333,6 @@ namespace llvm { EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE = 0x02u }; - enum { // Constant masks for the "n_type" field in llvm::MachO::nlist and // llvm::MachO::nlist_64 @@ -506,7 +504,6 @@ namespace llvm { // Must be followed by ARM64_RELOC_PAGE21 or ARM64_RELOC_PAGEOFF12. ARM64_RELOC_ADDEND = 10, - // Constant values for the r_type field in an x86_64 architecture // llvm::MachO::relocation_info or llvm::MachO::scattered_relocation_info // structure @@ -530,7 +527,6 @@ namespace llvm { VM_PROT_EXECUTE = 0x4 }; - // Structs from struct mach_header { @@ -784,7 +780,6 @@ namespace llvm { flags:8; }; - struct twolevel_hints_command { uint32_t cmd; uint32_t cmdsize; @@ -924,7 +919,6 @@ namespace llvm { uint64_t stacksize; }; - // Structs from struct fat_header { uint32_t magic; @@ -995,7 +989,6 @@ namespace llvm { uint64_t n_value; }; - // Byte order swapping functions for MachO structs inline void swapStruct(mach_header &mh) { diff --git a/include/llvm/Support/Memory.h b/include/llvm/Support/Memory.h index 79353198efc..8527a4a7dd7 100644 --- a/include/llvm/Support/Memory.h +++ b/include/llvm/Support/Memory.h @@ -32,6 +32,7 @@ namespace sys { MemoryBlock(void *addr, size_t size) : Address(addr), Size(size) { } void *base() const { return Address; } size_t size() const { return Size; } + private: void *Address; ///< Address of first byte of memory area size_t Size; ///< Size, in bytes of the memory area @@ -131,7 +132,6 @@ namespace sys { /// @brief Release Read/Write/Execute memory. static bool ReleaseRWX(MemoryBlock &block, std::string *ErrMsg = nullptr); - /// InvalidateInstructionCache - Before the JIT can run a block of code /// that has been emitted it must invalidate the instruction cache on some /// platforms. diff --git a/include/llvm/Support/SMLoc.h b/include/llvm/Support/SMLoc.h index d5b4c57a8fd..45ec92d2d0d 100644 --- a/include/llvm/Support/SMLoc.h +++ b/include/llvm/Support/SMLoc.h @@ -22,6 +22,7 @@ namespace llvm { /// Represents a location in source code. class SMLoc { const char *Ptr; + public: SMLoc() : Ptr(nullptr) {} @@ -60,4 +61,3 @@ public: } // end namespace llvm #endif - diff --git a/include/llvm/Support/TargetSelect.h b/include/llvm/Support/TargetSelect.h index a86e953f00e..1d94544508a 100644 --- a/include/llvm/Support/TargetSelect.h +++ b/include/llvm/Support/TargetSelect.h @@ -159,8 +159,7 @@ namespace llvm { #else return true; #endif - } - + } } #endif diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h index 2cd30e2aaf3..a3646fc7423 100644 --- a/include/llvm/Support/Timer.h +++ b/include/llvm/Support/Timer.h @@ -42,8 +42,7 @@ public: double getSystemTime() const { return SystemTime; } double getWallTime() const { return WallTime; } ssize_t getMemUsed() const { return MemUsed; } - - + // operator< - Allow sorting. bool operator<(const TimeRecord &T) const { // Sort by Wall Time elapsed, as it is the only thing really accurate @@ -117,7 +116,6 @@ private: friend class TimerGroup; }; - /// The TimeRegion class is used as a helper class to call the startTimer() and /// stopTimer() methods of the Timer class. When the object is constructed, it /// starts the timer specified as its argument. When it is destroyed, it stops @@ -126,6 +124,7 @@ private: class TimeRegion { Timer *T; TimeRegion(const TimeRegion &) = delete; + public: explicit TimeRegion(Timer &t) : T(&t) { T->startTimer(); @@ -138,7 +137,6 @@ public: } }; - /// NamedRegionTimer - This class is basically a combination of TimeRegion and /// Timer. It allows you to declare a new timer, AND specify the region to /// time, all in one statement. All timers with the same name are merged. This @@ -151,7 +149,6 @@ struct NamedRegionTimer : public TimeRegion { bool Enabled = true); }; - /// The TimerGroup class is used to group together related timers into a single /// report that is printed when the TimerGroup is destroyed. It is illegal to /// destroy a TimerGroup object before all of the Timers in it are gone. A @@ -165,6 +162,7 @@ class TimerGroup { TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's. TimerGroup(const TimerGroup &TG) = delete; void operator=(const TimerGroup &TG) = delete; + public: explicit TimerGroup(StringRef name); ~TimerGroup(); diff --git a/include/llvm/Support/circular_raw_ostream.h b/include/llvm/Support/circular_raw_ostream.h index 19f9c2c4b15..ddaa9acbf68 100644 --- a/include/llvm/Support/circular_raw_ostream.h +++ b/include/llvm/Support/circular_raw_ostream.h @@ -154,5 +154,4 @@ namespace llvm }; } // end llvm namespace - #endif diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index 21f8977b7b3..75857a2027a 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -225,7 +225,6 @@ public: /// indent - Insert 'NumSpaces' spaces. raw_ostream &indent(unsigned NumSpaces); - /// Changes the foreground color of text that will be output from this point /// forward. /// @param Color ANSI color to use, the special SAVEDCOLOR can be used to @@ -471,6 +470,7 @@ class raw_string_ostream : public raw_ostream { /// Return the current position within the stream, not counting the bytes /// currently in the buffer. uint64_t current_pos() const override { return OS.size(); } + public: explicit raw_string_ostream(std::string &O) : OS(O) {} ~raw_string_ostream() override; @@ -510,7 +510,6 @@ public: explicit raw_svector_ostream(SmallVectorImpl &O); ~raw_svector_ostream() override; - /// This is called when the SmallVector we're appending to is changed outside /// of the raw_svector_ostream's control. It is only safe to do this if the /// raw_svector_ostream has previously been flushed.