From 591d049aa3d9c7e70d945022e1282722ab409f13 Mon Sep 17 00:00:00 2001
From: Chris Lattner
Constants come in many shapes and flavors. The sections that follow -define the format for each of them. All constants start with a Constant pool entries come in many shapes and flavors. The sections that +follow define the format for each of them. All constants start with a uint32_vbr encoded integer that provides the number of operands for the constant. For primitive, structure, and -array constants, this will always be zero since those types of -constants have no operands. In this case, we have the following field -definitions:
+array constants, this will always be zero to indicate that the form of the +constant is solely determined by its type. In this case, we have the following +field definitions, based on type: +When the number of operands to the constant is one, we have an 'undef' value of the specified type.
+When the number of operands to the constant is greater than one, we have a -constant expression and its field format is provided in the table below, and the -number is equal to the number of operands+1.
+ +Inline Assembler entries are stored in the constant pool, though they are not + officially LLVM constants. These entries are marked with a value of + "4294967295" (all ones) for the number of operands. They are encoded as + follows:
+ +Type | +Field Description | +
---|---|
string | +The asm string. | +
string | +The constraints string. | +
uint32_vbr | +Flags | +
Currently, the only defined flag, the low bit, indicates whether or not the + inline assembler has side effects.
+ +Otherwise, we have a constant expression. The format of the constant +expression is specified in the table below, and the number is equal to the +number of operands+1.