diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2015-05-06 11:46:36 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2015-05-18 10:52:30 -0700 |
commit | 2c3e0051c31c3f5b2328b447eadf1cf9c4427442 (patch) | |
tree | c0104029af14e9f47c2ef58ca60e6137691f3c9b /include/llvm/CodeGen/MachineModuleInfo.h | |
parent | e1bc145815f4334641be19f1c45ecf85d25b6e5a (diff) | |
download | external_llvm-2c3e0051c31c3f5b2328b447eadf1cf9c4427442.zip external_llvm-2c3e0051c31c3f5b2328b447eadf1cf9c4427442.tar.gz external_llvm-2c3e0051c31c3f5b2328b447eadf1cf9c4427442.tar.bz2 |
Update aosp/master LLVM for rebase to r235153
Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7
(cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987)
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index f171df2..3965b1d 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -58,22 +58,25 @@ class MachineFunction; class Module; class PointerType; class StructType; +struct WinEHFuncInfo; //===----------------------------------------------------------------------===// /// LandingPadInfo - This structure is used to retain landing pad info for /// the current function. /// struct LandingPadInfo { - MachineBasicBlock *LandingPadBlock; // Landing pad block. - SmallVector<MCSymbol*, 1> BeginLabels; // Labels prior to invoke. - SmallVector<MCSymbol*, 1> EndLabels; // Labels after invoke. - SmallVector<MCSymbol*, 1> ClauseLabels; // Labels for each clause. - MCSymbol *LandingPadLabel; // Label at beginning of landing pad. - const Function *Personality; // Personality function. - std::vector<int> TypeIds; // List of type ids (filters negative) + MachineBasicBlock *LandingPadBlock; // Landing pad block. + SmallVector<MCSymbol *, 1> BeginLabels; // Labels prior to invoke. + SmallVector<MCSymbol *, 1> EndLabels; // Labels after invoke. + SmallVector<MCSymbol *, 1> ClauseLabels; // Labels for each clause. + MCSymbol *LandingPadLabel; // Label at beginning of landing pad. + const Function *Personality; // Personality function. + std::vector<int> TypeIds; // List of type ids (filters negative). + int WinEHState; // WinEH specific state number. explicit LandingPadInfo(MachineBasicBlock *MBB) - : LandingPadBlock(MBB), LandingPadLabel(nullptr), Personality(nullptr) {} + : LandingPadBlock(MBB), LandingPadLabel(nullptr), Personality(nullptr), + WinEHState(-1) {} }; //===----------------------------------------------------------------------===// @@ -88,7 +91,10 @@ public: virtual ~MachineModuleInfoImpl(); typedef std::vector<std::pair<MCSymbol*, StubValueTy> > SymbolListTy; protected: - static SymbolListTy GetSortedStubs(const DenseMap<MCSymbol*, StubValueTy>&); + + /// Return the entries from a DenseMap in a deterministic sorted orer. + /// Clears the map. + static SymbolListTy getSortedStubs(DenseMap<MCSymbol*, StubValueTy>&); }; //===----------------------------------------------------------------------===// @@ -172,16 +178,19 @@ class MachineModuleInfo : public ImmutablePass { EHPersonality PersonalityTypeCache; + DenseMap<const Function *, std::unique_ptr<WinEHFuncInfo>> FuncInfoMap; + public: static char ID; // Pass identification, replacement for typeid struct VariableDbgInfo { - TrackingMDNodeRef Var; - TrackingMDNodeRef Expr; + const MDLocalVariable *Var; + const MDExpression *Expr; unsigned Slot; - DebugLoc Loc; + const MDLocation *Loc; - VariableDbgInfo(MDNode *Var, MDNode *Expr, unsigned Slot, DebugLoc Loc) + VariableDbgInfo(const MDLocalVariable *Var, const MDExpression *Expr, + unsigned Slot, const MDLocation *Loc) : Var(Var), Expr(Expr), Slot(Slot), Loc(Loc) {} }; typedef SmallVector<VariableDbgInfo, 4> VariableDbgInfoMapTy; @@ -191,7 +200,7 @@ public: // Real constructor. MachineModuleInfo(const MCAsmInfo &MAI, const MCRegisterInfo &MRI, const MCObjectFileInfo *MOFI); - ~MachineModuleInfo(); + ~MachineModuleInfo() override; // Initialization and Finalization bool doInitialization(Module &) override; @@ -207,6 +216,12 @@ public: void setModule(const Module *M) { TheModule = M; } const Module *getModule() const { return TheModule; } + const Function *getWinEHParent(const Function *F) const; + WinEHFuncInfo &getWinEHFuncInfo(const Function *F); + bool hasWinEHFuncInfo(const Function *F) const { + return FuncInfoMap.count(getWinEHParent(F)) > 0; + } + /// getInfo - Keep track of various per-function pieces of information for /// backends that would like to do so. /// @@ -304,6 +319,8 @@ public: void addPersonality(MachineBasicBlock *LandingPad, const Function *Personality); + void addWinEHState(MachineBasicBlock *LandingPad, int State); + /// getPersonalityIndex - Get index of the current personality function inside /// Personalitites array unsigned getPersonalityIndex() const; @@ -421,8 +438,8 @@ public: /// setVariableDbgInfo - Collect information used to emit debugging /// information of a variable. - void setVariableDbgInfo(MDNode *Var, MDNode *Expr, unsigned Slot, - DebugLoc Loc) { + void setVariableDbgInfo(const MDLocalVariable *Var, const MDExpression *Expr, + unsigned Slot, const MDLocation *Loc) { VariableDbgInfos.emplace_back(Var, Expr, Slot, Loc); } |