Index: include/llvm/IR/LegacyPassManagers.h =================================================================== --- include/llvm/IR/LegacyPassManagers.h +++ include/llvm/IR/LegacyPassManagers.h @@ -264,10 +264,10 @@ // TODO: We could consider sorting the dependency arrays within the // AnalysisUsage (since they are conceptually unordered). ID.AddBoolean(AU.getPreservesAll()); - for (auto &Vec : {AU.getRequiredSet(), AU.getRequiredTransitiveSet(), - AU.getPreservedSet(), AU.getUsedSet()}) { - ID.AddInteger(Vec.size()); - for(AnalysisID AID : Vec) + for (auto *Vec : {&AU.getRequiredSet(), &AU.getRequiredTransitiveSet(), + &AU.getPreservedSet(), &AU.getUsedSet()}) { + ID.AddInteger(Vec->size()); + for(AnalysisID AID : *Vec) ID.AddPointer(AID); } } Index: include/llvm/PassAnalysisSupport.h =================================================================== --- include/llvm/PassAnalysisSupport.h +++ include/llvm/PassAnalysisSupport.h @@ -36,11 +36,14 @@ /// class AnalysisUsage { public: - typedef SmallVector VectorType; + typedef SmallVectorImpl VectorType; private: /// Sets of analyses required and preserved by a pass - VectorType Required, RequiredTransitive, Preserved, Used; + SmallVector Required; + SmallVector RequiredTransitive; + SmallVector Preserved; + SmallVector Used; bool PreservesAll; public: