diff options
Diffstat (limited to 'include')
22 files changed, 202 insertions, 202 deletions
diff --git a/include/llvm/Support/AlignOf.h b/include/llvm/Support/AlignOf.h index aecb478eef..6a7a1a6bd2 100644 --- a/include/llvm/Support/AlignOf.h +++ b/include/llvm/Support/AlignOf.h @@ -16,7 +16,7 @@ #define LLVM_SUPPORT_ALIGNOF_H namespace llvm { - + template <typename T> struct AlignmentCalcImpl { char x; @@ -24,7 +24,7 @@ struct AlignmentCalcImpl { private: AlignmentCalcImpl() {} // Never instantiate. }; - + /// AlignOf - A templated class that contains an enum value representing /// the alignment of the template argument. For example, /// AlignOf<int>::Alignment represents the alignment of type "int". The @@ -41,9 +41,9 @@ struct AlignOf { enum { Alignment_GreaterEqual_4Bytes = Alignment >= 4 ? 1 : 0 }; enum { Alignment_GreaterEqual_8Bytes = Alignment >= 8 ? 1 : 0 }; enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 }; - + enum { Alignment_LessEqual_2Bytes = Alignment <= 2 ? 1 : 0 }; - enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 }; + enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 }; enum { Alignment_LessEqual_8Bytes = Alignment <= 8 ? 1 : 0 }; enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 }; @@ -55,6 +55,6 @@ struct AlignOf { /// alignof<int>() returns the alignment of an int. template <typename T> static inline unsigned alignof() { return AlignOf<T>::Alignment; } - + } // end namespace llvm #endif diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index f0c713af86..9ca02efb1f 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -18,24 +18,24 @@ #include <cstdlib> namespace llvm { - + class MallocAllocator { public: MallocAllocator() {} ~MallocAllocator() {} - + void Reset() {} void *Allocate(size_t Size, size_t /*Alignment*/) { return malloc(Size); } - + template <typename T> T *Allocate() { return static_cast<T*>(malloc(sizeof(T))); } - + template <typename T> - T *Allocate(size_t Num) { + T *Allocate(size_t Num) { return static_cast<T*>(malloc(sizeof(T)*Num)); } - + void Deallocate(const void *Ptr) { free(const_cast<void*>(Ptr)); } void PrintStats() const {} @@ -53,7 +53,7 @@ class BumpPtrAllocator { public: BumpPtrAllocator(); ~BumpPtrAllocator(); - + void Reset(); void *Allocate(size_t Size, size_t Alignment); @@ -61,21 +61,21 @@ public: /// Allocate space, but do not construct, one object. /// template <typename T> - T *Allocate() { + T *Allocate() { return static_cast<T*>(Allocate(sizeof(T),AlignOf<T>::Alignment)); } - + /// Allocate space for an array of objects. This does not construct the /// objects though. template <typename T> - T *Allocate(size_t Num) { + T *Allocate(size_t Num) { return static_cast<T*>(Allocate(Num * sizeof(T), AlignOf<T>::Alignment)); } - + /// Allocate space for a specific count of elements and with a specified /// alignment. template <typename T> - T *Allocate(size_t Num, unsigned Alignment) { + T *Allocate(size_t Num, unsigned Alignment) { // Round EltSize up to the specified alignment. unsigned EltSize = (sizeof(T)+Alignment-1)&~Alignment; return static_cast<T*>(Allocate(Num * EltSize, Alignment)); diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index 1a8907666f..098fab5f98 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -59,7 +59,7 @@ class ConstantRange { /// getUpper - Return the upper value for this range... /// - const APInt &getUpper() const { return Upper; } + const APInt &getUpper() const { return Upper; } /// getBitWidth - get the bit width of this ConstantRange /// diff --git a/include/llvm/Support/DOTGraphTraits.h b/include/llvm/Support/DOTGraphTraits.h index 2367c0e260..7a61b2b165 100644 --- a/include/llvm/Support/DOTGraphTraits.h +++ b/include/llvm/Support/DOTGraphTraits.h @@ -54,7 +54,7 @@ struct DefaultDOTGraphTraits { static std::string getNodeLabel(const void *Node, const GraphType& Graph) { return ""; } - + /// hasNodeAddressLabel - If this method returns true, the address of the node /// is added to the label of the node. template<typename GraphType> diff --git a/include/llvm/Support/DataFlow.h b/include/llvm/Support/DataFlow.h index 110e0e11a5..4b94ba36a3 100644 --- a/include/llvm/Support/DataFlow.h +++ b/include/llvm/Support/DataFlow.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines specializations of GraphTraits that allows Use-Def and +// This file defines specializations of GraphTraits that allows Use-Def and // Def-Use relations to be treated as proper graphs for generic algorithms. //===----------------------------------------------------------------------===// @@ -20,7 +20,7 @@ namespace llvm { //===----------------------------------------------------------------------===// -// Provide specializations of GraphTraits to be able to treat def-use/use-def +// Provide specializations of GraphTraits to be able to treat def-use/use-def // chains as graphs template <> struct GraphTraits<const User*> { diff --git a/include/llvm/Support/Debug.h b/include/llvm/Support/Debug.h index 8315ce26a5..52d0d3fb40 100644 --- a/include/llvm/Support/Debug.h +++ b/include/llvm/Support/Debug.h @@ -64,7 +64,7 @@ bool isCurrentDebugType(const char *Type); /// getErrorOutputStream - Returns the error output stream (std::cerr). This /// places the std::c* I/O streams into one .cpp file and relieves the whole /// program from having to have hundreds of static c'tor/d'tors for them. -/// +/// OStream &getErrorOutputStream(const char *DebugType); #ifdef NDEBUG diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h index 7d230a296d..7edad6f927 100644 --- a/include/llvm/Support/Dwarf.h +++ b/include/llvm/Support/Dwarf.h @@ -10,7 +10,7 @@ // This file contains constants used for implementing Dwarf debug support. For // Details on the Dwarf 3 specfication see DWARF Debugging Information Format // V.3 reference manual http://dwarf.freestandards.org , -// +// //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_DWARF_H @@ -42,23 +42,23 @@ namespace dwarf { enum llvm_dwarf_constants { // llvm mock tags DW_TAG_invalid = ~0U, // Tag for invalid results. - + DW_TAG_anchor = 0, // Tag for descriptor anchors. DW_TAG_auto_variable = 0x100, // Tag for local (auto) variables. DW_TAG_arg_variable = 0x101, // Tag for argument variables. DW_TAG_return_variable = 0x102, // Tag for return variables. - + DW_TAG_vector_type = 0x103, // Tag for vector types. - + DW_TAG_user_base = 0x1000, // Recommended base for user tags. - + DW_CIE_VERSION = 1, // Common frame information version. DW_CIE_ID = 0xffffffff // Common frame information mark. }; enum dwarf_constants { DWARF_VERSION = 2, - + // Tags DW_TAG_array_type = 0x01, DW_TAG_class_type = 0x02, @@ -357,7 +357,7 @@ enum dwarf_constants { DW_ACCESS_protected = 0x02, DW_ACCESS_private = 0x03, - // Visibility codes + // Visibility codes DW_VIS_local = 0x01, DW_VIS_exported = 0x02, DW_VIS_qualified = 0x03, @@ -366,7 +366,7 @@ enum dwarf_constants { DW_VIRTUALITY_none = 0x00, DW_VIRTUALITY_virtual = 0x01, DW_VIRTUALITY_pure_virtual = 0x02, - + // Language names DW_LANG_C89 = 0x0001, DW_LANG_C = 0x0002, @@ -389,7 +389,7 @@ enum dwarf_constants { DW_LANG_D = 0x0013, DW_LANG_lo_user = 0x8000, DW_LANG_hi_user = 0xffff, - + // Identifier case codes DW_ID_case_sensitive = 0x00, DW_ID_up_case = 0x01, @@ -409,7 +409,7 @@ enum dwarf_constants { DW_INL_declared_not_inlined = 0x02, DW_INL_declared_inlined = 0x03, - // Array ordering + // Array ordering DW_ORD_row_major = 0x00, DW_ORD_col_major = 0x01, @@ -565,7 +565,7 @@ const char *DiscriminantString(unsigned Discriminant); /// LNStandardString - Return the string for the specified line number standard. /// const char *LNStandardString(unsigned Standard); - + /// LNExtendedString - Return the string for the specified line number extended /// opcode encodings. const char *LNExtendedString(unsigned Encoding); diff --git a/include/llvm/Support/FileUtilities.h b/include/llvm/Support/FileUtilities.h index 44c699faa5..cc8f95372b 100644 --- a/include/llvm/Support/FileUtilities.h +++ b/include/llvm/Support/FileUtilities.h @@ -26,7 +26,7 @@ namespace llvm { /// option, it will set the string to an error message if an error occurs, or /// if the files are different. /// - int DiffFilesWithTolerance(const sys::PathWithStatus &FileA, + int DiffFilesWithTolerance(const sys::PathWithStatus &FileA, const sys::PathWithStatus &FileB, double AbsTol, double RelTol, std::string *Error = 0); diff --git a/include/llvm/Support/Format.h b/include/llvm/Support/Format.h index b08d698358..74358560bc 100644 --- a/include/llvm/Support/Format.h +++ b/include/llvm/Support/Format.h @@ -39,7 +39,7 @@ protected: public: format_object_base(const char *fmt) : Fmt(fmt) {} virtual ~format_object_base() {} - + /// print - Format the object into the specified buffer. On success, this /// returns the length of the formatted string. If the buffer is too small, /// this returns a length to retry with, which will be larger than BufferSize. @@ -57,7 +57,7 @@ public: format_object1(const char *fmt, const T &val) : format_object_base(fmt), Val(val) { } - + /// print - Format the object into the specified buffer. On success, this /// returns the length of the formatted string. If the buffer is too small, /// this returns a length to retry with, which will be larger than BufferSize. @@ -71,7 +71,7 @@ public: return N; } }; - + /// format_object2 - This is a templated helper class used by the format /// function that captures the object to be formated and the format string. When /// actually printed, this synthesizes the string into a temporary buffer @@ -84,7 +84,7 @@ public: format_object2(const char *fmt, const T1 &val1, const T2 &val2) : format_object_base(fmt), Val1(val1), Val2(val2) { } - + /// print - Format the object into the specified buffer. On success, this /// returns the length of the formatted string. If the buffer is too small, /// this returns a length to retry with, which will be larger than BufferSize. @@ -112,7 +112,7 @@ public: format_object3(const char *fmt, const T1 &val1, const T2 &val2,const T3 &val3) : format_object_base(fmt), Val1(val1), Val2(val2), Val3(val3) { } - + /// print - Format the object into the specified buffer. On success, this /// returns the length of the formatted string. If the buffer is too small, /// this returns a length to retry with, which will be larger than BufferSize. @@ -149,7 +149,7 @@ template <typename T1, typename T2, typename T3> const T2 &Val2, const T3 &Val3) { return format_object3<T1, T2, T3>(Fmt, Val1, Val2, Val3); } - + } // end namespace llvm #endif diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index 15f9527abe..ca28aafa78 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -67,7 +67,7 @@ namespace DOT { // Private functions... } void DisplayGraph(const sys::Path& Filename); - + template<typename GraphType> class GraphWriter { std::ostream &O; @@ -113,7 +113,7 @@ public: I != E; ++I) writeNode(*I); } - + void writeNode(NodeType& Node) { writeNode(&Node); } @@ -271,7 +271,7 @@ std::ostream &WriteGraph(std::ostream &O, const GraphType &G, template<typename GraphType> sys::Path WriteGraph(const GraphType &G, - const std::string& Name, + const std::string& Name, const std::string& Title = "") { std::string ErrMsg; sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg); @@ -286,7 +286,7 @@ sys::Path WriteGraph(const GraphType &G, } cerr << "Writing '" << Filename << "'... "; - + std::ofstream O(Filename.c_str()); if (O.good()) { @@ -298,23 +298,23 @@ sys::Path WriteGraph(const GraphType &G, cerr << "error opening file for writing!\n"; Filename.clear(); } - + return Filename; } - + /// ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, /// then cleanup. For use from the debugger. /// template<typename GraphType> -void ViewGraph(const GraphType& G, - const std::string& Name, +void ViewGraph(const GraphType& G, + const std::string& Name, const std::string& Title = "") { sys::Path Filename = WriteGraph(G, Name, Title); if (Filename.isEmpty()) { return; } - + DisplayGraph(Filename); } diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index 719e4832da..fb78eee8e1 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -635,16 +635,16 @@ public: /// CreateIsNull - Return an i1 value testing if \arg Arg is null. Value *CreateIsNull(Value *Arg, const char *Name = "") { - return CreateICmpEQ(Arg, llvm::Constant::getNullValue(Arg->getType()), + return CreateICmpEQ(Arg, llvm::Constant::getNullValue(Arg->getType()), Name); } /// CreateIsNotNull - Return an i1 value testing if \arg Arg is not null. Value *CreateIsNotNull(Value *Arg, const char *Name = "") { - return CreateICmpNE(Arg, llvm::Constant::getNullValue(Arg->getType()), + return CreateICmpNE(Arg, llvm::Constant::getNullValue(Arg->getType()), Name); } - + }; } diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h index 0b8a9bdead..597cc9d905 100644 --- a/include/llvm/Support/InstVisitor.h +++ b/include/llvm/Support/InstVisitor.h @@ -31,15 +31,15 @@ namespace llvm { /// @brief Base class for instruction visitors /// /// Instruction visitors are used when you want to perform different action for -/// different kinds of instruction without without having to use lots of casts -/// and a big switch statement (in your code that is). +/// different kinds of instruction without without having to use lots of casts +/// and a big switch statement (in your code that is). /// /// To define your own visitor, inherit from this class, specifying your /// new type for the 'SubClass' template parameter, and "override" visitXXX -/// functions in your class. I say "overriding" because this class is defined -/// in terms of statically resolved overloading, not virtual functions. -/// -/// For example, here is a visitor that counts the number of malloc +/// functions in your class. I say "overriding" because this class is defined +/// in terms of statically resolved overloading, not virtual functions. +/// +/// For example, here is a visitor that counts the number of malloc /// instructions processed: /// /// /// Declare the class. Note that we derive from InstVisitor instantiated @@ -65,8 +65,8 @@ namespace llvm { /// if instructions are added in the future, they will be automatically /// supported, if you handle on of their superclasses. /// -/// The optional second template argument specifies the type that instruction -/// visitation functions should return. If you specify this, you *MUST* provide +/// The optional second template argument specifies the type that instruction +/// visitation functions should return. If you specify this, you *MUST* provide /// an implementation of visitInstruction though!. /// /// Note that this class is specifically designed as a template to avoid diff --git a/include/llvm/Support/ManagedStatic.h b/include/llvm/Support/ManagedStatic.h index 28b25dbb62..d0298e495d 100644 --- a/include/llvm/Support/ManagedStatic.h +++ b/include/llvm/Support/ManagedStatic.h @@ -31,12 +31,12 @@ protected: mutable void *Ptr; mutable void (*DeleterFn)(void*); mutable const ManagedStaticBase *Next; - + void RegisterManagedStatic(void *ObjPtr, void (*deleter)(void*)) const; public: - /// isConstructed - Return true if this object has not been created yet. + /// isConstructed - Return true if this object has not been created yet. bool isConstructed() const { return Ptr != 0; } - + void destroy() const; }; @@ -48,7 +48,7 @@ public: template<class C> class ManagedStatic : public ManagedStaticBase { public: - + // Accessors. C &operator*() { if (!Ptr) LazyInit(); @@ -66,7 +66,7 @@ public: if (!Ptr) LazyInit(); return static_cast<C*>(Ptr); } - + public: void LazyInit() const { RegisterManagedStatic(new C(), object_deleter<C>); @@ -83,14 +83,14 @@ public: /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables. void llvm_shutdown(); - + /// llvm_shutdown_obj - This is a simple helper class that calls /// llvm_shutdown() when it is destroyed. struct llvm_shutdown_obj { llvm_shutdown_obj() {} ~llvm_shutdown_obj() { llvm_shutdown(); } }; - + } #endif diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h index 7820b85095..2a0fd8b69d 100644 --- a/include/llvm/Support/Mangler.h +++ b/include/llvm/Support/Mangler.h @@ -28,17 +28,17 @@ class Mangler { /// Prefix - This string is added to each symbol that is emitted, unless the /// symbol is marked as not needing this prefix. const char *Prefix; - + const char *PrivatePrefix; - /// UseQuotes - If this is set, the target accepts global names in quotes, + /// UseQuotes - If this is set, the target accepts global names in quotes, /// e.g. "foo bar" is a legal name. This syntax is used instead of escaping /// the space character. By default, this is false. bool UseQuotes; - + /// PreserveAsmNames - If this is set, the asm escape character is not removed - /// from names with 'asm' specifiers. + /// from names with 'asm' specifiers. bool PreserveAsmNames; - + /// Memo - This is used to remember the name that we assign a value. /// DenseMap<const Value*, std::string> Memo; @@ -46,7 +46,7 @@ class Mangler { /// Count - This simple counter is used to unique value names. /// unsigned Count; - + /// TypeMap - If the client wants us to unique types, this keeps track of the /// current assignments and TypeCounter keeps track of the next id to assign. DenseMap<const Type*, unsigned> TypeMap; @@ -64,11 +64,11 @@ public: /// setUseQuotes - If UseQuotes is set to true, this target accepts quoted /// strings for assembler labels. void setUseQuotes(bool Val) { UseQuotes = Val; } - + /// setPreserveAsmNames - If the mangler should not strip off the asm name /// @verbatim identifier (\001), this should be set. @endverbatim void setPreserveAsmNames(bool Val) { PreserveAsmNames = Val; } - + /// Acceptable Characters - This allows the target to specify which characters /// are acceptable to the assembler without being mangled. By default we /// allow letters, numbers, '_', '$', and '.', which is what GAS accepts. @@ -81,7 +81,7 @@ public: bool isCharAcceptable(unsigned char X) const { return (AcceptableChars[X/32] & (1 << (X&31))) != 0; } - + /// getValueName - Returns the mangled name of V, an LLVM Value, /// in the current module. /// diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index c314e0e2fb..0fb2760b12 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -18,7 +18,7 @@ namespace llvm { -// NOTE: The following support functions use the _32/_64 extensions instead of +// NOTE: The following support functions use the _32/_64 extensions instead of // type overloading so that signed and unsigned integers can be used without // ambiguity. @@ -33,23 +33,23 @@ inline uint32_t Lo_32(uint64_t Value) { } /// is?Type - these functions produce optimal testing for integer data types. -inline bool isInt8 (int64_t Value) { - return static_cast<int8_t>(Value) == Value; +inline bool isInt8 (int64_t Value) { + return static_cast<int8_t>(Value) == Value; } -inline bool isUInt8 (int64_t Value) { - return static_cast<uint8_t>(Value) == Value; +inline bool isUInt8 (int64_t Value) { + return static_cast<uint8_t>(Value) == Value; } -inline bool isInt16 (int64_t Value) { - return static_cast<int16_t>(Value) == Value; +inline bool isInt16 (int64_t Value) { + return static_cast<int16_t>(Value) == Value; } -inline bool isUInt16(int64_t Value) { - return static_cast<uint16_t>(Value) == Value; +inline bool isUInt16(int64_t Value) { + return static_cast<uint16_t>(Value) == Value; } -inline bool isInt32 (int64_t Value) { - return static_cast<int32_t>(Value) == Value; +inline bool isInt32 (int64_t Value) { + return static_cast<int32_t>(Value) == Value; } -inline bool isUInt32(int64_t Value) { - return static_cast<uint32_t>(Value) == Value; +inline bool isUInt32(int64_t Value) { + return static_cast<uint32_t>(Value) == Value; } /// isMask_32 - This function returns true if the argument is a sequence of ones @@ -66,20 +66,20 @@ inline bool isMask_64(uint64_t Value) { return Value && ((Value + 1) & Value) == 0; } -/// isShiftedMask_32 - This function returns true if the argument contains a +/// isShiftedMask_32 - This function returns true if the argument contains a /// sequence of ones with the remainder zero (32 bit version.) /// Ex. isShiftedMask_32(0x0000FF00U) == true. inline bool isShiftedMask_32(uint32_t Value) { return isMask_32((Value - 1) | Value); } -/// isShiftedMask_64 - This function returns true if the argument contains a +/// isShiftedMask_64 - This function returns true if the argument contains a /// sequence of ones with the remainder zero (64 bit version.) inline bool isShiftedMask_64(uint64_t Value) { return isMask_64((Value - 1) | Value); } -/// isPowerOf2_32 - This function returns true if the argument is a power of +/// isPowerOf2_32 - This function returns true if the argument is a power of /// two > 0. Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.) inline bool isPowerOf2_32(uint32_t Value) { return Value && !(Value & (Value - 1)); @@ -172,7 +172,7 @@ inline unsigned CountLeadingOnes_32(uint32_t Value) { } /// CountLeadingZeros_64 - This function performs the platform optimal form -/// of counting the number of zeros from the most significant bit to the first +/// of counting the number of zeros from the most significant bit to the first /// one bit (64 bit edition.) /// Returns 64 if the word is zero. inline unsigned CountLeadingZeros_64(uint64_t Value) { @@ -216,7 +216,7 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) { } /// CountLeadingOnes_64 - This function performs the operation -/// of counting the number of ones from the most significant bit to the first +/// of counting the number of ones from the most significant bit to the first /// zero bit (64 bit edition.) /// Returns 64 if the word is all ones. inline unsigned CountLeadingOnes_64(uint64_t Value) { @@ -249,7 +249,7 @@ inline unsigned CountTrailingOnes_32(uint32_t Value) { } /// CountTrailingZeros_64 - This function performs the platform optimal form -/// of counting the number of zeros from the least significant bit to the first +/// of counting the number of zeros from the least significant bit to the first /// one bit (64 bit edition.) /// Returns 64 if the word is zero. inline unsigned CountTrailingZeros_64(uint64_t Value) { @@ -268,7 +268,7 @@ inline unsigned CountTrailingZeros_64(uint64_t Value) { } /// CountTrailingOnes_64 - This function performs the operation -/// of counting the number of ones from the least significant bit to the first +/// of counting the number of ones from the least significant bit to the first /// zero bit (64 bit edition.) /// Returns 64 if the word is all ones. inline unsigned CountTrailingOnes_64(uint64_t Value) { @@ -301,14 +301,14 @@ inline unsigned CountPopulation_64(uint64_t Value) { #endif } -/// Log2_32 - This function returns the floor log base 2 of the specified value, +/// Log2_32 - This function returns the floor log base 2 of the specified value, /// -1 if the value is zero. (32 bit edition.) /// Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2 inline unsigned Log2_32(uint32_t Value) { return 31 - CountLeadingZeros_32(Value); } -/// Log2_64 - This function returns the floor log base 2 of the specified value, +/// Log2_64 - This function returns the floor log base 2 of the specified value, /// -1 if the value is zero. (64 bit edition.) inline unsigned Log2_64(uint64_t Value) { return 63 - CountLeadingZeros_64(Value); @@ -321,7 +321,7 @@ inline unsigned Log2_32_Ceil(uint32_t Value) { return 32-CountLeadingZeros_32(Value-1); } -/// Log2_64 - This function returns the ceil log base 2 of the specified value, +/// Log2_64 - This function returns the ceil log base 2 of the specified value, /// 64 if the value is zero. (64 bit edition.) inline unsigned Log2_64_Ceil(uint64_t Value) { return 64-CountLeadingZeros_64(Value-1); @@ -337,7 +337,7 @@ inline uint64_t GreatestCommonDivisor64(uint64_t A, uint64_t B) { } return A; } - + /// BitsToDouble - This function takes a 64-bit integer and returns the bit /// equivalent double. inline double BitsToDouble(uint64_t Bits) { @@ -424,7 +424,7 @@ static inline uint64_t NextPowerOf2(uint64_t A) { inline uint64_t RoundUpToAlignment(uint64_t Value, uint64_t Align) { return ((Value + Align - 1) / Align) * Align; } - + } // End llvm namespace #endif diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index ac77f6c9a1..58a217f6c7 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -37,11 +37,11 @@ protected: void initCopyOf(const char *BufStart, const char *BufEnd); public: virtual ~MemoryBuffer(); - + const char *getBufferStart() const { return BufferStart; } const char *getBufferEnd() const { return BufferEnd; } size_t getBufferSize() const { return BufferEnd-BufferStart; } - + /// getBufferIdentifier - Return an identifier for this buffer, typically the /// filename it was read from. virtual const char *getBufferIdentifier() const { @@ -60,32 +60,32 @@ public: /// that EndPtr[0] must be a null byte and be accessible! static MemoryBuffer *getMemBuffer(const char *StartPtr, const char *EndPtr, const char *BufferName = ""); - + /// getMemBufferCopy - Open the specified memory range as a MemoryBuffer, /// copying the contents and taking ownership of it. This has no requirements /// on EndPtr[0]. static MemoryBuffer *getMemBufferCopy(const char *StartPtr,const char *EndPtr, const char *BufferName = ""); - + /// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that /// is completely initialized to zeros. Note that the caller should /// initialize the memory allocated by this method. The memory is owned by /// the MemoryBuffer object. static MemoryBuffer *getNewMemBuffer(size_t Size, const char *BufferName = ""); - + /// getNewUninitMemBuffer - Allocate a new MemoryBuffer of the specified size /// that is not initialized. Note that the caller should initialize the /// memory allocated by this method. The memory is owned by the MemoryBuffer /// object. static MemoryBuffer *getNewUninitMemBuffer(size_t Size, const char *BufferName = ""); - + /// getSTDIN - Read all of stdin into a file buffer, and return it. This /// returns null if stdin is empty. static MemoryBuffer *getSTDIN(); - - + + /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin /// if the Filename is "-". If an error occurs, this returns null and fills /// in *ErrStr with a reason. If stdin is empty, this API (unlike getSTDIN) @@ -93,7 +93,7 @@ public: static MemoryBuffer *getFileOrSTDIN(const char *Filename, std::string *ErrStr = 0, int64_t FileSize = -1); - + /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin /// if the Filename is "-". If an error occurs, this returns null and fills /// in *ErrStr with a reason. diff --git a/include/llvm/Support/OutputBuffer.h b/include/llvm/Support/OutputBuffer.h index 0fedb15e40..b2077c5514 100644 --- a/include/llvm/Support/OutputBuffer.h +++ b/include/llvm/Support/OutputBuffer.h |