From 8b6f7428b03c7423f1f748661666594c633c9109 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 12 May 2014 03:32:56 +0000 Subject: [PATCH] Reformat blank lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208515 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/TableGen/Error.h | 1 - include/llvm/TableGen/Main.h | 1 - include/llvm/TableGen/Record.h | 27 +++++++++------------ include/llvm/TableGen/StringMatcher.h | 12 ++++----- include/llvm/TableGen/StringToOffsetTable.h | 10 ++++---- 5 files changed, 22 insertions(+), 29 deletions(-) diff --git a/include/llvm/TableGen/Error.h b/include/llvm/TableGen/Error.h index 17ac4181515..3df658df880 100644 --- a/include/llvm/TableGen/Error.h +++ b/include/llvm/TableGen/Error.h @@ -34,7 +34,6 @@ LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef ErrorLoc, extern SourceMgr SrcMgr; extern unsigned ErrorsPrinted; - } // end namespace "llvm" #endif diff --git a/include/llvm/TableGen/Main.h b/include/llvm/TableGen/Main.h index 6b51e20146d..866b9868deb 100644 --- a/include/llvm/TableGen/Main.h +++ b/include/llvm/TableGen/Main.h @@ -23,7 +23,6 @@ class raw_ostream; typedef bool TableGenMainFn(raw_ostream &OS, RecordKeeper &Records); int TableGenMain(char *argv0, TableGenMainFn *MainFn); - } #endif diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index e74a8f2d8ac..ed1c4c90f82 100644 --- a/include/llvm/TableGen/Record.h +++ b/include/llvm/TableGen/Record.h @@ -137,12 +137,12 @@ inline raw_ostream &operator<<(raw_ostream &OS, const RecTy &Ty) { return OS; } - /// BitRecTy - 'bit' - Represent a single bit /// class BitRecTy : public RecTy { static BitRecTy Shared; BitRecTy() : RecTy(BitRecTyKind) {} + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == BitRecTyKind; @@ -174,12 +174,12 @@ public: bool baseClassOf(const RecTy*) const override; }; - /// BitsRecTy - 'bits' - Represent a fixed number of bits /// class BitsRecTy : public RecTy { unsigned Size; explicit BitsRecTy(unsigned Sz) : RecTy(BitsRecTyKind), Size(Sz) {} + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == BitsRecTyKind; @@ -213,12 +213,12 @@ public: bool baseClassOf(const RecTy*) const override; }; - /// IntRecTy - 'int' - Represent an integer value of no particular size /// class IntRecTy : public RecTy { static IntRecTy Shared; IntRecTy() : RecTy(IntRecTyKind) {} + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == IntRecTyKind; @@ -256,6 +256,7 @@ public: class StringRecTy : public RecTy { static StringRecTy Shared; StringRecTy() : RecTy(StringRecTyKind) {} + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == StringRecTyKind; @@ -294,6 +295,7 @@ class ListRecTy : public RecTy { RecTy *Ty; explicit ListRecTy(RecTy *T) : RecTy(ListRecTyKind), Ty(T) {} friend ListRecTy *RecTy::getListTy(); + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == ListRecTyKind; @@ -332,6 +334,7 @@ public: class DagRecTy : public RecTy { static DagRecTy Shared; DagRecTy() : RecTy(DagRecTyKind) {} + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == DagRecTyKind; @@ -362,7 +365,6 @@ public: } }; - /// RecordRecTy - '[classname]' - Represent an instance of a class, such as: /// (R32 X = EAX). /// @@ -370,6 +372,7 @@ class RecordRecTy : public RecTy { Record *Rec; explicit RecordRecTy(Record *R) : RecTy(RecordRecTyKind), Rec(R) {} friend class Record; + public: static bool classof(const RecTy *RT) { return RT->getRecTyKind() == RecordRecTyKind; @@ -589,7 +592,6 @@ public: unsigned Elt) const = 0; }; - /// UnsetInit - ? - Represents an uninitialized value /// class UnsetInit : public Init { @@ -616,7 +618,6 @@ public: std::string getAsString() const override { return "?"; } }; - /// BitInit - true/false - Represent a concrete initializer for a bit. /// class BitInit : public Init { @@ -695,7 +696,6 @@ public: } }; - /// IntInit - 7 - Represent an initialization by a literal integer value. /// class IntInit : public TypedInit { @@ -736,7 +736,6 @@ public: } }; - /// StringInit - "foo" - Represent an initialization by a string value. /// class StringInit : public TypedInit { @@ -781,6 +780,7 @@ public: /// class ListInit : public TypedInit, public FoldingSetNode { std::vector Values; + public: typedef std::vector::const_iterator const_iterator; @@ -843,7 +843,6 @@ public: } }; - /// OpInit - Base class for operators /// class OpInit : public TypedInit { @@ -878,12 +877,12 @@ public: Init *getBit(unsigned Bit) const override; }; - /// UnOpInit - !op (X) - Transform an init. /// class UnOpInit : public OpInit { public: enum UnaryOp { CAST, HEAD, TAIL, EMPTY }; + private: UnaryOp Opc; Init *LHS; @@ -983,6 +982,7 @@ public: class TernOpInit : public OpInit { public: enum TernaryOp { SUBST, FOREACH, IF }; + private: TernaryOp Opc; Init *LHS, *MHS, *RHS; @@ -1039,7 +1039,6 @@ public: std::string getAsString() const override; }; - /// VarInit - 'Opcode' - Represent a reference to an entire variable object. /// class VarInit : public TypedInit { @@ -1089,7 +1088,6 @@ public: std::string getAsString() const override { return getName(); } }; - /// VarBitInit - Opcode{0} - Represent access to one bit of a variable or field. /// class VarBitInit : public Init { @@ -1215,7 +1213,6 @@ public: } }; - /// FieldInit - X.Y - Represent a reference to a subfield of a variable /// class FieldInit : public TypedInit { @@ -1342,6 +1339,7 @@ class RecordVal { RecTy *Ty; unsigned Prefix; Init *Value; + public: RecordVal(Init *N, RecTy *T, unsigned P); RecordVal(const std::string &N, RecTy *T, unsigned P); @@ -1398,7 +1396,6 @@ class Record { void checkName(); public: - // Constructs a record. explicit Record(const std::string &N, ArrayRef locs, RecordKeeper &records, bool Anonymous = false) : @@ -1423,10 +1420,8 @@ public: ~Record() {} - static unsigned getNewUID() { return LastID++; } - unsigned getID() const { return ID; } const std::string &getName() const; diff --git a/include/llvm/TableGen/StringMatcher.h b/include/llvm/TableGen/StringMatcher.h index 99cbcadd769..b4387791083 100644 --- a/include/llvm/TableGen/StringMatcher.h +++ b/include/llvm/TableGen/StringMatcher.h @@ -21,29 +21,29 @@ namespace llvm { class raw_ostream; - + /// StringMatcher - Given a list of strings and code to execute when they match, /// output a simple switch tree to classify the input string. -/// +/// /// If a match is found, the code in Vals[i].second is executed; control must /// not exit this code fragment. If nothing matches, execution falls through. /// class StringMatcher { public: typedef std::pair StringPair; + private: StringRef StrVariableName; const std::vector &Matches; raw_ostream &OS; - + public: StringMatcher(StringRef strVariableName, const std::vector &matches, raw_ostream &os) : StrVariableName(strVariableName), Matches(matches), OS(os) {} - + void Emit(unsigned Indent = 0) const; - - + private: bool EmitStringMatcherForChar(const std::vector &Matches, unsigned CharNo, unsigned IndentCount) const; diff --git a/include/llvm/TableGen/StringToOffsetTable.h b/include/llvm/TableGen/StringToOffsetTable.h index d94d3a26682..c924bd8ec57 100644 --- a/include/llvm/TableGen/StringToOffsetTable.h +++ b/include/llvm/TableGen/StringToOffsetTable.h @@ -25,8 +25,8 @@ namespace llvm { class StringToOffsetTable { StringMap StringOffset; std::string AggregateString; + public: - unsigned GetOrAddStringOffset(StringRef Str, bool appendZero = true) { StringMapEntry &Entry = StringOffset.GetOrCreateValue(Str, -1U); if (Entry.getValue() == -1U) { @@ -36,10 +36,10 @@ public: if (appendZero) AggregateString += '\0'; } - + return Entry.getValue(); } - + void EmitString(raw_ostream &O) { // Escape the string. SmallString<256> Str; @@ -55,11 +55,11 @@ public: } O << AggregateString[i]; ++CharsPrinted; - + // Print escape sequences all together. if (AggregateString[i] != '\\') continue; - + assert(i+1 < AggregateString.size() && "Incomplete escape sequence!"); if (isdigit(AggregateString[i+1])) { assert(isdigit(AggregateString[i+2]) && -- 2.34.1