Skip to content

Commit 8dc7a41

Browse files
bors[bot]ltratt
andauthored
75: Allow programs without a control point to be compiled. r=ptersilie a=ltratt Co-authored-by: Laurence Tratt <[email protected]>
2 parents 3517652 + 3e9fa7c commit 8dc7a41

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Transforms/Yk/ControlPoint.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "llvm/ADT/PostOrderIterator.h"
5151
#include "llvm/Analysis/LoopInfo.h"
5252
#include "llvm/IR/BasicBlock.h"
53+
#include "llvm/IR/DiagnosticInfo.h"
5354
#include "llvm/IR/Dominators.h"
5455
#include "llvm/IR/Function.h"
5556
#include "llvm/IR/IRBuilder.h"
@@ -104,12 +105,14 @@ class YkControlPoint : public ModulePass {
104105

105106
bool runOnModule(Module &M) override {
106107
LLVMContext &Context = M.getContext();
107-
108108
// Locate the "dummy" control point provided by the user.
109109
CallInst *OldCtrlPointCall = findControlPointCall(M);
110110
if (OldCtrlPointCall == nullptr) {
111-
Context.emitError(
112-
"ykllvm couldn't find the call to `yk_mt_control_point()`");
111+
// This program doesn't have a control point. We can't do any
112+
// transformations on it, but we do still want to compile it.
113+
Context.diagnose(DiagnosticInfoInlineAsm(
114+
"ykllvm couldn't find the call to `yk_mt_control_point()`",
115+
DS_Warning));
113116
return false;
114117
}
115118

0 commit comments

Comments
 (0)