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 | d1e020f7eeca13787baa9f60d24248ca34c2ae4f (patch) | |
tree | 60cafe404920eef94cd2843bb5200307702fa202 /llvm/utils/FileCheck | |
parent | 311e0fabb1f0ae23c5fcd20d8daf7e328fc93cd4 (diff) | |
download | bcm5719-llvm-d1e020f7eeca13787baa9f60d24248ca34c2ae4f.tar.gz bcm5719-llvm-d1e020f7eeca13787baa9f60d24248ca34c2ae4f.zip |
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
Diffstat (limited to 'llvm/utils/FileCheck')
-rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 6c9b62d5b24..cf924abf900 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/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; } |