[PATCH] D27103: [Constants] Represent the runtime length of a scalable vector. [IR support for SVE scalable vectors 3/4]

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 13:29:36 PST 2016


mehdi_amini added inline comments.


================
Comment at: include/llvm-c/Core.h:223
   LLVMUndefValueValueKind,
+  LLVMVScaleValueValueKind,
   LLVMConstantAggregateZeroValueKind,
----------------
deadalnix wrote:
> This changes the enum value in the C API. Please don't. This will cause hard to track failures in user that use the C API to bind other languages.
We should have a comment before the enum.

Also we could we have a unittest for this:
I have in mind something that just does:

```
// Check that enum values don't change
if (LLVMArgumentValueKind != 0)
  report_fatal_error("Enum changed value")
If (.... )
```

Or:

```
static_assert(LLVMArgumentValueKind != 0, "C-API Enum value changed");
```





https://reviews.llvm.org/D27103





More information about the llvm-commits mailing list