[PATCH] D45284: [RISCV] More validations on the input value of -march=

Ana Pazos via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 20 18:20:35 PDT 2018


apazos added a comment.

Hi Alex, it seems the table expects these extensions in a canonical order too: all x extensions, followed by all s extensions, and then all sx extensions.

I can make the change, no problem. I have also coded other error situations described below.

But f I cannot push a test we can enable, because we error out when we find the first non-supported extension in the string with unsupported extension message, and stop parsing the string.

Any suggestion?

Examples:

clang -target riscv32-unknown-elf -march=rv32ixabc_ -### 
 extension name missing after separator '_'

clang -target riscv32-unknown-elf -march=rv32ixabc_a  -###
invalid extension prefix 'a'

clang -target riscv32-unknown-elf -march=rv32isabc_xdef -###
non-standard user-level extension not given in canonical order 'xdef'

clang -target riscv32-unknown-elf -march=rv32isxabc_sdef -### 
standard supervisor-level extension not given in canonical order 'sdef'

clang -target riscv32-unknown-elf -march=rv32ixabc_xabc -### 
duplicated non-standard user-level extension 'xabc'

clang -target riscv32-unknown-elf -march=rv32ixabc_xdef -###
no parsing error, should be accepted if xabc and xdef are valid extensions

clang -target riscv32-unknown-elf -march=rv32ixabc_sdef_sxghi -### 
no parsing error, should be accepted if xabc sdef sxghi are valid extensions


https://reviews.llvm.org/D45284





More information about the cfe-commits mailing list