LLVM
13.0.0git
include
llvm
IR
Comdat.h
Go to the documentation of this file.
1
//===- llvm/IR/Comdat.h - Comdat definitions --------------------*- 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
/// @file
10
/// This file contains the declaration of the Comdat class, which represents a
11
/// single COMDAT in LLVM.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_IR_COMDAT_H
16
#define LLVM_IR_COMDAT_H
17
18
#include "
llvm-c/Types.h
"
19
#include "
llvm/Support/CBindingWrapping.h
"
20
21
namespace
llvm
{
22
23
class
raw_ostream;
24
class
StringRef;
25
template
<
typename
ValueTy>
class
StringMapEntry;
26
27
// This is a Name X SelectionKind pair. The reason for having this be an
28
// independent object instead of just adding the name and the SelectionKind
29
// to a GlobalObject is that it is invalid to have two Comdats with the same
30
// name but different SelectionKind. This structure makes that unrepresentable.
31
class
Comdat
{
32
public
:
33
enum
SelectionKind
{
34
Any
,
///< The linker may choose any COMDAT.
35
ExactMatch
,
///< The data referenced by the COMDAT must be the same.
36
Largest
,
///< The linker will choose the largest COMDAT.
37
NoDuplicates
,
///< No other Module may specify this COMDAT.
38
SameSize
,
///< The data referenced by the COMDAT must be the same size.
39
};
40
41
Comdat
(
const
Comdat
&) =
delete
;
42
Comdat
(
Comdat
&&
C
);
43
44
SelectionKind
getSelectionKind
()
const
{
return
SK; }
45
void
setSelectionKind
(
SelectionKind
Val) { SK = Val; }
46
StringRef
getName
()
const
;
47
void
print
(
raw_ostream
&OS,
bool
IsForDebug =
false
)
const
;
48
void
dump
()
const
;
49
50
private
:
51
friend
class
Module
;
52
53
Comdat
();
54
55
// Points to the map in Module.
56
StringMapEntry<Comdat>
*
Name
=
nullptr
;
57
SelectionKind
SK =
Any
;
58
};
59
60
// Create wrappers for C Binding types (see CBindingWrapping.h).
61
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
(
Comdat
,
LLVMComdatRef
)
62
63
inline
raw_ostream
&operator<<(
raw_ostream
&OS,
const
Comdat
&
C
) {
64
C
.print(OS);
65
return
OS;
66
}
67
68
}
// end namespace llvm
69
70
#endif // LLVM_IR_COMDAT_H
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition:
StringMapEntry.h:69
llvm::Comdat::getName
StringRef getName() const
Definition:
Comdat.cpp:26
llvm::Comdat::NoDuplicates
@ NoDuplicates
No other Module may specify this COMDAT.
Definition:
Comdat.h:37
llvm::Comdat::ExactMatch
@ ExactMatch
The data referenced by the COMDAT must be the same.
Definition:
Comdat.h:35
Types.h
CBindingWrapping.h
llvm::Comdat::Largest
@ Largest
The linker will choose the largest COMDAT.
Definition:
Comdat.h:36
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Definition:
CBindingWrapping.h:19
llvm::Comdat::SelectionKind
SelectionKind
Definition:
Comdat.h:33
C
(vector float) vec_cmpeq(*A, *B) C
Definition:
README_ALTIVEC.txt:86
llvm::Comdat::Any
@ Any
The linker may choose any COMDAT.
Definition:
Comdat.h:34
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:
raw_ostream.h:50
llvm::Comdat::SameSize
@ SameSize
The data referenced by the COMDAT must be the same size.
Definition:
Comdat.h:38
llvm::Comdat
Definition:
Comdat.h:31
const
aarch64 promote const
Definition:
AArch64PromoteConstant.cpp:232
inline
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions inline
Definition:
README-SSE.txt:72
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition:
Module.h:67
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:57
llvm::GraphProgram::Name
Name
Definition:
GraphWriter.h:52
llvm::Comdat::dump
void dump() const
Definition:
AsmWriter.cpp:4775
llvm::Comdat::setSelectionKind
void setSelectionKind(SelectionKind Val)
Definition:
Comdat.h:45
llvm::Comdat::getSelectionKind
SelectionKind getSelectionKind() const
Definition:
Comdat.h:44
llvm::Comdat::print
void print(raw_ostream &OS, bool IsForDebug=false) const
Definition:
AsmWriter.cpp:4559
LLVMComdatRef
struct LLVMComdat * LLVMComdatRef
Definition:
Types.h:153
Generated on Fri Mar 5 2021 21:22:20 for LLVM by
1.8.17