-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IR] Introduce the ptrtoaddr
instruction
#139357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: users/arichardson/spr/main.ir-introduce-the-ptrtoaddr-instruction
Are you sure you want to change the base?
Changes from all commits
73bc383
25dc175
71f9b4d
9772b51
61c5c2a
f5c65e8
769e4dd
638cb3a
f7b19f2
395a0d1
e2471cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4274,6 +4274,7 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { | |
case lltok::kw_bitcast: | ||
case lltok::kw_addrspacecast: | ||
case lltok::kw_inttoptr: | ||
// ptrtoaddr not supported in constant exprs (yet?). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's something that is needed, we support that on CHERI There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (i.e. it's a TODO if not implemented here, not a question of whether it should be supported, IMO) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't 100% certain we would need it since we could use a truncating How about a simple |
||
case lltok::kw_ptrtoint: { | ||
unsigned Opc = Lex.getUIntVal(); | ||
Type *DestTy = nullptr; | ||
|
@@ -7236,6 +7237,7 @@ int LLParser::parseInstruction(Instruction *&Inst, BasicBlock *BB, | |
case lltok::kw_fptoui: | ||
case lltok::kw_fptosi: | ||
case lltok::kw_inttoptr: | ||
case lltok::kw_ptrtoaddr: | ||
case lltok::kw_ptrtoint: | ||
return parseCast(Inst, PFS, KeywordVal); | ||
case lltok::kw_fptrunc: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be less confusing to keep these sorted by enum values but I see that's been broken for the last few new instructions (or maybe just freeze?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fneg and callbr also break the ordering - I think the intention in this file is to have them match the grouping in Instruction