+
+<div class="doc_code">
+<pre>
+%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
+ uint add(uint 36, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ 8* getelementptr ([7 x 8]* %str1, int 0, int 0),
+ { }* null,
+ int 0,
+ uint 64,
+ uint 64,
+ uint 0,
+ uint 4 }, section "llvm.metadata"
+%str1 = internal constant [7 x 8] c"double\00", section "llvm.metadata"
+</pre>
+</div>
+
+</div>
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+ <a name="ccxx_derived_types">C/C++ derived types</a>
+</div>
+
+<div class="doc_text">
+
+<p>Given the following as an example of C/C++ derived type:</p>
+
+<div class="doc_code">
+<pre>
+typedef const int *IntPtr;
+</pre>
+</div>
+
+<p>a C/C++ front-end would generate the following descriptors:</p>
+
+<div class="doc_code">
+<pre>
+;;
+;; Define the typedef "IntPtr".
+;;
+%<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
+ uint add(uint 22, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ i8* getelementptr ([7 x 8]* %str1, int 0, int 0),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ int 1,
+ uint 0,
+ uint 0,
+ uint 0,
+ { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*) }, section "llvm.metadata"
+%str1 = internal constant [7 x 8] c"IntPtr\00", section "llvm.metadata"
+
+;;
+;; Define the pointer type.
+;;
+%<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
+ uint add(uint 15, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ i8* null,
+ { }* null,
+ int 0,
+ uint 32,
+ uint 32,
+ uint 0,
+ { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) }, section "llvm.metadata"
+
+;;
+;; Define the const type.
+;;
+%<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
+ uint add(uint 38, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ i8* null,
+ { }* null,
+ int 0,
+ uint 0,
+ uint 0,
+ uint 0,
+ { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype1</a> to { }*) }, section "llvm.metadata"
+
+;;
+;; Define the int type.
+;;
+%<a href="#format_basic_type">llvm.dbg.basictype1</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
+ uint add(uint 36, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ 8* getelementptr ([4 x 8]* %str2, int 0, int 0),
+ { }* null,
+ int 0,
+ uint 32,
+ uint 32,
+ uint 0,
+ uint 5 }, section "llvm.metadata"
+%str2 = internal constant [4 x 8] c"int\00", section "llvm.metadata"
+</pre>
+</div>
+
+</div>
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+ <a name="ccxx_composite_types">C/C++ struct/union types</a>
+</div>
+
+<div class="doc_text">
+
+<p>Given the following as an example of C/C++ struct type:</p>
+
+<div class="doc_code">
+<pre>
+struct Color {
+ unsigned Red;
+ unsigned Green;
+ unsigned Blue;
+};
+</pre>
+</div>
+
+<p>a C/C++ front-end would generate the following descriptors:</p>
+
+<div class="doc_code">
+<pre>
+;;
+;; Define basic type for unsigned int.
+;;
+%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
+ uint add(uint 36, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ i8* getelementptr ([13 x i8]* %str1, int 0, int 0),
+ { }* null,
+ int 0,
+ uint 32,
+ uint 32,
+ uint 0,
+ uint 7 }, section "llvm.metadata"
+%str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata"
+
+;;
+;; Define composite type for struct Color.
+;;
+%<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> {
+ uint add(uint 19, uint 262144),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ i8* getelementptr ([6 x i8]* %str2, int 0, int 0),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ int 1,
+ uint 96,
+ uint 32,
+ uint 0,
+ { }* null,
+ { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata"
+%str2 = internal constant [6 x i8] c"Color\00", section "llvm.metadata"
+
+;;
+;; Define the Red field.
+;;
+%<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
+ uint add(uint 13, uint 262144),
+ { }* null,
+ i8* getelementptr ([4 x i8]* %str3, int 0, int 0),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ int 2,
+ uint 32,
+ uint 32,
+ uint 0,
+ { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata"
+%str3 = internal constant [4 x i8] c"Red\00", section "llvm.metadata"
+
+;;
+;; Define the Green field.
+;;
+%<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
+ uint add(uint 13, uint 262144),
+ { }* null,
+ i8* getelementptr ([6 x i8]* %str4, int 0, int 0),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ int 3,
+ uint 32,
+ uint 32,
+ uint 32,
+ { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata"
+%str4 = internal constant [6 x i8] c"Green\00", section "llvm.metadata"
+
+;;
+;; Define the Blue field.
+;;
+%<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
+ uint add(uint 13, uint 262144),
+ { }* null,
+ i8* getelementptr ([5 x i8]* %str5, int 0, int 0),
+ { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
+ int 4,
+ uint 32,
+ uint 32,
+ uint 64,
+ { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata"
+%str5 = internal constant [5 x 8] c"Blue\00", section "llvm.metadata"
+
+;;
+;; Define the array of fields used by the composite type Color.
+;;
+%llvm.dbg.array = internal constant [3 x { }*] [
+ { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> to { }*),
+ { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*),
+ { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) ], section "llvm.metadata"
+</pre>
+</div>
+