diff options
author | Piyou Chen <piyou.chen@sifive.com> | 2024-10-21 16:10:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-21 16:10:22 +0800 |
commit | c77e836123d056d98051ee980003593706f9284d (patch) | |
tree | 4233374485f0682501750428803055f36b40ca6e /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | ba5676cf91f91bbddfacae06c036cf79af0f2088 (diff) | |
download | llvm-c77e836123d056d98051ee980003593706f9284d.zip llvm-c77e836123d056d98051ee980003593706f9284d.tar.gz llvm-c77e836123d056d98051ee980003593706f9284d.tar.bz2 |
[RISCV][FMV] Remove support for negative priority (#112161)
Ensure that target_version and target_clones do not accept negative
numbers for the priority feature.
Base on discussion on
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 2306043..465dc8c 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2904,19 +2904,18 @@ void CodeGenFunction::EmitMultiVersionResolver( } } -static int getPriorityFromAttrString(StringRef AttrStr) { +static unsigned getPriorityFromAttrString(StringRef AttrStr) { SmallVector<StringRef, 8> Attrs; AttrStr.split(Attrs, ';'); // Default Priority is zero. - int Priority = 0; + unsigned Priority = 0; for (auto Attr : Attrs) { if (Attr.consume_front("priority=")) { - int Result; - if (!Attr.getAsInteger(0, Result)) { + unsigned Result; + if (!Attr.getAsInteger(0, Result)) Priority = Result; - } } } |