Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › zig/ › llvm/ › Builder.zig › vectorConstAssumeCapacity
vectorConstAssumeCapacity
Builder.vectorConstAssumeCapacity
fn vectorConstAssumeCapacity (self : *Builder , ty : Type , vals : []const Constant ) Constant
File
Code
fn vectorConstAssumeCapacity (self : *Builder , ty : Type , vals : []const Constant ) Constant {
assert (ty .isVector (self ));
assert (ty .vectorLen (self ) == vals .len );
for (vals ) |val | assert (ty .childType (self ) == val .typeOf (self ));
for (vals [1 ..]) |val | {
if (vals [0 ] != val ) break ;
} else return self .splatConstAssumeCapacity (ty , vals [0 ]);
for (vals ) |val | {
if (!val .isZeroInit (self )) break ;
} else return self .zeroInitConstAssumeCapacity (ty );
const result = self .getOrPutConstantAggregateAssumeCapacity (.vector , ty , vals );
return result .constant ;
}