This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Fix compiler error on GCC 9
ClosedPublic

Authored by unterumarmung on May 27 2022, 4:16 AM.

Details

Summary

This patch fixes the following compiler error:

error: declaration of ‘mlir::LLVM::cconv::CConv mlir::LLVM::detail::CConvAttrStorage::CConv’ changes meaning of ‘CConv’ [-fpermissive]

CConv as a member variable name was shadowing CConv as an enumeration,
hence the compiler error.

Diff Detail

Event Timeline

unterumarmung created this revision.May 27 2022, 4:16 AM
Herald added a project: Restricted Project. · View Herald Transcript
unterumarmung requested review of this revision.May 27 2022, 4:16 AM
ftynse added inline comments.May 27 2022, 4:24 AM
mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
42

This name was capitalized at a request in the review of the original patch. Is there another way to fix it? Perhaps use the fully qualified type name when necessary to disambiguate?

alexbatashev added inline comments.May 27 2022, 4:36 AM
mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
42

Maybe this would satisfy everybody?

unterumarmung added inline comments.May 27 2022, 4:41 AM
mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
42

Perhaps use the fully qualified type name when necessary to disambiguate?

This wouldn't work. The error is attached to the member variable declaration, so we need to change the name.

42

I'd go with @alexbatashev's suggestion

ftynse added inline comments.May 27 2022, 4:44 AM
mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
42

Works for me.

Address review comments

ftynse accepted this revision.May 27 2022, 4:53 AM
This revision is now accepted and ready to land.May 27 2022, 4:53 AM
unterumarmung marked 3 inline comments as done.May 27 2022, 4:54 AM

@alexbatashev @ftynse thank you for the quick review! If you have no further objections, could someone please approve the revision?

alexbatashev accepted this revision.May 27 2022, 4:54 AM
This revision was automatically updated to reflect the committed changes.