question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

llvmlite, how resolve ConstantExpr?

See original GitHub issue

I have instruction like below. and i get it by ‘llvmlite.binding.parse_assembly’ and that instruction represented by llvmlite.binding.ValueRef

store i8* getelementptr inbounds (i8, i8* bitcast (i32 ()* @main to i8*), i64 107), i8** %1, align 8
# this print
# store i8* getelementptr inbounds (i8, i8* bitcast (i32 ()* @main to i8*), i64 107), i8** %1, align 8
print(instruction)

# Error Log ' raise ValueError('expected block value, got %s' % (self._kind,)) ' 
for operand in instruction.operands:
    operand.operands

There are any way to get ConstantExpr operands? or get from ll file?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gmarkallcommented, Nov 20, 2020

As a pointer for where to start looking, if you want to try to augment llvmlite to provide the information you’re looking for: the functionality for getting the functions, instructions, operands, etc. is implemented in ffi/value.cpp and llvmlite/binding/value.py (in the ValueRef class) - you could add additional functions that provide access to other LLVM functions (such as GetElementPtrInst.getPointerOperand for example, if that’s what you’re looking for) to these files by taking inspiration from the functions that already exist there.

llvmpy is very old and unsupported as far as I know - I would suggest that using it wouldn’t be easy or sustainable.

0reactions
dbwodlf3commented, Nov 20, 2020

Thanks kind programmers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation — llvmlite 0.40.0dev0-48-ged0f625-dirty ...
Numba is the compiler package, this depends on llvmlite. ... llvm-lto-static.patch : Fix issue with LTO shared library on Windows.
Read more >
llvm::ConstantExpr Class Reference
A constant value that is initialized with an expression using other constant values. This class uses the standard Instruction opcodes to define the...
Read more >
llvmlite Documentation - Read the Docs
These functions tell LLVM how to resolve external symbols referred from compiled LLVM code. • llvmlite.binding.add_symbol(name, address).
Read more >
目录 - Gitee
More strange since happens if LLVM (via llvmlite) is loaded after a fork. ... numba#2707: Fix regression: cuda test submodules not loading properly...
Read more >
llvmlite failed to install. Error building llvmlite - Stack Overflow
Go to here and download llvmlite package for your python version, e.g. llvmlite‑0.35.0‑cp39‑cp39‑win_amd64.whl for Python 3.9.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found