Conversation
| std::vector<Token *> GenericInstModel::extractPHINodeToken(llvm::Instruction *Inst){ | ||
| std::vector<Token *> TokenVec; | ||
| TokenVec.push_back(this->getTokenWrapper()->getToken(Inst)); | ||
| if(Inst->getOperand(0)->hasName()){ |
There was a problem hiding this comment.
Do not use hasName; I think you are using hasName to check if it a variable or a constant? if yes, prefer checking if it is ConstantInt, like we did in the StoreInst.
There was a problem hiding this comment.
I have done this with the help of llvm::Constant
There was a problem hiding this comment.
Yes, that will be great. Though, hasName will also work fine but it will add an explicit dependency to run instnamer or something instnamer like to get it working.
| else{ | ||
| TokenVec.push_back(this->getTokenWrapper()->getToken(ValOp)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Can this be written as:
if (!llvm::isa<llvm::ConstantInt>(ValOp)) return TokenVec;
if (llvm::isa<llvm::ConstantPointerNull>(ValOp))
TokenVec.push_back(this->getTokenWrapper()->getToken("NULL",nullptr));
else
TokenVec.push_back(this->getTokenWrapper()->getToken(ValOp));There was a problem hiding this comment.
I think you are trying to say
if (llvm::isa<llvm::ConstantInt>(ValOp)) return TokenVec;
if (llvm::isa<llvm::ConstantPointerNull>(ValOp))
TokenVec.push_back(this->getTokenWrapper()->getToken("NULL",nullptr));
else
TokenVec.push_back(this->getTokenWrapper()->getToken(ValOp));And if it is then I have done this. Can I do this more general way like instead of using llvm::ConstantInt that can use only for integer constant we can use llvm::Constant which is more general way to say constant because constant can be float or double also.
There was a problem hiding this comment.
I just realized that there can be other places where ConstantInt is used and it will fail with floats and doubles (thanks for pointing that out). Can you please create a github issue for that?
.gitignore
Outdated
| build/ No newline at end of file | ||
| build/ | ||
| .vscode/ | ||
| .github/ No newline at end of file |
There was a problem hiding this comment.
.github has some action config and can not be put inside .gitignore.
Why do you need to add your gitignore to the PR?
There was a problem hiding this comment.
I will remove .vscode and .github but at the time of pushing code my build folder is also pushing to remove my build folder I put it in .gitignore.
There was a problem hiding this comment.
How do you add files to commit? Do you do git add . or git commit -m, is yes, then try only adding the files that you want to be present in the commit.
For example, if you only want files inside lib and include to be in the commit then do git add lib/ include/
There was a problem hiding this comment.
I have removed .gitignore
reSHARMA
left a comment
There was a problem hiding this comment.
This PR had changes for ReplaceIRVar, null token, and Phi node. Added some inline comments.
No description provided.