File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,12 @@ int64_t Program::getDirective(const std::string& name) const {
187
187
return d->second ;
188
188
}
189
189
190
+ int64_t Program::getDirective (const std::string& name,
191
+ int64_t defaultValue) const {
192
+ auto d = directives.find (name);
193
+ return d != directives.end () ? d->second : defaultValue;
194
+ }
195
+
190
196
bool Program::operator ==(const Program& p) const { return (ops == p.ops ); }
191
197
192
198
bool Program::operator !=(const Program& p) const { return !(*this == p); }
Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ class Program {
127
127
128
128
int64_t getDirective (const std::string &name) const ;
129
129
130
+ int64_t getDirective (const std::string &name, int64_t defaultValue) const ;
131
+
130
132
bool operator ==(const Program &p) const ;
131
133
132
134
bool operator !=(const Program &p) const ;
You can’t perform that action at this time.
0 commit comments