2007-01-26 21:38:26 +00:00
|
|
|
//===-- llvm/CodeGen/MachineModuleInfo.h ------------------------*- C++ -*-===//
|
2005-12-16 22:45:29 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-12-16 22:45:29 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2007-01-26 21:38:26 +00:00
|
|
|
// Collect meta information for a module. This information should be in a
|
|
|
|
// neutral form that can be used by different debugging and exception handling
|
|
|
|
// schemes.
|
2005-12-16 22:45:29 +00:00
|
|
|
//
|
2006-01-17 17:31:53 +00:00
|
|
|
// The organization of information is primarily clustered around the source
|
2006-02-06 19:12:02 +00:00
|
|
|
// compile units. The main exception is source line correspondence where
|
2006-01-17 17:31:53 +00:00
|
|
|
// inlining may interleave code from various compile units.
|
|
|
|
//
|
2007-01-26 21:38:26 +00:00
|
|
|
// The following information can be retrieved from the MachineModuleInfo.
|
2006-01-17 17:31:53 +00:00
|
|
|
//
|
|
|
|
// -- Source directories - Directories are uniqued based on their canonical
|
2006-02-06 15:33:21 +00:00
|
|
|
// string and assigned a sequential numeric ID (base 1.)
|
2006-01-17 17:31:53 +00:00
|
|
|
// -- Source files - Files are also uniqued based on their name and directory
|
2006-02-06 15:33:21 +00:00
|
|
|
// ID. A file ID is sequential number (base 1.)
|
2006-10-17 21:51:44 +00:00
|
|
|
// -- Source line correspondence - A vector of file ID, line#, column# triples.
|
2006-01-17 17:31:53 +00:00
|
|
|
// A DEBUG_LOCATION instruction is generated by the DAG Legalizer
|
|
|
|
// corresponding to each entry in the source line list. This allows a debug
|
2006-02-06 19:12:02 +00:00
|
|
|
// emitter to generate labels referenced by debug information tables.
|
2006-01-17 17:31:53 +00:00
|
|
|
//
|
2005-12-16 22:45:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2007-01-26 21:38:26 +00:00
|
|
|
#ifndef LLVM_CODEGEN_MACHINEMODULEINFO_H
|
|
|
|
#define LLVM_CODEGEN_MACHINEMODULEINFO_H
|
2005-12-16 22:45:29 +00:00
|
|
|
|
2010-03-10 22:34:10 +00:00
|
|
|
#include "llvm/Pass.h"
|
2010-03-13 20:55:24 +00:00
|
|
|
#include "llvm/GlobalValue.h"
|
2010-03-10 22:34:10 +00:00
|
|
|
#include "llvm/Metadata.h"
|
2008-10-16 00:20:14 +00:00
|
|
|
#include "llvm/CodeGen/MachineLocation.h"
|
2010-03-13 20:55:24 +00:00
|
|
|
#include "llvm/MC/MCContext.h"
|
2010-03-10 22:34:10 +00:00
|
|
|
#include "llvm/Support/Dwarf.h"
|
2010-04-02 19:42:39 +00:00
|
|
|
#include "llvm/Support/DebugLoc.h"
|
2009-12-28 08:20:46 +00:00
|
|
|
#include "llvm/Support/ValueHandle.h"
|
2010-03-10 22:34:10 +00:00
|
|
|
#include "llvm/System/DataTypes.h"
|
2010-03-13 20:55:24 +00:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
|
|
|
#include "llvm/ADT/PointerIntPair.h"
|
|
|
|
#include "llvm/ADT/SmallPtrSet.h"
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
2005-12-16 22:45:29 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2006-01-17 17:31:53 +00:00
|
|
|
|
2006-02-06 15:33:21 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2006-01-26 20:21:46 +00:00
|
|
|
// Forward declarations.
|
2006-02-11 01:01:30 +00:00
|
|
|
class Constant;
|
2010-03-10 22:34:10 +00:00
|
|
|
class GlobalVariable;
|
2009-10-01 01:03:26 +00:00
|
|
|
class MDNode;
|
2007-02-21 22:38:31 +00:00
|
|
|
class MachineBasicBlock;
|
2006-04-07 16:34:46 +00:00
|
|
|
class MachineFunction;
|
2006-01-26 20:21:46 +00:00
|
|
|
class Module;
|
2006-02-06 15:33:21 +00:00
|
|
|
class PointerType;
|
|
|
|
class StructType;
|
2009-09-15 22:44:26 +00:00
|
|
|
|
|
|
|
/// MachineModuleInfoImpl - This class can be derived from and used by targets
|
|
|
|
/// to hold private target-specific information for each Module. Objects of
|
|
|
|
/// type are accessed/created with MMI::getInfo and destroyed when the
|
|
|
|
/// MachineModuleInfo is destroyed.
|
2009-09-16 06:03:48 +00:00
|
|
|
class MachineModuleInfoImpl {
|
|
|
|
public:
|
2010-03-10 22:34:10 +00:00
|
|
|
typedef PointerIntPair<MCSymbol*, 1, bool> StubValueTy;
|
2009-09-15 22:44:26 +00:00
|
|
|
virtual ~MachineModuleInfoImpl();
|
2010-03-10 22:34:10 +00:00
|
|
|
typedef std::vector<std::pair<MCSymbol*, StubValueTy> > SymbolListTy;
|
2010-02-15 22:35:59 +00:00
|
|
|
protected:
|
2010-03-10 22:34:10 +00:00
|
|
|
static SymbolListTy GetSortedStubs(const DenseMap<MCSymbol*, StubValueTy>&);
|
2009-09-15 22:44:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-07-03 22:53:42 +00:00
|
|
|
|
2007-02-21 22:38:31 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// LandingPadInfo - This structure is used to retain landing pad info for
|
|
|
|
/// the current function.
|
|
|
|
///
|
|
|
|
struct LandingPadInfo {
|
2010-03-14 01:41:15 +00:00
|
|
|
MachineBasicBlock *LandingPadBlock; // Landing pad block.
|
|
|
|
SmallVector<MCSymbol*, 1> BeginLabels; // Labels prior to invoke.
|
|
|
|
SmallVector<MCSymbol*, 1> EndLabels; // Labels after invoke.
|
|
|
|
MCSymbol *LandingPadLabel; // Label at beginning of landing pad.
|
2010-04-15 01:51:59 +00:00
|
|
|
const Function *Personality; // Personality function.
|
2010-03-14 01:41:15 +00:00
|
|
|
std::vector<int> TypeIds; // List of type ids (filters negative)
|
2007-06-02 16:53:42 +00:00
|
|
|
|
2007-09-24 15:48:49 +00:00
|
|
|
explicit LandingPadInfo(MachineBasicBlock *MBB)
|
2010-03-14 01:41:15 +00:00
|
|
|
: LandingPadBlock(MBB), LandingPadLabel(0), Personality(0) {}
|
2007-02-21 22:38:31 +00:00
|
|
|
};
|
|
|
|
|
2010-03-15 19:09:43 +00:00
|
|
|
class MMIAddrLabelMap;
|
|
|
|
|
2005-12-16 22:45:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-01-26 21:38:26 +00:00
|
|
|
/// MachineModuleInfo - This class contains meta information specific to a
|
|
|
|
/// module. Queries can be made by different debugging and exception handling
|
|
|
|
/// schemes and reformated for specific use.
|
2005-12-16 22:45:29 +00:00
|
|
|
///
|
2007-01-26 21:38:26 +00:00
|
|
|
class MachineModuleInfo : public ImmutablePass {
|
2010-03-13 20:55:24 +00:00
|
|
|
/// Context - This is the MCContext used for the entire code generator.
|
|
|
|
MCContext Context;
|
|
|
|
|
2010-04-06 00:51:52 +00:00
|
|
|
/// TheModule - This is the LLVM Module being worked on.
|
2010-04-15 01:51:59 +00:00
|
|
|
const Module *TheModule;
|
2010-04-06 00:51:52 +00:00
|
|
|
|
2009-09-16 05:26:00 +00:00
|
|
|
/// ObjFileMMI - This is the object-file-format-specific implementation of
|
|
|
|
/// MachineModuleInfoImpl, which lets targets accumulate whatever info they
|
|
|
|
/// want.
|
|
|
|
MachineModuleInfoImpl *ObjFileMMI;
|
2009-09-15 22:44:26 +00:00
|
|
|
|
2006-04-07 16:34:46 +00:00
|
|
|
// FrameMoves - List of moves done by a function's prolog. Used to construct
|
2007-01-26 21:38:26 +00:00
|
|
|
// frame maps by debug and exception handling consumers.
|
2007-01-24 18:45:13 +00:00
|
|
|
std::vector<MachineMove> FrameMoves;
|
2007-02-21 22:38:31 +00:00
|
|
|
|
|
|
|
// LandingPads - List of LandingPadInfo describing the landing pad information
|
|
|
|
// in the current function.
|
|
|
|
std::vector<LandingPadInfo> LandingPads;
|
2010-01-28 01:45:32 +00:00
|
|
|
|
|
|
|
// Map of invoke call site index values to associated begin EH_LABEL for
|
|
|
|
// the current function.
|
2010-03-14 01:41:15 +00:00
|
|
|
DenseMap<MCSymbol*, unsigned> CallSiteMap;
|
2010-01-28 01:45:32 +00:00
|
|
|
|
|
|
|
// The current call site index being processed, if any. 0 if none.
|
|
|
|
unsigned CurCallSite;
|
|
|
|
|
2007-02-22 16:40:10 +00:00
|
|
|
// TypeInfos - List of C++ TypeInfo used in the current function.
|
2007-02-21 22:38:31 +00:00
|
|
|
//
|
2010-04-15 01:51:59 +00:00
|
|
|
std::vector<const GlobalVariable *> TypeInfos;
|
2005-12-16 22:45:29 +00:00
|
|
|
|
2007-06-02 16:53:42 +00:00
|
|
|
// FilterIds - List of typeids encoding filters used in the current function.
|
|
|
|
//
|
|
|
|
std::vector<unsigned> FilterIds;
|
|
|
|
|
2007-07-05 15:15:01 +00:00
|
|
|
// FilterEnds - List of the indices in FilterIds corresponding to filter
|
|
|
|
// terminators.
|
|
|
|
//
|
|
|
|
std::vector<unsigned> FilterEnds;
|
|
|
|
|
2007-05-13 15:42:26 +00:00
|
|
|
// Personalities - Vector of all personality functions ever seen. Used to emit
|
|
|
|
// common EH frames.
|
2010-04-15 01:51:59 +00:00
|
|
|
std::vector<const Function *> Personalities;
|
2007-07-14 14:06:15 +00:00
|
|
|
|
2009-07-20 06:14:25 +00:00
|
|
|
/// UsedFunctions - The functions in the @llvm.used list in a more easily
|
|
|
|
/// searchable format. This does not include the functions in
|
|
|
|
/// llvm.compiler.used.
|
2008-01-16 19:59:28 +00:00
|
|
|
SmallPtrSet<const Function *, 32> UsedFunctions;
|
|
|
|
|
2010-03-14 17:53:23 +00:00
|
|
|
|
|
|
|
/// AddrLabelSymbols - This map keeps track of which symbol is being used for
|
|
|
|
/// the specified basic block's address of label.
|
2010-03-15 19:09:43 +00:00
|
|
|
MMIAddrLabelMap *AddrLabelSymbols;
|
2010-03-14 17:53:23 +00:00
|
|
|
|
2007-07-14 14:06:15 +00:00
|
|
|
bool CallsEHReturn;
|
|
|
|
bool CallsUnwindInit;
|
2009-01-13 23:02:17 +00:00
|
|
|
|
|
|
|
/// DbgInfoAvailable - True if debugging information is available
|
|
|
|
/// in this module.
|
|
|
|
bool DbgInfoAvailable;
|
2009-10-01 01:03:26 +00:00
|
|
|
|
2005-12-16 22:45:29 +00:00
|
|
|
public:
|
2007-05-06 13:37:16 +00:00
|
|
|
static char ID; // Pass identification, replacement for typeid
|
2007-05-01 21:15:47 +00:00
|
|
|
|
2010-04-02 19:42:39 +00:00
|
|
|
typedef std::pair<unsigned, DebugLoc> UnsignedDebugLocPair;
|
|
|
|
typedef SmallVector<std::pair<TrackingVH<MDNode>, UnsignedDebugLocPair>, 4>
|
2009-10-22 18:25:28 +00:00
|
|
|
VariableDbgInfoMapTy;
|
2009-10-01 01:03:26 +00:00
|
|
|
VariableDbgInfoMapTy VariableDbgInfo;
|
|
|
|
|
2010-03-13 20:55:24 +00:00
|
|
|
MachineModuleInfo(); // DUMMY CONSTRUCTOR, DO NOT CALL.
|
|
|
|
MachineModuleInfo(const MCAsmInfo &MAI); // Real constructor.
|
2007-01-26 21:38:26 +00:00
|
|
|
~MachineModuleInfo();
|
2005-12-16 22:45:29 +00:00
|
|
|
|
2006-01-17 17:31:53 +00:00
|
|
|
bool doInitialization();
|
|
|
|
bool doFinalization();
|
2009-09-15 22:44:26 +00:00
|
|
|
|
2007-01-26 21:38:26 +00:00
|
|
|
/// EndFunction - Discard function meta information.
|
2006-04-07 16:34:46 +00:00
|
|
|
///
|
|
|
|
void EndFunction();
|
2010-03-13 20:55:24 +00:00
|
|
|
|
|
|
|
const MCContext &getContext() const { return Context; }
|
|
|
|
MCContext &getContext() { return Context; }
|
2006-04-07 16:34:46 +00:00
|
|
|
|
2010-04-15 01:51:59 +00:00
|
|
|
void setModule(const Module *M) { TheModule = M; }
|
|
|
|
const Module *getModule() const { return TheModule; }
|
2010-04-06 00:51:52 +00:00
|
|
|
|
2009-09-15 22:44:26 +00:00
|
|
|
/// getInfo - Keep track of various per-function pieces of information for
|
|
|
|
/// backends that would like to do so.
|
|
|
|
///
|
|
|
|
template<typename Ty>
|
2009-09-16 06:25:03 +00:00
|
|
|
Ty &getObjFileInfo() {
|
2009-09-16 05:26:00 +00:00
|
|
|
if (ObjFileMMI == 0)
|
|
|
|
ObjFileMMI = new Ty(*this);
|
2009-09-16 06:25:03 +00:00
|
|
|
return *static_cast<Ty*>(ObjFileMMI);
|
2009-09-15 22:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename Ty>
|
2009-09-16 06:25:03 +00:00
|
|
|
const Ty &getObjFileInfo() const {
|
2009-09-16 05:26:00 +00:00
|
|
|
return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>();
|
2009-09-15 22:44:26 +00:00
|
|
|
}
|
|
|
|
|
2006-01-26 20:21:46 +00:00
|
|
|
/// AnalyzeModule - Scan the module for global debug information.
|
|
|
|
///
|
2010-04-15 01:51:59 +00:00
|
|
|
void AnalyzeModule(const Module &M);
|
2006-01-26 20:21:46 +00:00
|
|
|
|
2007-01-26 21:38:26 +00:00
|
|
|
/// hasDebugInfo - Returns true if valid debug info is present.
|
2006-01-17 17:31:53 +00:00
|
|
|
///
|
2009-01-13 23:02:17 +00:00
|
|
|
bool hasDebugInfo() const { return DbgInfoAvailable; }
|
|
|
|
void setDebugInfoAvailability(bool avail) { DbgInfoAvailable = true; }
|
|
|
|
|
2007-07-14 14:06:15 +00:00
|
|
|
bool callsEHReturn() const { return CallsEHReturn; }
|
|
|
|
void setCallsEHReturn(bool b) { CallsEHReturn = b; }
|
|
|
|
|
|
|
|
bool callsUnwindInit() const { return CallsUnwindInit; }
|
|
|
|
void setCallsUnwindInit(bool b) { CallsUnwindInit = b; }
|
2007-01-29 23:20:22 +00:00
|
|
|
|
2006-04-07 16:34:46 +00:00
|
|
|
/// getFrameMoves - Returns a reference to a list of moves done in the current
|
2007-01-26 21:38:26 +00:00
|
|
|
/// function's prologue. Used to construct frame maps for debug and exception
|
|
|
|
/// handling comsumers.
|
2007-01-24 18:45:13 +00:00
|
|
|
std::vector<MachineMove> &getFrameMoves() { return FrameMoves; }
|
2007-02-21 22:38:31 +00:00
|
|
|
|
2010-03-14 17:53:23 +00:00
|
|
|
/// getAddrLabelSymbol - Return the symbol to be used for the specified basic
|
|
|
|
/// block when its address is taken. This cannot be its normal LBB label
|
|
|
|
/// because the block may be accessed outside its containing function.
|
|
|
|
MCSymbol *getAddrLabelSymbol(const BasicBlock *BB);
|
2010-03-15 20:39:00 +00:00
|
|
|
|
2010-03-16 00:29:39 +00:00
|
|
|
/// getAddrLabelSymbolToEmit - Return the symbol to be used for the specified
|
|
|
|
/// basic block when its address is taken. If other blocks were RAUW'd to
|
|
|
|
/// this one, we may have to emit them as well, return the whole set.
|
|
|
|
std::vector<MCSymbol*> getAddrLabelSymbolToEmit(const BasicBlock *BB);
|
|
|
|
|
2010-03-15 20:39:00 +00:00
|
|
|
/// takeDeletedSymbolsForFunction - If the specified function has had any
|
|
|
|
/// references to address-taken blocks generated, but the block got deleted,
|
|
|
|
/// return the symbol now so we can emit it. This prevents emitting a
|
|
|
|
/// reference to a symbol that has no definition.
|
|
|
|
void takeDeletedSymbolsForFunction(const Function *F,
|
|
|
|
std::vector<MCSymbol*> &Result);
|
|
|
|
|
2010-03-14 17:53:23 +00:00
|
|
|
|
2010-03-14 08:36:50 +00:00
|
|
|
//===- EH ---------------------------------------------------------------===//
|
2007-02-21 22:38:31 +00:00
|
|
|
|
|
|
|
/// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the
|
|
|
|
/// specified MachineBasicBlock.
|
|
|
|
LandingPadInfo &getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad);
|
|
|
|
|
|
|
|
/// addInvoke - Provide the begin and end labels of an invoke style call and
|
|
|
|
/// associate it with a try landing pad block.
|
2010-03-14 01:41:15 +00:00
|
|
|
void addInvoke(MachineBasicBlock *LandingPad,
|
|
|
|
MCSymbol *BeginLabel, MCSymbol *EndLabel);
|
2007-02-21 22:38:31 +00:00
|
|
|
|
|
|
|
/// addLandingPad - Add a new panding pad. Returns the label ID for the
|
|
|
|
/// landing pad entry.
|
2010-03-14 02:33:54 +00:00
|
|
|
MCSymbol *addLandingPad(MachineBasicBlock *LandingPad);
|
2007-02-21 22:38:31 +00:00
|
|
|
|
|
|
|
/// addPersonality - Provide the personality function for the exception
|
|
|
|
/// information.
|
2010-04-15 01:51:59 +00:00
|
|
|
void addPersonality(MachineBasicBlock *LandingPad,
|
|
|
|
const Function *Personality);
|
2007-05-13 15:42:26 +00:00
|
|
|
|
|
|
|
/// getPersonalityIndex - Get index of the current personality function inside
|
|
|
|
/// Personalitites array
|
|
|
|
unsigned getPersonalityIndex() const;
|
|
|
|
|
|
|
|
/// getPersonalities - Return array of personality functions ever seen.
|
2010-04-15 01:51:59 +00:00
|
|
|
const std::vector<const Function *>& getPersonalities() const {
|
2007-05-13 15:42:26 +00:00
|
|
|
return Personalities;
|
|
|
|
}
|
2007-06-02 16:53:42 +00:00
|
|
|
|
2009-07-20 06:14:25 +00:00
|
|
|
/// isUsedFunction - Return true if the functions in the llvm.used list. This
|
|
|
|
/// does not return true for things in llvm.compiler.used unless they are also
|
|
|
|
/// in llvm.used.
|
|
|
|
bool isUsedFunction(const Function *F) {
|
|
|
|
return UsedFunctions.count(F);
|
2008-01-16 19:59:28 +00:00
|
|
|
}
|
|
|
|
|
2007-02-21 22:38:31 +00:00
|
|
|
/// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
|
|
|
|
///
|
|
|
|
void addCatchTypeInfo(MachineBasicBlock *LandingPad,
|
2010-04-15 01:51:59 +00:00
|
|
|
std::vector<const GlobalVariable *> &TyInfo);
|
2007-06-02 16:53:42 +00:00
|
|
|
|
|
|
|
/// addFilterTypeInfo - Provide the filter typeinfo for a landing pad.
|
2007-03-01 20:25:32 +00:00
|
|
|
///
|
2007-06-02 16:53:42 +00:00
|
|
|
void addFilterTypeInfo(MachineBasicBlock *LandingPad,
|
2010-04-15 01:51:59 +00:00
|
|
|
std::vector<const GlobalVariable *> &TyInfo);
|
2007-06-02 16:53:42 +00:00
|
|
|
|
There is an impedance matching problem between LLVM and
gcc exception handling: if an exception unwinds through
an invoke, then execution must branch to the invoke's
unwind target. We previously tried to enforce this by
appending a cleanup action to every selector, however
this does not always work correctly due to an optimization
in the C++ unwinding runtime: if only cleanups would be
run while unwinding an exception, then the program just
terminates without actually executing the cleanups, as
invoke semantics would require. I was hoping this
wouldn't be a problem, but in fact it turns out to be the
cause of all the remaining failures in the LLVM testsuite
(these also fail with -enable-correct-eh-support, so turning
on -enable-eh didn't make things worse!). Instead we need
to append a full-blown catch-all to the end of each
selector. The correct way of doing this depends on the
personality function, i.e. it is language dependent, so
can only be done by gcc. Thus this patch which generalizes
the eh.selector intrinsic so that it can handle all possible
kinds of action table entries (before it didn't accomodate
cleanups): now 0 indicates a cleanup, and filters have to be
specified using the number of type infos plus one rather than
the number of type infos. Related gcc patches will cause
Ada to pass a cleanup (0) to force the selector to always
fire, while C++ will use a C++ catch-all (null).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 15:47:50 +00:00
|
|
|
/// addCleanup - Add a cleanup action for a landing pad.
|
|
|
|
///
|
|
|
|
void addCleanup(MachineBasicBlock *LandingPad);
|
|
|
|
|
2007-02-21 22:38:31 +00:00
|
|
|
/// getTypeIDFor - Return the type id for the specified typeinfo. This is
|
|
|
|
/// function wide.
|
2010-04-15 01:51:59 +00:00
|
|
|
unsigned getTypeIDFor(const GlobalVariable *TI);
|
2007-06-02 16:53:42 +00:00
|
|
|
|
|
|
|
/// getFilterIDFor - Return the id of the filter encoded by TyIds. This is
|
|
|
|
/// function wide.
|
2008-06-27 01:27:56 +00:00
|
|
|
int getFilterIDFor(std::vector<unsigned> &TyIds);
|
2007-06-02 16:53:42 +00:00
|
|
|
|
2007-02-21 22:38:31 +00:00
|
|
|
/// TidyLandingPads - Remap landing pad labels and remove any deleted landing
|
|
|
|
/// pads.
|
2010-04-16 08:46:10 +00:00
|
|
|
void TidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap = 0);
|
2007-02-21 22:38:31 +00:00
|
|
|
|
2007-05-13 15:42:26 +00:00
|
|
|
/// getLandingPads - Return a reference to the landing pad info for the
|
2007-02-21 22:38:31 +00:00
|
|
|
/// current function.
|
|
|
|
const std::vector<LandingPadInfo> &getLandingPads() const {
|
|
|
|
return LandingPads;
|
|
|
|
}
|
2010-01-28 01:45:32 +00:00
|
|
|
|
|
|
|
/// setCallSiteBeginLabel - Map the begin label for a call site
|
2010-03-14 01:41:15 +00:00
|
|
|
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site) {
|
2010-01-28 01:45:32 +00:00
|
|
|
CallSiteMap[BeginLabel] = Site;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// getCallSiteBeginLabel - Get the call site number for a begin label
|
2010-03-14 01:41:15 +00:00
|
|
|
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) {
|
2010-01-28 01:45:32 +00:00
|
|
|
assert(CallSiteMap.count(BeginLabel) &&
|
|
|
|
"Missing call site number for EH_LABEL!");
|
|
|
|
return CallSiteMap[BeginLabel];
|
|
|
|
}
|
|
|
|
|
|
|
|
/// setCurrentCallSite - Set the call site currently being processed.
|
|
|
|
void setCurrentCallSite(unsigned Site) { CurCallSite = Site; }
|
|
|
|
|
|
|
|
/// getCurrentCallSite - Get the call site currently being processed, if any.
|
|
|
|
/// return zero if none.
|
|
|
|
unsigned getCurrentCallSite(void) { return CurCallSite; }
|
|
|
|
|
2007-02-21 22:38:31 +00:00
|
|
|
/// getTypeInfos - Return a reference to the C++ typeinfo for the current
|
|
|
|
/// function.
|
2010-04-15 01:51:59 +00:00
|
|
|
const std::vector<const GlobalVariable *> &getTypeInfos() const {
|
2007-02-21 22:38:31 +00:00
|
|
|
return TypeInfos;
|
|
|
|
}
|
2007-06-02 16:53:42 +00:00
|
|
|
|
|
|
|
/// getFilterIds - Return a reference to the typeids encoding filters used in
|
|
|
|
/// the current function.
|
|
|
|
const std::vector<unsigned> &getFilterIds() const {
|
|
|
|
return FilterIds;
|
|
|
|
}
|
|
|
|
|
2007-02-21 22:38:31 +00:00
|
|
|
/// getPersonality - Return a personality function if available. The presence
|
|
|
|
/// of one is required to emit exception handling info.
|
2010-04-15 01:51:59 +00:00
|
|
|
const Function *getPersonality() const;
|
2006-01-26 20:21:46 +00:00
|
|
|
|
2010-04-02 19:42:39 +00:00
|
|
|
/// setVariableDbgInfo - Collect information used to emit debugging
|
|
|
|
/// information of a variable.
|
|
|
|
void setVariableDbgInfo(MDNode *N, unsigned Slot, DebugLoc Loc) {
|
|
|
|
VariableDbgInfo.push_back(std::make_pair(N, std::make_pair(Slot, Loc)));
|
2009-10-01 01:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VariableDbgInfoMapTy &getVariableDbgInfo() { return VariableDbgInfo; }
|
|
|
|
|
2007-01-26 21:38:26 +00:00
|
|
|
}; // End class MachineModuleInfo
|
2005-12-16 22:45:29 +00:00
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|