llvm.org GIT mirror llvm / 4403f2c
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 Saleem Abdulrasool 3 years ago
1 changed file(s) with 6 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
9999 class Pattern {
100100 SMLoc PatternLoc;
101101
102 Check::CheckType CheckTy;
103
104102 /// FixedStr - If non-empty, this pattern is a fixed string match with the
105103 /// specified fixed string.
106104 StringRef FixedStr;
107105
108106 /// RegEx - If non-empty, this is a regex pattern.
109107 std::string RegExStr;
110
111 /// \brief Contains the number of line this pattern is in.
112 unsigned LineNumber;
113108
114109 /// VariableUses - Entries in this vector map to uses of a variable in the
115110 /// pattern, e.g. "foo[[bar]]baz". In this case, the RegExStr will contain
122117 /// E.g. for the pattern "foo[[bar:.*]]baz", VariableDefs will map "bar" to 1.
123118 std::map VariableDefs;
124119
120 Check::CheckType CheckTy;
121
122 /// \brief Contains the number of line this pattern is in.
123 unsigned LineNumber;
124
125125 public:
126
127 Pattern(Check::CheckType Ty)
128 : CheckTy(Ty) { }
126 explicit Pattern(Check::CheckType Ty) : CheckTy(Ty) {}
129127
130128 /// getLoc - Return the location in source code.
131129 SMLoc getLoc() const { return PatternLoc; }