diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp b/contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp index 771d881eaf..5342455668 100644 --- a/contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp +++ b/contrib/libs/llvm12/lib/CodeGen/WasmEHPrepare.cpp @@ -23,7 +23,7 @@ // // - After: // catchpad ... -// exn = wasm.catch(WebAssembly::CPP_EXCEPTION); +// exn = wasm.catch(WebAssembly::CPP_EXCEPTION); // // Only add below in case it's not a single catch (...) // wasm.landingpad.index(index); // __wasm_lpad_context.lpad_index = index; @@ -112,7 +112,7 @@ class WasmEHPrepare : public FunctionPass { Function *LPadIndexF = nullptr; // wasm.landingpad.index() intrinsic Function *LSDAF = nullptr; // wasm.lsda() intrinsic Function *GetExnF = nullptr; // wasm.get.exception() intrinsic - Function *CatchF = nullptr; // wasm.catch() intrinsic + Function *CatchF = nullptr; // wasm.catch() intrinsic Function *GetSelectorF = nullptr; // wasm.get.ehselector() intrinsic FunctionCallee CallPersonalityF = nullptr; // _Unwind_CallPersonality() wrapper @@ -168,7 +168,7 @@ static void eraseDeadBBsAndChildren(const Container &BBs, DomTreeUpdater *DTU) { SmallVector<BasicBlock *, 8> WL(BBs.begin(), BBs.end()); while (!WL.empty()) { auto *BB = WL.pop_back_val(); - if (!pred_empty(BB)) + if (!pred_empty(BB)) continue; WL.append(succ_begin(BB), succ_end(BB)); DeleteDeadBlock(BB, DTU); @@ -204,7 +204,7 @@ bool WasmEHPrepare::prepareThrows(Function &F) { continue; Changed = true; auto *BB = ThrowI->getParent(); - SmallVector<BasicBlock *, 4> Succs(successors(BB)); + SmallVector<BasicBlock *, 4> Succs(successors(BB)); auto &InstList = BB->getInstList(); InstList.erase(std::next(BasicBlock::iterator(ThrowI)), InstList.end()); IRB.SetInsertPoint(BB); @@ -327,9 +327,9 @@ void WasmEHPrepare::setupEHPadFunctions(Function &F) { GetExnF = Intrinsic::getDeclaration(&M, Intrinsic::wasm_get_exception); GetSelectorF = Intrinsic::getDeclaration(&M, Intrinsic::wasm_get_ehselector); - // wasm.catch() will be lowered down to wasm 'catch' instruction in - // instruction selection. - CatchF = Intrinsic::getDeclaration(&M, Intrinsic::wasm_catch); + // wasm.catch() will be lowered down to wasm 'catch' instruction in + // instruction selection. + CatchF = Intrinsic::getDeclaration(&M, Intrinsic::wasm_catch); // _Unwind_CallPersonality() wrapper function, which calls the personality CallPersonalityF = M.getOrInsertFunction( @@ -369,13 +369,13 @@ void WasmEHPrepare::prepareEHPad(BasicBlock *BB, bool NeedPersonality, return; } - // Replace wasm.get.exception intrinsic with wasm.catch intrinsic, which will - // be lowered to wasm 'catch' instruction. We do this mainly because - // instruction selection cannot handle wasm.get.exception intrinsic's token - // argument. - Instruction *CatchCI = - IRB.CreateCall(CatchF, {IRB.getInt32(WebAssembly::CPP_EXCEPTION)}, "exn"); - GetExnCI->replaceAllUsesWith(CatchCI); + // Replace wasm.get.exception intrinsic with wasm.catch intrinsic, which will + // be lowered to wasm 'catch' instruction. We do this mainly because + // instruction selection cannot handle wasm.get.exception intrinsic's token + // argument. + Instruction *CatchCI = + IRB.CreateCall(CatchF, {IRB.getInt32(WebAssembly::CPP_EXCEPTION)}, "exn"); + GetExnCI->replaceAllUsesWith(CatchCI); GetExnCI->eraseFromParent(); // In case it is a catchpad with single catch (...) or a cleanuppad, we don't @@ -388,7 +388,7 @@ void WasmEHPrepare::prepareEHPad(BasicBlock *BB, bool NeedPersonality, } return; } - IRB.SetInsertPoint(CatchCI->getNextNode()); + IRB.SetInsertPoint(CatchCI->getNextNode()); // This is to create a map of <landingpad EH label, landingpad index> in // SelectionDAGISel, which is to be used in EHStreamer to emit LSDA tables. @@ -404,7 +404,7 @@ void WasmEHPrepare::prepareEHPad(BasicBlock *BB, bool NeedPersonality, IRB.CreateStore(IRB.CreateCall(LSDAF), LSDAField); // Pseudocode: _Unwind_CallPersonality(exn); - CallInst *PersCI = IRB.CreateCall(CallPersonalityF, CatchCI, + CallInst *PersCI = IRB.CreateCall(CallPersonalityF, CatchCI, OperandBundleDef("funclet", CPI)); PersCI->setDoesNotThrow(); |