prosyslab-classroom / cs348-information-security

61 stars 10 forks source link

[Question][Hw5] eval x #180

Closed ee12ha0220 closed 3 years ago

ee12ha0220 commented 3 years ago

In the semantics, evalx#(m#) = m#(x).

I thought that x was things like %a in the llvm IR, and we can find it by using is_argument in utils.ml. But I found out that is_argument could not find llvalues in the shape of %a.

So I want to ask 1) How does x looks like in llvm IR? 2) What values will make 'is_argument' true?

RiceBiscuits commented 3 years ago
  1. please see this document (https://github.com/prosyslab-classroom/llvm-primer/blob/master/data-structure.md)

  2. I don't know what you are actually doing, but please refer to the definition of the type argument.

    This class represents an incoming formal argument to a Function.

    A formal argument, since it is `‘formal’', does not contain an actual value but instead represents the type, argument number, and attributes of an argument for a specific function. When used in the body of said function, the argument of course represents the value of the actual argument that the function was called with. (ref: https://llvm.org/doxygen/classllvm_1_1Argument.html)

ee12ha0220 commented 3 years ago

So in implementing eval e mem, I want to know if e is x(in evalx#(m#) = m#(x)) or not. I thought using is_argument will verify this, but it doesn't. So how should I do this?

RiceBiscuits commented 3 years ago

Please read the document I mentioned in the previous comment.

ee12ha0220 commented 3 years ago

I still can't quite get it, but I will read the materials again. Thank you for your time!