aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorCongcong Cai <congcongcai0907@163.com>2024-09-24 07:25:07 +0800
committerGitHub <noreply@github.com>2024-09-24 07:25:07 +0800
commiteca5949031c31fe5ff5ad7a5df07bbce13379108 (patch)
tree87037d8f85713a8a0b6f88609b6264410ff388e6 /clang/lib/CodeGen/CodeGenModule.cpp
parenteddbd4eb081fedddd4028244418f89e4bf5ffb09 (diff)
downloadllvm-eca5949031c31fe5ff5ad7a5df07bbce13379108.zip
llvm-eca5949031c31fe5ff5ad7a5df07bbce13379108.tar.gz
llvm-eca5949031c31fe5ff5ad7a5df07bbce13379108.tar.bz2
[codegen][NFC] add static mark for internal usage variable and function (#109431)
Detect by clang-tidy misc-use-internal-linkage
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 17b82b2..d53d479 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<llvm::GlobalValue::VisibilityTypes> V) {
+static void
+setLLVMVisibility(llvm::GlobalValue &GV,
+ std::optional<llvm::GlobalValue::VisibilityTypes> 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<FunctionDecl>(GD.getDecl());
if (FD->getFormalLinkage() == Linkage::Internal)
return llvm::GlobalValue::InternalLinkage;