[llvm] r274139 - Use LLVM_ATTRIBUTE_UNUSED instead of void casts; NFC
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 29 10:51:38 PDT 2016
Ah, neat. I'll use that going forward.
thanks
vedant
> On Jun 29, 2016, at 10:50 AM, Sean Silva <chisophugis at gmail.com> wrote:
>
> In C++, one common way to do this is to just omit the parameter name (or leave it in, but surrounded by a C-style comment).
>
> E.g.
>
> void SourceCoverageViewText::renderLineSuffix(raw_ostream &/*OS*/,
> unsigned /*ViewDepth*/) {
>
> -- Sean Silva
>
> On Wed, Jun 29, 2016 at 9:56 AM, Vedant Kumar via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> Author: vedantk
> Date: Wed Jun 29 11:56:46 2016
> New Revision: 274139
>
> URL: http://llvm.org/viewvc/llvm-project?rev=274139&view=rev
> Log:
> Use LLVM_ATTRIBUTE_UNUSED instead of void casts; NFC
>
> Modified:
> llvm/trunk/tools/llvm-cov/SourceCoverageViewText.cpp
>
> Modified: llvm/trunk/tools/llvm-cov/SourceCoverageViewText.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/SourceCoverageViewText.cpp?rev=274139&r1=274138&r2=274139&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-cov/SourceCoverageViewText.cpp (original)
> +++ llvm/trunk/tools/llvm-cov/SourceCoverageViewText.cpp Wed Jun 29 11:56:46 2016
> @@ -59,9 +59,11 @@ unsigned getDividerWidth(const CoverageV
>
> } // anonymous namespace
>
> -void SourceCoverageViewText::renderViewHeader(raw_ostream &OS) { (void)OS; }
> +void SourceCoverageViewText::renderViewHeader(
> + raw_ostream &OS LLVM_ATTRIBUTE_UNUSED) {}
>
> -void SourceCoverageViewText::renderViewFooter(raw_ostream &OS) { (void)OS; }
> +void SourceCoverageViewText::renderViewFooter(
> + raw_ostream &OS LLVM_ATTRIBUTE_UNUSED) {}
>
> void SourceCoverageViewText::renderSourceName(raw_ostream &OS) {
> getOptions().colored_ostream(OS, raw_ostream::CYAN) << getSourceName()
> @@ -74,11 +76,9 @@ void SourceCoverageViewText::renderLineP
> OS << " |";
> }
>
> -void SourceCoverageViewText::renderLineSuffix(raw_ostream &OS,
> - unsigned ViewDepth) {
> - (void)OS;
> - (void)ViewDepth;
> -}
> +void SourceCoverageViewText::renderLineSuffix(
> + raw_ostream &OS LLVM_ATTRIBUTE_UNUSED,
> + unsigned ViewDepth LLVM_ATTRIBUTE_UNUSED) {}
>
> void SourceCoverageViewText::renderViewDivider(raw_ostream &OS,
> unsigned ViewDepth) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list