clang
24.0.0git
include
clang
CodeGenUtils
ModuleUtils.h
Go to the documentation of this file.
1
//===--- ModuleUtils.h - Shared module emission queries ---------*- C++ -*-===//
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
// This file holds the AST queries that both classic CodeGen and CIR CodeGen
10
// need while deciding how a declaration is emitted at module scope, such as
11
// its linkage and whether it belongs in a COMDAT group.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CLANG_CODEGENUTILS_MODULEUTILS_H
16
#define LLVM_CLANG_CODEGENUTILS_MODULEUTILS_H
17
18
#include "
clang/AST/ASTContext.h
"
19
20
namespace
clang::CodeGenUtils
{
21
22
/// Check whether \p D is a strong definition, and thus must not be given
23
/// common linkage. \p NoCommon reflects -fno-common.
24
bool
isVarDeclStrongDefinition
(
const
ASTContext &Ctx,
const
VarDecl *D,
25
bool
NoCommon);
26
27
/// Check whether \p D should be emitted into a COMDAT group.
28
bool
shouldBeInCOMDAT
(
const
ASTContext &Ctx,
const
Decl &D);
29
30
}
// namespace clang::CodeGenUtils
31
32
#endif
// LLVM_CLANG_CODEGENUTILS_MODULEUTILS_H
ASTContext.h
Defines the clang::ASTContext interface.
clang::CodeGenUtils
Definition
CallUtils.h:21
clang::CodeGenUtils::isVarDeclStrongDefinition
bool isVarDeclStrongDefinition(const ASTContext &Ctx, const VarDecl *D, bool NoCommon)
Check whether D is a strong definition, and thus must not be given common linkage.
Definition
ModuleUtils.cpp:15
clang::CodeGenUtils::shouldBeInCOMDAT
bool shouldBeInCOMDAT(const ASTContext &Ctx, const Decl &D)
Check whether D should be emitted into a COMDAT group.
Definition
ModuleUtils.cpp:89
Generated on
for clang by
1.14.0