LLVM
8.0.1
include
llvm
IR
Comdat.h
Go to the documentation of this file.
1
//===- llvm/IR/Comdat.h - Comdat definitions --------------------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
/// @file
11
/// This file contains the declaration of the Comdat class, which represents a
12
/// single COMDAT in LLVM.
13
//
14
//===----------------------------------------------------------------------===//
15
16
#ifndef LLVM_IR_COMDAT_H
17
#define LLVM_IR_COMDAT_H
18
19
#include "
llvm-c/Types.h
"
20
#include "
llvm/Support/CBindingWrapping.h
"
21
22
namespace
llvm
{
23
24
class
raw_ostream;
25
class
StringRef;
26
template
<
typename
ValueTy>
class
StringMapEntry;
27
28
// This is a Name X SelectionKind pair. The reason for having this be an
29
// independent object instead of just adding the name and the SelectionKind
30
// to a GlobalObject is that it is invalid to have two Comdats with the same
31
// name but different SelectionKind. This structure makes that unrepresentable.
32
class
Comdat
{
33
public
:
34
enum
SelectionKind
{
35
Any
,
///< The linker may choose any COMDAT.
36
ExactMatch
,
///< The data referenced by the COMDAT must be the same.
37
Largest
,
///< The linker will choose the largest COMDAT.
38
NoDuplicates
,
///< No other Module may specify this COMDAT.
39
SameSize
,
///< The data referenced by the COMDAT must be the same size.
40
};
41
42
Comdat
(
const
Comdat
&) =
delete
;
43
Comdat
(
Comdat
&&
C
);
44
45
SelectionKind
getSelectionKind
()
const
{
return
SK; }
46
void
setSelectionKind
(
SelectionKind
Val) { SK = Val; }
47
StringRef
getName
()
const
;
48
void
print
(
raw_ostream
&OS,
bool
IsForDebug =
false
)
const
;
49
void
dump
()
const
;
50
51
private
:
52
friend
class
Module
;
53
54
Comdat
();
55
56
// Points to the map in Module.
57
StringMapEntry<Comdat>
*
Name
=
nullptr
;
58
SelectionKind
SK =
Any
;
59
};
60
61
// Create wrappers for C Binding types (see CBindingWrapping.h).
62
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
(
Comdat
,
LLVMComdatRef
)
63
64
inline
raw_ostream
&operator<<(
raw_ostream
&OS,
const
Comdat
&
C
) {
65
C.print(OS);
66
return
OS;
67
}
68
69
}
// end namespace llvm
70
71
#endif // LLVM_IR_COMDAT_H
C
uint64_t CallInst * C
Definition:
NVVMIntrRange.cpp:67
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition:
StringMap.h:126
llvm::Module
A Module instance is used to store all the information related to an LLVM module. ...
Definition:
Module.h:65
llvm::Comdat
Definition:
Comdat.h:32
llvm::Comdat::SameSize
The data referenced by the COMDAT must be the same size.
Definition:
Comdat.h:39
LLVMComdatRef
struct LLVMComdat * LLVMComdatRef
Definition:
Types.h:154
Name
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Definition:
AMDGPULibCalls.cpp:221
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Definition:
CBindingWrapping.h:20
llvm::Comdat::Any
The linker may choose any COMDAT.
Definition:
Comdat.h:35
llvm::Comdat::dump
void dump() const
Definition:
AsmWriter.cpp:4313
llvm::Comdat::NoDuplicates
No other Module may specify this COMDAT.
Definition:
Comdat.h:38
llvm::Comdat::getName
StringRef getName() const
Definition:
Comdat.cpp:27
llvm::Comdat::print
void print(raw_ostream &OS, bool IsForDebug=false) const
Definition:
AsmWriter.cpp:4097
inline
amdgpu inline
Definition:
AMDGPUInline.cpp:89
llvm::Comdat::ExactMatch
The data referenced by the COMDAT must be the same.
Definition:
Comdat.h:36
llvm::Comdat::setSelectionKind
void setSelectionKind(SelectionKind Val)
Definition:
Comdat.h:46
llvm::Comdat::Largest
The linker will choose the largest COMDAT.
Definition:
Comdat.h:37
CBindingWrapping.h
const
aarch64 promote const
Definition:
AArch64PromoteConstant.cpp:232
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition:
raw_ostream.h:46
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:49
Types.h
llvm::Comdat::SelectionKind
SelectionKind
Definition:
Comdat.h:34
llvm::Comdat::getSelectionKind
SelectionKind getSelectionKind() const
Definition:
Comdat.h:45
Generated on Sun Dec 20 2020 13:53:25 for LLVM by
1.8.13