[clang-tools-extra] c5e4cf4 - [clangd] NFC, hide the internal-only utility function lex.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 7 01:58:18 PST 2019


Author: Haojian Wu
Date: 2019-11-07T10:58:09+01:00
New Revision: c5e4cf40ac459aae996180089a9831959ceb3d05

URL: https://github.com/llvm/llvm-project/commit/c5e4cf40ac459aae996180089a9831959ceb3d05
DIFF: https://github.com/llvm/llvm-project/commit/c5e4cf40ac459aae996180089a9831959ceb3d05.diff

LOG: [clangd] NFC, hide the internal-only utility function lex.

To avoid any potential ODR violations.

Added: 
    

Modified: 
    clang-tools-extra/clangd/SourceCode.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp
index e52588d6aa84..d505645a74f6 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -719,9 +719,10 @@ cleanupAndFormat(StringRef Code, const tooling::Replacements &Replaces,
   return formatReplacements(Code, std::move(*CleanReplaces), Style);
 }
 
-void lex(llvm::StringRef Code, const LangOptions &LangOpts,
-         llvm::function_ref<void(const clang::Token &, const SourceManager &SM)>
-             Action) {
+static void
+lex(llvm::StringRef Code, const LangOptions &LangOpts,
+    llvm::function_ref<void(const clang::Token &, const SourceManager &SM)>
+        Action) {
   // FIXME: InMemoryFileAdapter crashes unless the buffer is null terminated!
   std::string NullTerminatedCode = Code.str();
   SourceManagerForFile FileSM("dummy.cpp", NullTerminatedCode);


        


More information about the cfe-commits mailing list