LLVM
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
llvm.src
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
namespace
llvm {
20
21
class
raw_ostream;
22
class
StringRef;
23
template
<
typename
ValueTy>
class
StringMapEntry;
24
25
// This is a Name X SelectionKind pair. The reason for having this be an
26
// independent object instead of just adding the name and the SelectionKind
27
// to a GlobalObject is that it is invalid to have two Comdats with the same
28
// name but different SelectionKind. This structure makes that unrepresentable.
29
class
Comdat
{
30
public
:
31
enum
SelectionKind
{
32
Any
,
///< The linker may choose any COMDAT.
33
ExactMatch
,
///< The data referenced by the COMDAT must be the same.
34
Largest
,
///< The linker will choose the largest COMDAT.
35
NoDuplicates
,
///< No other Module may specify this COMDAT.
36
SameSize
,
///< The data referenced by the COMDAT must be the same size.
37
};
38
39
Comdat
(
const
Comdat
&) =
delete
;
40
Comdat
(
Comdat
&&
C
);
41
42
SelectionKind
getSelectionKind
()
const
{
return
SK; }
43
void
setSelectionKind
(
SelectionKind
Val) { SK = Val; }
44
StringRef
getName
()
const
;
45
void
print
(
raw_ostream
&OS,
bool
IsForDebug =
false
)
const
;
46
void
dump
()
const
;
47
48
private
:
49
friend
class
Module
;
50
51
Comdat
();
52
53
// Points to the map in Module.
54
StringMapEntry<Comdat>
*
Name
;
55
SelectionKind
SK;
56
};
57
58
inline
raw_ostream
&
operator<<
(
raw_ostream
&OS,
const
Comdat
&
C
) {
59
C.
print
(OS);
60
return
OS;
61
}
62
63
}
// end namespace llvm
64
65
#endif // LLVM_IR_COMDAT_H
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition:
StringMap.h:36
llvm::Module
A Module instance is used to store all the information related to an LLVM module. ...
Definition:
Module.h:52
llvm::Comdat
Definition:
Comdat.h:29
llvm::Comdat::SameSize
The data referenced by the COMDAT must be the same size.
Definition:
Comdat.h:36
llvm::GraphProgram::Name
Name
Definition:
GraphWriter.h:43
llvm::Comdat::Any
The linker may choose any COMDAT.
Definition:
Comdat.h:32
llvm::Comdat::getName
StringRef getName() const
Definition:
Comdat.cpp:22
llvm::Comdat::print
void print(raw_ostream &OS, bool IsForDebug=false) const
Definition:
AsmWriter.cpp:3343
llvm::Comdat::NoDuplicates
No other Module may specify this COMDAT.
Definition:
Comdat.h:35
llvm::Comdat::getSelectionKind
SelectionKind getSelectionKind() const
Definition:
Comdat.h:42
llvm::Comdat::ExactMatch
The data referenced by the COMDAT must be the same.
Definition:
Comdat.h:33
llvm::Comdat::setSelectionKind
void setSelectionKind(SelectionKind Val)
Definition:
Comdat.h:43
llvm::Comdat::Largest
The linker will choose the largest COMDAT.
Definition:
Comdat.h:34
C
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Definition:
APInt.h:1726
llvm::Comdat::dump
void dump() const
Definition:
AsmWriter.cpp:3555
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition:
raw_ostream.h:44
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:47
llvm::Comdat::SelectionKind
SelectionKind
Definition:
Comdat.h:31
Generated on Wed Mar 8 2017 17:07:10 for LLVM by
1.8.6