LLVM  11.0.0git
TypeMetadataUtils.h
Go to the documentation of this file.
1 //===- TypeMetadataUtils.h - Utilities related to type metadata --*- 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 contains functions that make it easier to manipulate type metadata
10 // for devirtualization.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_ANALYSIS_TYPEMETADATAUTILS_H
15 #define LLVM_ANALYSIS_TYPEMETADATAUTILS_H
16 
17 #include "llvm/ADT/SmallVector.h"
18 #include <cstdint>
19 
20 namespace llvm {
21 
22 class CallBase;
23 class CallInst;
24 class Constant;
25 class DominatorTree;
26 class Instruction;
27 class Module;
28 
29 /// The type of CFI jumptable needed for a function.
34 };
35 
36 /// A call site that could be devirtualized.
38  /// The offset from the address point to the virtual function.
39  uint64_t Offset;
40  /// The call site itself.
42 };
43 
44 /// Given a call to the intrinsic \@llvm.type.test, find all devirtualizable
45 /// call sites based on the call and return them in DevirtCalls.
48  SmallVectorImpl<CallInst *> &Assumes, const CallInst *CI,
49  DominatorTree &DT);
50 
51 /// Given a call to the intrinsic \@llvm.type.checked.load, find all
52 /// devirtualizable call sites based on the call and return them in DevirtCalls.
56  SmallVectorImpl<Instruction *> &Preds, bool &HasNonCallUses,
57  const CallInst *CI, DominatorTree &DT);
58 
60 }
61 
62 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:67
Machine Debugify Module
void findDevirtualizableCallsForTypeTest(SmallVectorImpl< DevirtCallSite > &DevirtCalls, SmallVectorImpl< CallInst *> &Assumes, const CallInst *CI, DominatorTree &DT)
Given a call to the intrinsic @llvm.type.test, find all devirtualizable call sites based on the call ...
This class represents a function call, abstracting a target machine&#39;s calling convention.
CfiFunctionLinkage
The type of CFI jumptable needed for a function.
uint64_t Offset
The offset from the address point to the virtual function.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition: InstrTypes.h:1098
void findDevirtualizableCallsForTypeCheckedLoad(SmallVectorImpl< DevirtCallSite > &DevirtCalls, SmallVectorImpl< Instruction *> &LoadedPtrs, SmallVectorImpl< Instruction *> &Preds, bool &HasNonCallUses, const CallInst *CI, DominatorTree &DT)
Given a call to the intrinsic @llvm.type.checked.load, find all devirtualizable call sites based on t...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
CallBase & CB
The call site itself.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Definition: Dominators.h:144
A call site that could be devirtualized.
This is an important base class in LLVM.
Definition: Constant.h:41
#define I(x, y, z)
Definition: MD5.cpp:59
Constant * getPointerAtOffset(Constant *I, uint64_t Offset, Module &M)