From 2c3e0051c31c3f5b2328b447eadf1cf9c4427442 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Wed, 6 May 2015 11:46:36 -0700 Subject: Update aosp/master LLVM for rebase to r235153 Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987) --- include/llvm/CodeGen/MachineModuleInfo.h | 49 +++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 16 deletions(-) (limited to 'include/llvm/CodeGen/MachineModuleInfo.h') 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 BeginLabels; // Labels prior to invoke. - SmallVector EndLabels; // Labels after invoke. - SmallVector ClauseLabels; // Labels for each clause. - MCSymbol *LandingPadLabel; // Label at beginning of landing pad. - const Function *Personality; // Personality function. - std::vector TypeIds; // List of type ids (filters negative) + MachineBasicBlock *LandingPadBlock; // Landing pad block. + SmallVector BeginLabels; // Labels prior to invoke. + SmallVector EndLabels; // Labels after invoke. + SmallVector ClauseLabels; // Labels for each clause. + MCSymbol *LandingPadLabel; // Label at beginning of landing pad. + const Function *Personality; // Personality function. + std::vector 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 > SymbolListTy; protected: - static SymbolListTy GetSortedStubs(const DenseMap&); + + /// Return the entries from a DenseMap in a deterministic sorted orer. + /// Clears the map. + static SymbolListTy getSortedStubs(DenseMap&); }; //===----------------------------------------------------------------------===// @@ -172,16 +178,19 @@ class MachineModuleInfo : public ImmutablePass { EHPersonality PersonalityTypeCache; + DenseMap> 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 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); } -- cgit v1.1