LLVM
15.0.0git
include
llvm
IR
DerivedUser.h
Go to the documentation of this file.
1
//===- DerivedUser.h - Base for non-IR Users --------------------*- 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
#ifndef LLVM_IR_DERIVEDUSER_H
10
#define LLVM_IR_DERIVEDUSER_H
11
12
#include "
llvm/IR/User.h
"
13
14
namespace
llvm
{
15
16
class
Type
;
17
class
Use;
18
19
/// Extension point for the Value hierarchy. All classes outside of lib/IR
20
/// that wish to inherit from User should instead inherit from DerivedUser
21
/// instead. Inheriting from this class is discouraged.
22
///
23
/// Generally speaking, Value is the base of a closed class hierarchy
24
/// that can't be extended by code outside of lib/IR. This class creates a
25
/// loophole that allows classes outside of lib/IR to extend User to leverage
26
/// its use/def list machinery.
27
class
DerivedUser
:
public
User
{
28
protected
:
29
using
DeleteValueTy
= void (*)(
DerivedUser
*);
30
31
private
:
32
friend
class
Value
;
33
34
DeleteValueTy
DeleteValue;
35
36
public
:
37
DerivedUser
(
Type
*Ty,
unsigned
VK,
Use
*U,
unsigned
NumOps,
38
DeleteValueTy
DeleteValue)
39
:
User
(Ty, VK, U, NumOps), DeleteValue(DeleteValue) {}
40
};
41
42
}
// end namespace llvm
43
44
#endif // LLVM_IR_DERIVEDUSER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:17
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:
Type.h:45
llvm::DerivedUser::DeleteValueTy
void(*)(DerivedUser *) DeleteValueTy
Definition:
DerivedUser.h:29
llvm::User
Definition:
User.h:44
llvm::DerivedUser::DerivedUser
DerivedUser(Type *Ty, unsigned VK, Use *U, unsigned NumOps, DeleteValueTy DeleteValue)
Definition:
DerivedUser.h:37
TemplateParamKind::Type
@ Type
User.h
llvm::Value
LLVM Value Representation.
Definition:
Value.h:74
llvm::DerivedUser
Extension point for the Value hierarchy.
Definition:
DerivedUser.h:27
llvm::Use
A Use represents the edge between a Value definition and its users.
Definition:
Use.h:43
Generated on Tue May 24 2022 10:38:31 for LLVM by
1.8.17