[PATCH] Outline C++ exception handlers for MSVC targets.
Reid Kleckner
rnk at google.com
Tue Feb 3 14:44:11 PST 2015
Looks like a good incremental step to me.
I added David Majnemer to see if he has anything.
REPOSITORY
rL LLVM
================
Comment at: lib/CodeGen/WinEHPrepare.cpp:61-93
@@ -47,2 +60,35 @@
+
+class WinEHCatchDirector : public CloningDirector
+{
+public:
+ WinEHCatchDirector(LandingPadInst *LPI,
+ Function *CatchFn,
+ Value *Selector,
+ Value *EHObj) :
+ LPI(LPI),
+ CatchFn(CatchFn),
+ CurrentSelector(Selector->stripPointerCasts()),
+ EHObj(EHObj),
+ SelectorIDType(Type::getInt32Ty(LPI->getContext())),
+ Int8PtrType(Type::getInt8PtrTy(LPI->getContext())) {}
+ virtual ~WinEHCatchDirector() {}
+
+ CloningAction handleInstruction(ValueToValueMapTy &VMap,
+ const Instruction *Inst,
+ BasicBlock *NewBB) override;
+
+private:
+ LandingPadInst *LPI;
+ Function *CatchFn;
+ Value *CurrentSelector;
+ Value *EHObj;
+ Type *SelectorIDType;
+ Type *Int8PtrType;
+
+ const Value *ExtractedEHPtr;
+ const Value *ExtractedSelector;
+ const Value *EHPtrStoreAddr;
+ const Value *SelectorStoreAddr;
+ const Value *EHObjStoreAddr;
};
} // end anonymous namespace
----------------
I'd rather we went with a clang-format indentation here, as it's the dominant style across LLVM.
http://reviews.llvm.org/D7363
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list