[llvm-dev] Built in progmem variables in AVR
Łukasz Kostka via llvm-dev
llvm-dev at lists.llvm.org
Wed Oct 9 07:16:29 PDT 2019
I was wondering if it is possible to implement placing RO variables within progmem sections. For now it is possible to just use [[gnu::progmem]] and read variables using assembly. My proposal is to:
Use those variables as any other, without creating assembly.
While reading them, compiler has all necessary knowledge where the variable is and can generate assembly
Possible future improvements:
Automatic placement of variables in __flash sections.
Take care of reading across 64KB boundary
If a variable is const, it can be places automatically in some __flash section
AVR devices are old, but still widely used. This feature could improve code quality even further.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev