[PATCH] Enable invoking the patchpoint intrinsic
Juergen Ributzka
juergen at apple.com
Wed Oct 8 22:37:13 PDT 2014
Just a few coding style nitpicks inline.
I will take a closer look tomorrow and also run it through our test suite to see if there any regressions.
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2018-2020
@@ -2017,7 +2017,5 @@
const Function *Fn = dyn_cast<Function>(Callee);
- if (isa<InlineAsm>(Callee))
+ if (isa<InlineAsm>(Callee)) {
visitInlineAsm(&I);
- else if (Fn && Fn->isIntrinsic()) {
- assert(Fn->getIntrinsicID() == Intrinsic::donothing);
- // Ignore invokes to @llvm.donothing: jump directly to the next BB.
- } else
+ } else if (Fn && Fn->isIntrinsic()) {
+ switch (Fn->getIntrinsicID()) {
----------------
We usually don't use brackets for single-statement bodies
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2021-2030
@@ +2020,12 @@
+ } else if (Fn && Fn->isIntrinsic()) {
+ switch (Fn->getIntrinsicID()) {
+ default:
+ llvm_unreachable("Cannot invoke this intrinsic");
+ case Intrinsic::donothing:
+ // Ignore invokes to @llvm.donothing: jump directly to the next BB.
+ break;
+ case Intrinsic::experimental_patchpoint_void:
+ case Intrinsic::experimental_patchpoint_i64:
+ visitPatchpoint(ImmutableCallSite(&I), LandingPad);
+ break;
+ }
----------------
The switch statement and its cases have the same indentation.
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2032-2034
@@ -2024,2 +2031,5 @@
+ }
+ } else {
LowerCallTo(&I, getValue(Callee), false, LandingPad);
+ }
----------------
ditto
http://reviews.llvm.org/D5634
More information about the llvm-commits
mailing list