mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-05 02:07:22 +00:00
If 'volatile' is used within a function, only reduce optimization for that function.
Previously, several optimizations would be disabled for the rest of the translation unit whenever the keyword 'volatile' appeared. Now, if 'volatile' is used within a function, it only reduces optimization for that function, since whatever was declared as 'volatile' will be out of scope after the function is over. Uses of 'volatile' outside functions still behave as before.
This commit is contained in:
parent
1502e48188
commit
5969d80e57
@ -154,6 +154,7 @@ var
|
||||
returnLabel: integer; {label for exit point}
|
||||
skipDeclarator: boolean; {for enum,struct,union with no declarator}
|
||||
statementList: statementPtr; {list of open statements}
|
||||
savedVolatile: boolean; {saved copy of volatile}
|
||||
|
||||
{parameter processing variables}
|
||||
{------------------------------}
|
||||
@ -330,6 +331,7 @@ if not doingFunction then begin {if so, finish it off}
|
||||
end; {while}
|
||||
dumpLocal := true; {dump the local pool}
|
||||
nameFound := false; {no pc_nam for the next function (yet)}
|
||||
volatile := savedVolatile; {local volatile vars are out of scope}
|
||||
end; {if}
|
||||
PopTable; {remove this symbol table}
|
||||
dispose(stPtr); {dump the record}
|
||||
@ -3529,6 +3531,7 @@ if isFunction then begin
|
||||
GenParameters(nil)
|
||||
else
|
||||
GenParameters(fnType^.parameterList);
|
||||
savedVolatile := volatile;
|
||||
CompoundStatement(false); {process the statements}
|
||||
end; {else}
|
||||
end; {else}
|
||||
|
Loading…
Reference in New Issue
Block a user