[llvm] r225750 - [PM] Fix another place where I was using an overly generic T&& for the

David Blaikie dblaikie at gmail.com
Mon Jan 12 20:02:08 PST 2015


On Mon, Jan 12, 2015 at 5:44 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

> Author: chandlerc
> Date: Mon Jan 12 19:44:56 2015
> New Revision: 225750
>
> URL: http://llvm.org/viewvc/llvm-project?rev=225750&view=rev
> Log:
> [PM] Fix another place where I was using an overly generic T&& for the
> IR unit to directly use IRUnitT& for now.
>
> Modified:
>     llvm/trunk/include/llvm/IR/PassManager.h
>
> Modified: llvm/trunk/include/llvm/IR/PassManager.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=225750&r1=225749&r2=225750&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/PassManager.h (original)
> +++ llvm/trunk/include/llvm/IR/PassManager.h Mon Jan 12 19:44:56 2015
> @@ -828,7 +828,7 @@ template <typename AnalysisT> struct Inv
>  /// analysis passes to be re-run to produce fresh results if any are
> needed.
>  struct InvalidateAllAnalysesPass {
>    /// \brief Run this pass over some unit of IR.
> -  template <typename T> PreservedAnalyses run(T &&Arg) {
> +  template <typename IRUnitT> PreservedAnalyses run(IRUnitT &Arg) {
>

Since this isn't a virtual function you're implementing, you could add
'const' here without breaking any contracts (it's compatible with callers
passing non-const, but helps (only slightly) indicate that this isn't
modifying.

Arguably, I would imagine, all Analyses should take a const ref to the
IRUnit?


>      return PreservedAnalyses::none();
>    }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150112/14e3d9ce/attachment.html>


More information about the llvm-commits mailing list