1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

FileCheck: Minor cleanup of the class Pattern

1. Add the "explicit" specifier to the single-argument constructor of Pattern
2. Reorder the fields to remove excessive padding (8 bytes).

Patch by Alexander Shaposhnikov!

llvm-svn: 279832
This commit is contained in:
Saleem Abdulrasool 2016-08-26 16:18:40 +00:00
parent a6a044e2b8
commit 2c5173b70a

View File

@ -100,8 +100,6 @@ namespace Check {
class Pattern {
SMLoc PatternLoc;
Check::CheckType CheckTy;
/// FixedStr - If non-empty, this pattern is a fixed string match with the
/// specified fixed string.
StringRef FixedStr;
@ -109,9 +107,6 @@ class Pattern {
/// RegEx - If non-empty, this is a regex pattern.
std::string RegExStr;
/// \brief Contains the number of line this pattern is in.
unsigned LineNumber;
/// VariableUses - Entries in this vector map to uses of a variable in the
/// pattern, e.g. "foo[[bar]]baz". In this case, the RegExStr will contain
/// "foobaz" and we'll get an entry in this vector that tells us to insert the
@ -123,10 +118,13 @@ class Pattern {
/// E.g. for the pattern "foo[[bar:.*]]baz", VariableDefs will map "bar" to 1.
std::map<StringRef, unsigned> VariableDefs;
public:
Check::CheckType CheckTy;
Pattern(Check::CheckType Ty)
: CheckTy(Ty) { }
/// \brief Contains the number of line this pattern is in.
unsigned LineNumber;
public:
explicit Pattern(Check::CheckType Ty) : CheckTy(Ty) {}
/// getLoc - Return the location in source code.
SMLoc getLoc() const { return PatternLoc; }