diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2014-12-29 11:51:25 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2014-12-29 11:51:25 +0100 |
commit | 10120fe4d9980139e44012888a91716df2edf2e0 (patch) | |
tree | f7348c43fb2c3aca61397b352761394ba17f87f4 | |
parent | c8287e6578f313769c794fd407868b1ecb51c43f (diff) | |
download | compcert-10120fe4d9980139e44012888a91716df2edf2e0.tar.gz compcert-10120fe4d9980139e44012888a91716df2edf2e0.zip |
Support "asm volatile" (closes: PR#5).
The CompCert back-end already treats "asm" inserts as "volatile" in GCC's sense (performing unpredictable side-effects), so no change is required outside of the parser.
-rw-r--r-- | cparser/Parser.vy | 2 | ||||
-rw-r--r-- | cparser/pre_parser.mly | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/cparser/Parser.vy b/cparser/Parser.vy index ce1beae0..a058a8d1 100644 --- a/cparser/Parser.vy +++ b/cparser/Parser.vy @@ -822,6 +822,8 @@ jump_statement: asm_statement: | loc = ASM LPAREN template = STRING_LITERAL RPAREN SEMICOLON { let '(wide, chars, _) := template in ASM wide chars loc } +| loc = ASM VOLATILE LPAREN template = STRING_LITERAL RPAREN SEMICOLON + { let '(wide, chars, _) := template in ASM wide chars loc } (* 6.9 *) translation_unit_file: diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly index 4755518b..ef356d3a 100644 --- a/cparser/pre_parser.mly +++ b/cparser/pre_parser.mly @@ -616,7 +616,7 @@ jump_statement: {} asm_statement: -| ASM LPAREN string_literals_list RPAREN SEMICOLON +| ASM VOLATILE? LPAREN string_literals_list RPAREN SEMICOLON {} translation_unit_file: |