[PATCH] D27368: [PM] Make PreservedAnalyses::preserved take its parameter by const ref.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 15:59:42 PST 2016


jlebar created this revision.
jlebar added a reviewer: chandlerc.
jlebar added subscribers: llvm-commits, silvas.
Herald added a subscriber: mehdi_amini.

Previously we were unnecessarily copying the argument.


https://reviews.llvm.org/D27368

Files:
  llvm/include/llvm/IR/PassManager.h


Index: llvm/include/llvm/IR/PassManager.h
===================================================================
--- llvm/include/llvm/IR/PassManager.h
+++ llvm/include/llvm/IR/PassManager.h
@@ -137,7 +137,7 @@
   }
 
   /// \brief Query whether all of the analyses in the set are preserved.
-  bool preserved(PreservedAnalyses Arg) {
+  bool preserved(const PreservedAnalyses& Arg) {
     if (Arg.areAllPreserved())
       return areAllPreserved();
     for (auto ID : Arg.PreservedAnalysisIDs)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27368.80143.patch
Type: text/x-patch
Size: 493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161202/e0e284e6/attachment.bin>


More information about the llvm-commits mailing list