Skip to content

Commit 03d3167

Browse files
authored
Use ComparisonRule to prevent ambiguity between type and member variable name (#277)
This PR changes a member variable name to prevent compiler errors when compiling with g++-11. Instead of using -fpermissive, this PR changes the conflicting member variable name. Fixes #281
1 parent 854d00c commit 03d3167

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/Support/Pipeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct Buffer {
116116

117117
struct Result {
118118
std::string Name;
119-
Rule Rule;
119+
Rule ComparisonRule;
120120
std::string Actual;
121121
std::string Expected;
122122
Buffer *ActualPtr = nullptr;

lib/Support/Check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static bool testBufferFloatULP(offloadtest::Buffer *B1, offloadtest::Buffer *B2,
268268
}
269269

270270
llvm::Error verifyResult(offloadtest::Result R) {
271-
switch (R.Rule) {
271+
switch (R.ComparisonRule) {
272272
case offloadtest::Rule::BufferExact: {
273273
if (testBufferExact(R.ActualPtr, R.ExpectedPtr))
274274
return llvm::Error::success();

lib/Support/Pipeline.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ void MappingTraits<offloadtest::Pipeline>::mapping(IO &I,
4646
R.ExpectedPtr = P.getBuffer(R.Expected);
4747
if (!R.ExpectedPtr)
4848
I.setError(Twine("Reference buffer ") + R.Expected + " not found!");
49-
if (R.Rule == Rule::BufferFloatULP ||
50-
R.Rule == Rule::BufferFloatEpsilon) {
49+
if (R.ComparisonRule == Rule::BufferFloatULP ||
50+
R.ComparisonRule == Rule::BufferFloatEpsilon) {
5151
if (!isFloatingPointFormat(R.ActualPtr->Format) ||
5252
!isFloatingPointFormat(R.ExpectedPtr->Format))
5353
I.setError(Twine("BufferFloat only accepts Float buffers"));
@@ -226,11 +226,11 @@ void MappingTraits<offloadtest::Shader>::mapping(IO &I,
226226
void MappingTraits<offloadtest::Result>::mapping(IO &I,
227227
offloadtest::Result &R) {
228228
I.mapRequired("Result", R.Name);
229-
I.mapRequired("Rule", R.Rule);
229+
I.mapRequired("Rule", R.ComparisonRule);
230230
I.mapRequired("Actual", R.Actual);
231231
I.mapRequired("Expected", R.Expected);
232232

233-
switch (R.Rule) {
233+
switch (R.ComparisonRule) {
234234
case Rule::BufferFloatULP: {
235235
I.mapRequired("ULPT", R.ULPT);
236236
I.mapOptional("DenormMode", R.DM);

0 commit comments

Comments
 (0)