clang 24.0.0git
CIROpInterfaces.cpp
Go to the documentation of this file.
1//====- CIROpInterfaces.cpp - Interface to AST Attributes ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Defines the interface to CIR operations.
10//
11//===----------------------------------------------------------------------===//
13
14using namespace cir;
15
16/// Include the generated type qualifiers interfaces.
17#include "clang/CIR/Interfaces/CIROpInterfaces.cpp.inc"
18
20
21bool CIRGlobalValueInterface::hasDefaultVisibility() {
22 return getGlobalVisibility() == cir::VisibilityKind::Default;
23}
24
25bool CIRGlobalValueInterface::canBenefitFromLocalAlias() {
27 // hasComdat here should be isDeduplicateComdat, but as far as clang codegen
28 // is concerned, there is no case for Comdat::NoDeduplicate as all comdat
29 // would be Comdat::Any or Comdat::Largest (in the case of MS ABI). And CIRGen
30 // wouldn't even generate Comdat::Largest comdat as it tries to leave ABI
31 // specifics to LLVM lowering stage, thus here we don't need test Comdat
32 // selectionKind.
33 return hasDefaultVisibility() && hasExternalLinkage() && !isDeclaration() &&
34 !hasComdat();
35}
static bool supportIFuncAttr()