Skip to content

Commit

Permalink
Merge rust-lang#25
Browse files Browse the repository at this point in the history
25: Rename yk_control_point to yk_mt_control_point. r=vext01 a=ltratt



Co-authored-by: Laurence Tratt <[email protected]>
  • Loading branch information
bors[bot] and ltratt authored Mar 3, 2022
2 parents 0523c33 + 9742b3e commit 3b11c63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Transforms/Yk/ControlPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// The name of the "dummy function" that the user puts in their interpreter
// implementation and that we will replace with our own code.
#define YK_DUMMY_CONTROL_POINT "yk_control_point"
#define YK_DUMMY_CONTROL_POINT "yk_mt_control_point"

// The name of the new control point replacing the user's dummy control point.
#define YK_NEW_CONTROL_POINT "__ykrt_control_point"
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/TargetPassConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static cl::opt<bool> YkBlockDisambiguate(
static cl::opt<bool>
YkPatchCtrlPoint("yk-patch-control-point",
cl::init(false), cl::NotHidden,
cl::desc("Patch yk_control_point()"));
cl::desc("Patch yk_mt_control_point()"));

/// Allow standard passes to be disabled by command line options. This supports
/// simple binary flags that either suppress the pass or do nothing.
Expand Down
10 changes: 5 additions & 5 deletions llvm/lib/Transforms/Yk/ControlPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// YkLocation loc = ...;
// pc = 0;
// while (...) {
// yk_control_point(mt, loc); // <- dummy control point
// yk_mt_control_point(mt, loc); // <- dummy control point
// bc = program[pc];
// switch (bc) {
// // bytecode handlers here.
Expand Down Expand Up @@ -75,12 +75,12 @@ using namespace llvm;
/// could not be found.
/// YKFIXME: For now assumes there's only one control point.
CallInst *findControlPointCall(Module &M) {
// Find the declaration of `yk_control_point()`.
// Find the declaration of `yk_mt_control_point()`.
Function *CtrlPoint = M.getFunction(YK_DUMMY_CONTROL_POINT);
if (CtrlPoint == nullptr)
return nullptr;

// Find the call site of `yk_control_point()`.
// Find the call site of `yk_mt_control_point()`.
Value::user_iterator U = CtrlPoint->user_begin();
if (U == CtrlPoint->user_end())
return nullptr;
Expand Down Expand Up @@ -124,7 +124,7 @@ class YkControlPoint : public ModulePass {
CallInst *OldCtrlPointCall = findControlPointCall(M);
if (OldCtrlPointCall == nullptr) {
Context.emitError(
"ykllvm couldn't find the call to `yk_control_point()`");
"ykllvm couldn't find the call to `yk_mt_control_point()`");
return false;
}

Expand All @@ -138,7 +138,7 @@ class YkControlPoint : public ModulePass {
return L->contains(OldCtrlPointCall);
})) {
;
Context.emitError("yk_control_point() must be called inside a loop.");
Context.emitError("yk_mt_control_point() must be called inside a loop.");
return false;
}

Expand Down

0 comments on commit 3b11c63

Please sign in to comment.