Code Monkey home page Code Monkey logo

Comments (3)

pgoodman avatar pgoodman commented on July 22, 2024

It's possible that rellic doesn't properly understand inline assembly. Those are implemented via function calls in clang.

from rellic.

aytey avatar aytey commented on July 22, 2024

So the line where code hits the assertion is in the process of trying to handle the asm block, but it just falls over:

if (auto iasm = llvm::dyn_cast<llvm::InlineAsm>(&opnd)) {
// TODO(frabert): We still need to find a way to embed the inline asm
// into the function
auto &decl{dec_ctx.value_decls[iasm]};
if (decl) {
return;
}
auto tudecl{dec_ctx.ast_ctx.getTranslationUnitDecl()};
auto name{"asm_" +
std::to_string(GetNumDecls<clang::FunctionDecl>(tudecl))};
auto ftype{iasm->getFunctionType()};
auto type{dec_ctx.GetQualType(ftype)};
decl = ast.CreateFunctionDecl(tudecl, type, name);
std::vector<clang::ParmVarDecl *> iasm_params;
for (auto arg : ftype->params()) {
auto arg_type{dec_ctx.GetQualType(arg)};
auto name{"arg_" + std::to_string(iasm_params.size())};
iasm_params.push_back(
ast.CreateParamDecl(decl->getDeclContext(), arg_type, name));
}
auto fdecl{decl->getAsFunction()};
fdecl->setParams(params);

from rellic.

pgoodman avatar pgoodman commented on July 22, 2024

Inline asm is tricky because Clang does some kind of translation of it into an internal LLVM-specific assembly dialect.

from rellic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.