diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-26 16:18:40 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-26 16:18:40 +0000 |
commit | 4403f2ccc15d85b9854c4ddabf40f65353aa7096 (patch) | |
tree | 0499cb92a07e60a4a5f46b091895a7b8110d430e /utils/FileCheck | |
parent | f222adf433bbf487cd7430e1bf03e69afb7f36f3 (diff) |
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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r-- | utils/FileCheck/FileCheck.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index 6c9b62d5b24..cf924abf900 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/utils/FileCheck/FileCheck.cpp @@ -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; } |