[PATCH] D17580: Extract the method to begin and end a fragment in AsmPrinterHandler in their own method. NFC
David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 09:24:06 PST 2016
davidxl added inline comments.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:46
@@ -45,4 +45,3 @@
void DwarfCFIExceptionBase::markFunctionEnd() {
- if (shouldEmitCFI)
- Asm->OutStreamer->EmitCFIEndProc();
+ endFragment();
----------------
If this is the final override, you can probably call it with
DwarfCFIExeptionBase::endFragment();
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:88
@@ -88,1 +87,3 @@
+static MCSymbol *getRegularExceptionSym(AsmPrinter *Asm) {
+ return Asm->getCurExceptionSym();
----------------
nit: remove Regular
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:136
@@ +135,3 @@
+
+/// endFunction - Gather and emit post-function exception information.
+///
----------------
unnecessary code movement -- move endFunction down after endFragment
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:158
@@ +157,3 @@
+ auto *P = dyn_cast<Function>(F->getPersonalityFn()->stripPointerCasts());
+ assert(P && "Expected personality function");
+
----------------
Move this assertion up and make it assert (F->hasPersonalityFn() && "Expect ... ");
================
Comment at: lib/CodeGen/AsmPrinter/DwarfException.h:67
@@ +66,3 @@
+
+ void beginFragment(const MachineBasicBlock *MBB,
+ ExceptionSymbolProvider ESP) override;
----------------
Should this and the end function be declared in DwarfCFIExceptionBase? Note that there are two overrider classes to the Base class.
http://reviews.llvm.org/D17580
More information about the llvm-commits
mailing list