[llvm] r270074 - [SCCP] Prefer class to struct.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 09:05:11 PDT 2016


Any particular reason? If it only has public inheritance and public
members, struct seems fine.

On Thu, May 19, 2016 at 8:58 AM, Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: davide
> Date: Thu May 19 10:58:02 2016
> New Revision: 270074
>
> URL: http://llvm.org/viewvc/llvm-project?rev=270074&view=rev
> Log:
> [SCCP] Prefer class to struct.
>
> Modified:
>     llvm/trunk/include/llvm/Transforms/Scalar/SCCP.h
>     llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
>
> Modified: llvm/trunk/include/llvm/Transforms/Scalar/SCCP.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/SCCP.h?rev=270074&r1=270073&r2=270074&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Transforms/Scalar/SCCP.h (original)
> +++ llvm/trunk/include/llvm/Transforms/Scalar/SCCP.h Thu May 19 10:58:02
> 2016
> @@ -27,7 +27,8 @@
>  namespace llvm {
>
>  /// This pass performs function-level constant propagation and merging.
> -struct SCCPPass : PassInfoMixin<SCCPPass> {
> +class SCCPPass : public PassInfoMixin<SCCPPass> {
> +public:
>    PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
>  };
>  }
>
> Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=270074&r1=270073&r2=270074&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu May 19 10:58:02 2016
> @@ -1638,7 +1638,8 @@ namespace {
>  /// SCCP Class - This class uses the SCCPSolver to implement a
> per-function
>  /// Sparse Conditional Constant Propagator.
>  ///
> -struct SCCPLegacyPass : public FunctionPass {
> +class SCCPLegacyPass : public FunctionPass {
> +public:
>    void getAnalysisUsage(AnalysisUsage &AU) const override {
>      AU.addRequired<TargetLibraryInfoWrapperPass>();
>      AU.addPreserved<GlobalsAAWrapperPass>();
> @@ -1960,7 +1961,8 @@ namespace {
>  /// IPSCCP Class - This class implements interprocedural Sparse
> Conditional
>  /// Constant Propagation.
>  ///
> -struct IPSCCPLegacyPass : public ModulePass {
> +class IPSCCPLegacyPass : public ModulePass {
> +public:
>    static char ID;
>
>    IPSCCPLegacyPass() : ModulePass(ID) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160519/c4578d1d/attachment.html>


More information about the llvm-commits mailing list