================
@@ -725,10 +725,8 @@ void CIRGenFunction::emitStaticVarDecl(const VarDecl &d,
// We can't have a VLA here, but we can have a pointer to a VLA,
// even though that doesn't really make any sense.
// Make sure to evaluate VLA bounds now so that we have them for later.
- if (d.getType()->isVariablyModifiedType()) {
- cgm.errorNYI(d.getSourceRange(),
- "emitStaticVarDecl: variably modified type");
- }
+ if (d.getType()->isVariablyModifiedType())
+ emitVariablyModifiedType(d.getType());
----------------
bcardosolopes wrote:
Nope, it's not an alternative to emitting the variable, it's a pre-pass that
has to run before it. Same as OGCG: `EmitStaticVarDecl` has the identical two
lines with no return, and so does `emitAutoVarAlloca` here:
```
void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D,
llvm::GlobalValue::LinkageTypes
Linkage) {
...
// We can't have a VLA here, but we can have a pointer to a VLA,
// even though that doesn't really make any sense.
// Make sure to evaluate VLA bounds now so that we have them for later.
if (D.getType()->isVariablyModifiedType())
EmitVariablyModifiedType(D.getType());
```
https://github.com/llvm/llvm-project/pull/214926
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits