[Question][Hw7] Function Return type and return value type #370
-
|
When I type-check, I think I need to check "return type of current function" and "type of value which will be returned". However, when I use below function and compile it, compiler add type-casting in .ll file automatically. Therefore, I modify .ll file manually but parser throws below exception. Because parser throws exception for this case, we don't need to consider such case? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
We will not modify any .ll files. You don't need to care about that. This was my misunderstanding. The |
Beta Was this translation helpful? Give feedback.
-
|
However, when I remove test/example1.ll and recompile (by command Also, new example1.ll seems there is no type error. In #51, ShinWonho also said that example1.ll is slightly different from example1.c. Could you check this? Then, could you give an example .c file that causes type error after compile? I made some .c files, but all of them don't cause type error after compile because compiler automatically add type-casting. This is why I modified .ll file manually. |
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry to @KAIST-JongchanPark and everyone who saw this post. The |
Beta Was this translation helpful? Give feedback.
I'm sorry to @KAIST-JongchanPark and everyone who saw this post. The
example1.llfile is modified manually to cause type error. I delivered the wrong information in the first answer.