From 4ee0217aee4041833a48c63bd8c29498648c77ca Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Mon, 9 Feb 2015 23:02:10 +0000 Subject: [PATCH] [Statepoint] Improve two asserts, fix some style (NFC) Summary: It's important that our users immediately know what gc.safepoint_poll is. Also fix the style of the declaration of CreateGCStatepoint, in preparation for another change that will wrap it. Reviewers: reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7517 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228626 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/IRBuilder.h | 6 +++--- lib/IR/IRBuilder.cpp | 8 ++++---- lib/Transforms/Scalar/PlaceSafepoints.cpp | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/llvm/IR/IRBuilder.h b/include/llvm/IR/IRBuilder.h index 1e019581045..31b04702395 100644 --- a/include/llvm/IR/IRBuilder.h +++ b/include/llvm/IR/IRBuilder.h @@ -442,9 +442,9 @@ public: /// \brief Create a call to the experimental.gc.statepoint intrinsic to /// start a new statepoint sequence. CallInst *CreateGCStatepoint(Value *ActualCallee, - ArrayRef CallArgs, - ArrayRef DeoptArgs, - ArrayRef GCArgs, + ArrayRef CallArgs, + ArrayRef DeoptArgs, + ArrayRef GCArgs, const Twine &Name = ""); /// \brief Create a call to the experimental.gc.result intrinsic to extract diff --git a/lib/IR/IRBuilder.cpp b/lib/IR/IRBuilder.cpp index dd29e7ae24f..194f01e26ae 100644 --- a/lib/IR/IRBuilder.cpp +++ b/lib/IR/IRBuilder.cpp @@ -231,10 +231,10 @@ CallInst *IRBuilderBase::CreateMaskedIntrinsic(unsigned Id, } CallInst *IRBuilderBase::CreateGCStatepoint(Value *ActualCallee, - ArrayRef CallArgs, - ArrayRef DeoptArgs, - ArrayRef GCArgs, - const Twine& Name) { + ArrayRef CallArgs, + ArrayRef DeoptArgs, + ArrayRef GCArgs, + const Twine &Name) { // Extract out the type of the callee. PointerType *FuncPtrType = cast(ActualCallee->getType()); assert(isa(FuncPtrType->getElementType()) && diff --git a/lib/Transforms/Scalar/PlaceSafepoints.cpp b/lib/Transforms/Scalar/PlaceSafepoints.cpp index 517c4c95aa7..7b10d543736 100644 --- a/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -741,7 +741,8 @@ InsertSafepointPoll(DominatorTree &DT, Instruction *term, // different type inserted previously Function *F = dyn_cast(M->getOrInsertFunction("gc.safepoint_poll", ftype)); - assert(F && !F->empty() && "definition must exist"); + assert(F && "void @gc.safepoint_poll() must be defined"); + assert(!F->empty() && "gc.safepoint_poll must be a non-empty function"); CallInst *poll = CallInst::Create(F, "", term); // Record some information about the call site we're replacing -- 2.34.1