From eca5949031c31fe5ff5ad7a5df07bbce13379108 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 24 Sep 2024 07:25:07 +0800 Subject: [codegen][NFC] add static mark for internal usage variable and function (#109431) Detect by clang-tidy misc-use-internal-linkage --- clang/lib/CodeGen/CodeGenModule.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 17b82b205063..d53d47979f29 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -784,8 +784,9 @@ getLLVMVisibility(clang::LangOptions::VisibilityFromDLLStorageClassKinds K) { llvm_unreachable("unknown option value!"); } -void setLLVMVisibility(llvm::GlobalValue &GV, - std::optional V) { +static void +setLLVMVisibility(llvm::GlobalValue &GV, + std::optional V) { if (!V) return; @@ -4224,8 +4225,8 @@ TargetMVPriority(const TargetInfo &TI, // in the cases of CPUDispatch, this causes issues. This also makes sure we // work with internal linkage functions, so that the same function name can be // used with internal linkage in multiple TUs. -llvm::GlobalValue::LinkageTypes getMultiversionLinkage(CodeGenModule &CGM, - GlobalDecl GD) { +static llvm::GlobalValue::LinkageTypes +getMultiversionLinkage(CodeGenModule &CGM, GlobalDecl GD) { const FunctionDecl *FD = cast(GD.getDecl()); if (FD->getFormalLinkage() == Linkage::Internal) return llvm::GlobalValue::InternalLinkage; -- cgit v1.2.3