Path: blob/main/contrib/llvm-project/clang/lib/CIR/Interfaces/CIROpInterfaces.cpp
213799 views
//====- CIROpInterfaces.cpp - Interface to AST Attributes ---------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// Defines the interface to CIR operations.9//10//===----------------------------------------------------------------------===//11#include "clang/CIR/Interfaces/CIROpInterfaces.h"1213using namespace cir;1415/// Include the generated type qualifiers interfaces.16#include "clang/CIR/Interfaces/CIROpInterfaces.cpp.inc"1718#include "clang/CIR/MissingFeatures.h"1920bool CIRGlobalValueInterface::hasDefaultVisibility() {21assert(!cir::MissingFeatures::hiddenVisibility());22assert(!cir::MissingFeatures::protectedVisibility());23return isPublic() || isPrivate();24}2526bool CIRGlobalValueInterface::canBenefitFromLocalAlias() {27assert(!cir::MissingFeatures::supportIFuncAttr());28// hasComdat here should be isDeduplicateComdat, but as far as clang codegen29// is concerned, there is no case for Comdat::NoDeduplicate as all comdat30// would be Comdat::Any or Comdat::Largest (in the case of MS ABI). And CIRGen31// wouldn't even generate Comdat::Largest comdat as it tries to leave ABI32// specifics to LLVM lowering stage, thus here we don't need test Comdat33// selectionKind.34return hasDefaultVisibility() && hasExternalLinkage() && !isDeclaration() &&35!hasComdat();36}373839