Closed tomtomjhj closed 3 years ago
Good question. Let me elaborate:
You have to use Llvm.type_of
only for alloca
. For all the other cases, you should not trust the output of LLVM.type_of
because the dummy front end does not perform type check.
what about function parameters?
2020년 11월 25일 (수) 오후 6:02, Kihong Heo notifications@github.com님이 작성:
Good question. Let me elaborate:
You have to use Llvm.type_of only for alloca. For all the other cases, you should not trust the output of LLVM.type_of because the dummy front end does not perform type check.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/prosyslab-classroom/is893-2020-fall/issues/51#issuecomment-733566758, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUWHSUKVP4DRPNLQKKSGADSRTBYZANCNFSM4UCC2YUA .
You should infer the parameter types.
Only alloca
is trusted.
I guess
Typesystem.type_of_llvalue
is for getting the type variable of a variable. But what's the point of type variable when we have access toLlvm.type_of
? I believe the homework assumes that the output ofLlvm.type_of
is trusted because it's necessary for passing the given test which requires declaring the correct type ofalloca
instruction usingLlvm.type_of
(ID 11
andID 12
of the expected output). IfLlvm.type_of
can be trusted as the source of type info of variables, I think all the stuff related totype_env
is unnecessary.