-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[ORC] Add Value support for capturing runtime JITed code results in clang-repl. #145263
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: main
Are you sure you want to change the base?
Conversation
#define BUILTIN_TYPES \ | ||
X(bool, Bool) \ | ||
X(char, Char_S) \ | ||
X(int8_t, SChar) \ | ||
X(uint8_t, Char_U) \ | ||
X(uint8_t, UChar) \ | ||
X(int16_t, Short) \ | ||
X(uint16_t, UShort) \ | ||
X(int32_t, Int) \ | ||
X(uint32_t, UInt) \ | ||
X(int64_t, LongLong) \ | ||
X(uint64_t, ULongLong) \ | ||
// X(long, Long) \ | ||
// X(unsigned long, ULong) \ | ||
// X(float, Float) \ | ||
// X(double, Double) \ | ||
// X(long double, LongDouble) |
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.
Is the idea here to define as many types as possible while remaining agnostic to the major data models?
Should Value
just work in terms of raw sizes / signedness ([u]int8, [u]int16, ..., [u]int64) and then the compiler can map those into whatever data model it's using?
(I'm imagining the case where clang-repl
might be used to inject code into some tiny microcontroller where the data model might be incompatible with the above)
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’m using fixed-size types so they work across all platforms. In setValue
, I cast long
and long long
to fixed sizes based on whether they’re 4 or 8 bytes—but I’m not sure that’ll work correctly on microcontrollers with different type sizes.
if (!SPSArgList<SPSExecutorAddr>::serialize(OB, V.getOpaqueType())) | ||
return false; |
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.
Are we passing around references to an opaque type class here? This type would only exist in the controller, right? Not the executor?
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.
Yes, but usually the Value class just stores the type and raw data together, which is why we only keep the address — even though I was thinking of tracking the type info on the controller side.
Adds a
Value
class to support capturing the results of JIT-compiled expressions in clang-repl. This allows runtime values to be stored and passed through the ORC executor.