diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 7ef9a30e4917b44e7761cedec3bbe4c99c4beeb0..c7a7bfe2106b4d4753c0c4d6fae3132c5b4a505e 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -1457,7 +1457,7 @@ bool checkAndConsumeDirectiveWithName(Lexer &Lex, StringRef Name, Token &Tok) {
 
 unsigned getOffsetAfterHeaderGuardsAndComments(StringRef FileName,
                                                StringRef Code,
-                                               FormatStyle Style) {
+                                               const FormatStyle &Style) {
   std::unique_ptr<Environment> Env =
       Environment::CreateVirtualEnvironment(Code, FileName, /*Ranges=*/{});
   const SourceManager &SourceMgr = Env->getSourceManager();