Skip to content

Commit

Permalink
silence clang warning for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja3047 committed Sep 22, 2022
1 parent 612aecf commit c737a8a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Decompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ Result<DecompilationResult, DecompilationError> Decompile(
std::vector<std::string> args{"-Wno-pointer-to-int-cast",
"-Wno-pointer-sign", "-target",
module->getTargetTriple()};
// Silence clang warning
// warning: unknown platform, assumming -mfloat-abi=soft
const auto& triple{llvm::Triple(module->getTargetTriple())};
if (triple.isARM()) {
args.push_back("-mfloat-abi=soft");
}
auto ast_unit{clang::tooling::buildASTFromCodeWithArgs("", args, "out.c")};
rellic::DecompilationContext dec_ctx(*ast_unit);
rellic::GenerateAST::run(*module, dec_ctx);
Expand Down Expand Up @@ -162,4 +168,4 @@ Result<DecompilationResult, DecompilationError> Decompile(
return Result<DecompilationResult, DecompilationError>(std::move(error));
}
}
} // namespace rellic
} // namespace rellic

0 comments on commit c737a8a

Please sign in to comment.