Skip to content

Commit

Permalink
Pallas: Skip memory-lifetime intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertMensing committed Feb 24, 2025
1 parent c3c95bc commit 7e939fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/llvm/lib/Passes/Function/FunctionBodyTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ FunctionBodyTransformerPass::run(Function &F, FunctionAnalysisManager &FAM) {
// (As it uses currently unsupported instructions). We generate an
// requires false; - contract instead.
if (F.getName().str() == constants::SWIFT_FATAL_ERROR) {
ErrorReporter::addWarning(
SOURCE_LOC, "Skipping body of swift fatalError", F);
ErrorReporter::addWarning(SOURCE_LOC,
"Skipping body of swift fatalError", F);
return PreservedAnalyses::all();
}

Expand Down
6 changes: 3 additions & 3 deletions src/llvm/lib/Passes/Function/FunctionContractDeclarer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ FunctionContractDeclarerPass::run(Function &F, FunctionAnalysisManager &FAM) {
colContract->set_allocated_blame(new col::Blame());
colContract->set_name(F.getName());

// Add a "requires false"-contract to Swift's fatalError-function
// Add a "requires false"-contract to Swift's fatalError-function
// (Since we currently do not support all instructions that it uses).
if (F.getName().str() == constants::SWIFT_FATAL_ERROR) {
ErrorReporter::addWarning(
SOURCE_LOC, "Generating contract forswift fatalError", F);
ErrorReporter::addWarning(SOURCE_LOC,
"Generating contract forswift fatalError", F);
colContract->set_value("requires false;");
colContract->set_allocated_origin(
llvm2col::generateFunctionContractOrigin(F, "requires false;"));
Expand Down
4 changes: 4 additions & 0 deletions src/llvm/lib/Transform/Instruction/IntrinsicsTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ void llvm2col::transformIntrinsic(llvm::CallInst &callInstruction,
case llvm::Intrinsic::dbg_assign:
// Ignore debug-intrinsics
break;
case llvm::Intrinsic::lifetime_start:
case llvm::Intrinsic::lifetime_end:
// Ignore lifetime intrinsics
break;
default:
reportUnsupportedOperatorError(SOURCE_LOC, callInstruction);
}
Expand Down

0 comments on commit 7e939fb

Please sign in to comment.