-
Notifications
You must be signed in to change notification settings - Fork 43
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
Recover type information #190
Comments
So one problem I stumbled upon while working on this is the following: currently, all local declarations are at the top, and initialization follows. This is not valid in the case of const int a = 0; is valid, but const int a;
a = 0; is not |
Is there an opportunity here? For example, the I'm not sure how to guarantee that valid code is produced. For example, if the scoping ends up wrong, then that means we possibly already admitted undefined behaviour into the code (by having a read-before-write of |
int *a = /* ... */;
signed int *b = a; // OK!
unsigned int *c = a; // Warning
char *x = /* ... */;
signed char *y = x; // Warning
unsigned char *z = x; // Warning The issue is that debug info only either specify |
Perhaps from the triple and the data layout we can get whether or not char is signed on the platform? I know in LanguageOptions there's a way to force signed or unsigned char. |
According to https://llvm.org/docs/LangRef.html#langref-datalayout we do not have something to tell us whether At that point the only issue becomes deciding whether global strings (which do not have debug info attached, from a first glance) are |
Do you see |
Yes, |
Perhaps it's actually a sort of joke type for pointers. Perhaps if we know if it's meant to be a |
Currently, some type information (e.g.
const
,volatile
) regarding variables is lost.For example, this source code
roundtrips to:
It would be nice to recover the original type information when possible.
The text was updated successfully, but these errors were encountered: