Thanks to visit codestin.com
Credit goes to llvm.org
LLVM
22.0.0git
include
llvm
IR
ReplaceConstant.h
Go to the documentation of this file.
1
//===- ReplaceConstant.h - Replacing LLVM constant expressions --*- 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 declares the utility function for replacing LLVM constant
10
// expressions by instructions.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_IR_REPLACECONSTANT_H
15
#define LLVM_IR_REPLACECONSTANT_H
16
17
#include "
llvm/Support/Compiler.h
"
18
19
namespace
llvm
{
20
21
template
<
typename
T>
class
ArrayRef
;
22
class
Constant
;
23
class
Function
;
24
25
/// Replace constant expressions users of the given constants with
26
/// instructions. Return whether anything was changed.
27
///
28
/// Passing RestrictToFunc will restrict the constant replacement
29
/// to the passed in functions scope, as opposed to the replacements
30
/// occurring at module scope.
31
///
32
/// RemoveDeadConstants by default will remove all dead constants as
33
/// the final step of the function after replacement, when passed
34
/// false it will skip this final step.
35
///
36
/// If \p IncludeSelf is enabled, also convert the passed constants themselves
37
/// to instructions, rather than only their users.
38
LLVM_ABI
bool
convertUsersOfConstantsToInstructions
(
39
ArrayRef<Constant *>
Consts,
Function
*RestrictToFunc =
nullptr
,
40
bool
RemoveDeadConstants =
true
,
bool
IncludeSelf =
false
);
41
42
}
// end namespace llvm
43
44
#endif
// LLVM_IR_REPLACECONSTANT_H
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition
ArrayRef.h:41
llvm::Constant
This is an important base class in LLVM.
Definition
Constant.h:43
llvm::Function
Definition
Function.h:64
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::convertUsersOfConstantsToInstructions
LLVM_ABI bool convertUsersOfConstantsToInstructions(ArrayRef< Constant * > Consts, Function *RestrictToFunc=nullptr, bool RemoveDeadConstants=true, bool IncludeSelf=false)
Replace constant expressions users of the given constants with instructions.
Definition
ReplaceConstant.cpp:52
Generated on
for LLVM by
1.14.0