LLVM  8.0.1
TypeMetadataUtils.h
Go to the documentation of this file.
1 //===- TypeMetadataUtils.h - Utilities related to type metadata --*- 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 // This file contains functions that make it easier to manipulate type metadata
11 // for devirtualization.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_ANALYSIS_TYPEMETADATAUTILS_H
16 #define LLVM_ANALYSIS_TYPEMETADATAUTILS_H
17 
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/IR/CallSite.h"
20 
21 namespace llvm {
22 
23 class DominatorTree;
24 
25 /// The type of CFI jumptable needed for a function.
30 };
31 
32 /// A call site that could be devirtualized.
34  /// The offset from the address point to the virtual function.
35  uint64_t Offset;
36  /// The call site itself.
38 };
39 
40 /// Given a call to the intrinsic \@llvm.type.test, find all devirtualizable
41 /// call sites based on the call and return them in DevirtCalls.
44  SmallVectorImpl<CallInst *> &Assumes, const CallInst *CI,
45  DominatorTree &DT);
46 
47 /// Given a call to the intrinsic \@llvm.type.checked.load, find all
48 /// devirtualizable call sites based on the call and return them in DevirtCalls.
52  SmallVectorImpl<Instruction *> &Preds, bool &HasNonCallUses,
53  const CallInst *CI, DominatorTree &DT);
54 }
55 
56 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
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 ...
CallSite CS
The call site itself.
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.
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:42
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Definition: Dominators.h:145
A call site that could be devirtualized.