Reformat blank lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2014-05-12 03:32:56 +00:00
parent d0c1b54942
commit 8b6f7428b0
5 changed files with 22 additions and 29 deletions

View File

@ -34,7 +34,6 @@ LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc,
extern SourceMgr SrcMgr;
extern unsigned ErrorsPrinted;
} // end namespace "llvm"
#endif

View File

@ -23,7 +23,6 @@ class raw_ostream;
typedef bool TableGenMainFn(raw_ostream &OS, RecordKeeper &Records);
int TableGenMain(char *argv0, TableGenMainFn *MainFn);
}
#endif

View File

@ -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<n>' - 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<Init*> Values;
public:
typedef std::vector<Init*>::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<SMLoc> 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;

View File

@ -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<std::string, std::string> StringPair;
private:
StringRef StrVariableName;
const std::vector<StringPair> &Matches;
raw_ostream &OS;
public:
StringMatcher(StringRef strVariableName,
const std::vector<StringPair> &matches, raw_ostream &os)
: StrVariableName(strVariableName), Matches(matches), OS(os) {}
void Emit(unsigned Indent = 0) const;
private:
bool EmitStringMatcherForChar(const std::vector<const StringPair*> &Matches,
unsigned CharNo, unsigned IndentCount) const;

View File

@ -25,8 +25,8 @@ namespace llvm {
class StringToOffsetTable {
StringMap<unsigned> StringOffset;
std::string AggregateString;
public:
unsigned GetOrAddStringOffset(StringRef Str, bool appendZero = true) {
StringMapEntry<unsigned> &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]) &&