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

Skip to content

Conversation

@tfzee
Copy link
Contributor

@tfzee tfzee commented Dec 23, 2023

Adding the 3 Functions and the corresponding tests.

Description

Related Issue

#454

How This Has Been Tested

Only tested on LLVM-16

Checklist


// SubTypes: Only apply to alloca instruction
/// Returns the type that is allocated by the alloca instruction.
pub fn get_allocated_type(self) -> Result<AnyTypeEnum<'ctx>, &'static str> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this only be a BasicTypeEnum? I would imagine AnyType has types that cannot be allocated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah that's correct! I incorrectly assumed it would be the same return type as get_type.

Copy link
Owner

@TheDan64 TheDan64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TheDan64 TheDan64 merged commit 0b2cde9 into TheDan64:master Dec 26, 2023
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.

Adding get_allocated_type, is_terminator and is_conditional to InstructionValue

2 participants