diff --git a/clang/lib/Format/AffectedRangeManager.h b/clang/lib/Format/AffectedRangeManager.h index 9142315a9f34..88b4dcfe76ff 100644 --- a/clang/lib/Format/AffectedRangeManager.h +++ b/clang/lib/Format/AffectedRangeManager.h @@ -56,6 +56,7 @@ private: // Returns \c true if line or one if its children is affected. bool nonPPLineAffected(AnnotatedLine *Line, const AnnotatedLine *PreviousLine); + SourceManager &SourceMgr; const SmallVector Ranges; }; @@ -63,4 +64,5 @@ private: } // namespace format } // namespace clang -#endif // LLVM_CLANG_LIB_FORMAT_WHITESPACEMANAGER_H +#endif // LLVM_CLANG_LIB_FORMAT_AFFECTEDRANGEMANAGER_H +# diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index d55886494b43..6370be903dde 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1460,7 +1460,7 @@ public: std::unique_ptr FileMgr, std::unique_ptr VirtualSM, std::unique_ptr Diagnostics, - std::vector CharRanges) + const std::vector &CharRanges) : Style(Style), ID(ID), CharRanges(CharRanges.begin(), CharRanges.end()), SM(*VirtualSM), FileMgr(std::move(FileMgr)), VirtualSM(std::move(VirtualSM)), Diagnostics(std::move(Diagnostics)) {}