Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vaivaswatha
Copy link
Contributor

This PR adds two new functionality:

  1. get_gep_soruce_element_type: Takes as input a GEP instruction and returns the source element type.
  2. A try-conversion from InstructionValue to CallSite.

Related Issue

If the changes are acceptable (i.e., in the right direction), I'll create one and edit this description.

How This Has Been Tested

I've tested the change against LLVM-17, as "cargo test -F llvm17-0"

@TheDan64
Copy link
Owner

@vaivaswatha there are some test failures that need to be addressed

@TheDan64 TheDan64 self-requested a review June 19, 2024 21:59
@vaivaswatha vaivaswatha marked this pull request as draft June 20, 2024 03:27
@vaivaswatha vaivaswatha marked this pull request as draft June 20, 2024 03:27
@vaivaswatha
Copy link
Contributor Author

@TheDan64 I've fixed the build failures for other versions of LLVM. But there're still tests failing with segfaults that aren't related to my change. I'm not sure what's happening.

@vaivaswatha
Copy link
Contributor Author

@TheDan64 I've fixed the build failures for other versions of LLVM. But there're still tests failing with segfaults that aren't related to my change. I'm not sure what's happening.

btw, I've also added an is_const method for StructValue. The other Value types had this method already.

Would it be a good idea to also provide these methods (is_const, is_undef etc) for AnyValueEnum itself too?

@vaivaswatha vaivaswatha marked this pull request as ready for review June 24, 2024 04:36
@TheDan64 TheDan64 added this to the 0.5.0 milestone Jul 2, 2024
@TheDan64
Copy link
Owner

Hi @vaivaswatha, there are still some test failures that need to be addressed. It doesn't seem to compile even after the master branch changes have been fixed.

Would it be a good idea to also provide these methods (is_const, is_undef etc) for AnyValueEnum itself too?

If the method applies to all variants of the trait, without exception, I'd rather see it added to the AnyValue trait instead of the enum and then removed from the variant structs. That said, I'm not sure that would be correct here, maybe BasicValue?

@TheDan64 TheDan64 merged commit a8361b1 into TheDan64:master Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants