Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 6 | <title>Source Level Debugging with LLVM</title> |
| 7 | <link rel="stylesheet" href="llvm.css" type="text/css"> |
| 8 | </head> |
| 9 | <body> |
| 10 | |
| 11 | <div class="doc_title">Source Level Debugging with LLVM</div> |
| 12 | |
Reid Spencer | d3f876c | 2004-11-01 08:19:36 +0000 | [diff] [blame] | 13 | <table class="layout" style="width:100%"> |
| 14 | <tr class="layout"> |
| 15 | <td class="left"> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 16 | <ul> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 17 | <li><a href="#introduction">Introduction</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 18 | <ol> |
| 19 | <li><a href="#phil">Philosophy behind LLVM debugging information</a></li> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 20 | <li><a href="#consumers">Debug information consumers</a></li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 21 | <li><a href="#debugopt">Debugging optimized code</a></li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 22 | </ol></li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 23 | <li><a href="#format">Debugging information format</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 24 | <ol> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 25 | <li><a href="#debug_info_descriptors">Debug information descriptors</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 26 | <ul> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 27 | <li><a href="#format_anchors">Anchor descriptors</a></li> |
| 28 | <li><a href="#format_compile_units">Compile unit descriptors</a></li> |
| 29 | <li><a href="#format_global_variables">Global variable descriptors</a></li> |
| 30 | <li><a href="#format_subprograms">Subprogram descriptors</a></li> |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 31 | <li><a href="#format_blocks">Block descriptors</a></li> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 32 | <li><a href="#format_basic_type">Basic type descriptors</a></li> |
| 33 | <li><a href="#format_derived_type">Derived type descriptors</a></li> |
| 34 | <li><a href="#format_composite_type">Composite type descriptors</a></li> |
| 35 | <li><a href="#format_subrange">Subrange descriptors</a></li> |
| 36 | <li><a href="#format_enumeration">Enumerator descriptors</a></li> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 37 | <li><a href="#format_variables">Local variables</a></li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 38 | </ul></li> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 39 | <li><a href="#format_common_intrinsics">Debugger intrinsic functions</a> |
| 40 | <ul> |
| 41 | <li><a href="#format_common_stoppoint">llvm.dbg.stoppoint</a></li> |
| 42 | <li><a href="#format_common_func_start">llvm.dbg.func.start</a></li> |
| 43 | <li><a href="#format_common_region_start">llvm.dbg.region.start</a></li> |
| 44 | <li><a href="#format_common_region_end">llvm.dbg.region.end</a></li> |
| 45 | <li><a href="#format_common_declare">llvm.dbg.declare</a></li> |
| 46 | </ul></li> |
| 47 | <li><a href="#format_common_stoppoints">Representing stopping points in the |
| 48 | source program</a></li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 49 | </ol></li> |
| 50 | <li><a href="#ccxx_frontend">C/C++ front-end specific debug information</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 51 | <ol> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 52 | <li><a href="#ccxx_compile_units">C/C++ source file information</a></li> |
| 53 | <li><a href="#ccxx_global_variable">C/C++ global variable information</a></li> |
| 54 | <li><a href="#ccxx_subprogram">C/C++ function information</a></li> |
| 55 | <li><a href="#ccxx_basic_types">C/C++ basic types</a></li> |
| 56 | <li><a href="#ccxx_derived_types">C/C++ derived types</a></li> |
| 57 | <li><a href="#ccxx_composite_types">C/C++ struct/union types</a></li> |
| 58 | <li><a href="#ccxx_enumeration_types">C/C++ enumeration types</a></li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 59 | </ol></li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 60 | </ul> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 61 | </td> |
Reid Spencer | d3f876c | 2004-11-01 08:19:36 +0000 | [diff] [blame] | 62 | <td class="right"> |
Misha Brukman | e849a1a | 2004-05-12 21:26:16 +0000 | [diff] [blame] | 63 | <img src="img/venusflytrap.jpg" alt="A leafy and green bug eater" width="247" |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 64 | height="369"> |
| 65 | </td> |
Reid Spencer | d3f876c | 2004-11-01 08:19:36 +0000 | [diff] [blame] | 66 | </tr></table> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 67 | |
Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame] | 68 | <div class="doc_author"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 69 | <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> |
Jim Laskey | c760a92 | 2007-03-14 19:32:21 +0000 | [diff] [blame] | 70 | and <a href="mailto:jlaskey@mac.com">Jim Laskey</a></p> |
Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame] | 71 | </div> |
| 72 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 73 | |
| 74 | <!-- *********************************************************************** --> |
Misha Brukman | 94218a7 | 2004-12-09 20:27:37 +0000 | [diff] [blame] | 75 | <div class="doc_section"><a name="introduction">Introduction</a></div> |
| 76 | <!-- *********************************************************************** --> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 77 | |
| 78 | <div class="doc_text"> |
| 79 | |
| 80 | <p>This document is the central repository for all information pertaining to |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 81 | debug information in LLVM. It describes the <a href="#format">actual format |
| 82 | that the LLVM debug information</a> takes, which is useful for those |
| 83 | interested in creating front-ends or dealing directly with the information. |
| 84 | Further, this document provides specifc examples of what debug information |
| 85 | for C/C++.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 86 | |
| 87 | </div> |
| 88 | |
| 89 | <!-- ======================================================================= --> |
| 90 | <div class="doc_subsection"> |
| 91 | <a name="phil">Philosophy behind LLVM debugging information</a> |
| 92 | </div> |
| 93 | |
| 94 | <div class="doc_text"> |
| 95 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 96 | <p>The idea of the LLVM debugging information is to capture how the important |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 97 | pieces of the source-language's Abstract Syntax Tree map onto LLVM code. |
| 98 | Several design aspects have shaped the solution that appears here. The |
| 99 | important ones are:</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 100 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 101 | <ul> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 102 | <li>Debugging information should have very little impact on the rest of the |
| 103 | compiler. No transformations, analyses, or code generators should need to |
| 104 | be modified because of debugging information.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 105 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 106 | <li>LLVM optimizations should interact in <a href="#debugopt">well-defined and |
| 107 | easily described ways</a> with the debugging information.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 108 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 109 | <li>Because LLVM is designed to support arbitrary programming languages, |
| 110 | LLVM-to-LLVM tools should not need to know anything about the semantics of |
| 111 | the source-level-language.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 112 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 113 | <li>Source-level languages are often <b>widely</b> different from one another. |
| 114 | LLVM should not put any restrictions of the flavor of the source-language, |
| 115 | and the debugging information should work with any language.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 116 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 117 | <li>With code generator support, it should be possible to use an LLVM compiler |
| 118 | to compile a program to native machine code and standard debugging |
| 119 | formats. This allows compatibility with traditional machine-code level |
| 120 | debuggers, like GDB or DBX.</li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 121 | </ul> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 122 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 123 | <p>The approach used by the LLVM implementation is to use a small set |
| 124 | of <a href="#format_common_intrinsics">intrinsic functions</a> to define a |
| 125 | mapping between LLVM program objects and the source-level objects. The |
| 126 | description of the source-level program is maintained in LLVM global |
| 127 | variables in an <a href="#ccxx_frontend">implementation-defined format</a> |
| 128 | (the C/C++ front-end currently uses working draft 7 of |
| 129 | the <a href="http://www.eagercon.com/dwarf/dwarf3std.htm">DWARF 3 |
| 130 | standard</a>).</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 131 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 132 | <p>When a program is being debugged, a debugger interacts with the user and |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 133 | turns the stored debug information into source-language specific information. |
| 134 | As such, a debugger must be aware of the source-language, and is thus tied to |
| 135 | a specific language or family of languages.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 136 | |
| 137 | </div> |
| 138 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 139 | <!-- ======================================================================= --> |
| 140 | <div class="doc_subsection"> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 141 | <a name="consumers">Debug information consumers</a> |
| 142 | </div> |
| 143 | |
| 144 | <div class="doc_text"> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 145 | |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 146 | <p>The role of debug information is to provide meta information normally |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 147 | stripped away during the compilation process. This meta information provides |
| 148 | an LLVM user a relationship between generated code and the original program |
| 149 | source code.</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 150 | |
| 151 | <p>Currently, debug information is consumed by the DwarfWriter to produce dwarf |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 152 | information used by the gdb debugger. Other targets could use the same |
| 153 | information to produce stabs or other debug forms.</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 154 | |
| 155 | <p>It would also be reasonable to use debug information to feed profiling tools |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 156 | for analysis of generated code, or, tools for reconstructing the original |
| 157 | source from generated code.</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 158 | |
| 159 | <p>TODO - expound a bit more.</p> |
| 160 | |
| 161 | </div> |
| 162 | |
| 163 | <!-- ======================================================================= --> |
| 164 | <div class="doc_subsection"> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 165 | <a name="debugopt">Debugging optimized code</a> |
| 166 | </div> |
| 167 | |
| 168 | <div class="doc_text"> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 169 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 170 | <p>An extremely high priority of LLVM debugging information is to make it |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 171 | interact well with optimizations and analysis. In particular, the LLVM debug |
| 172 | information provides the following guarantees:</p> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 173 | |
| 174 | <ul> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 175 | <li>LLVM debug information <b>always provides information to accurately read |
| 176 | the source-level state of the program</b>, regardless of which LLVM |
| 177 | optimizations have been run, and without any modification to the |
| 178 | optimizations themselves. However, some optimizations may impact the |
| 179 | ability to modify the current state of the program with a debugger, such |
| 180 | as setting program variables, or calling functions that have been |
| 181 | deleted.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 182 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 183 | <li>LLVM optimizations gracefully interact with debugging information. If |
| 184 | they are not aware of debug information, they are automatically disabled |
| 185 | as necessary in the cases that would invalidate the debug info. This |
| 186 | retains the LLVM features, making it easy to write new |
| 187 | transformations.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 188 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 189 | <li>As desired, LLVM optimizations can be upgraded to be aware of the LLVM |
| 190 | debugging information, allowing them to update the debugging information |
| 191 | as they perform aggressive optimizations. This means that, with effort, |
| 192 | the LLVM optimizers could optimize debug code just as well as non-debug |
| 193 | code.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 194 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 195 | <li>LLVM debug information does not prevent many important optimizations from |
| 196 | happening (for example inlining, basic block reordering/merging/cleanup, |
| 197 | tail duplication, etc), further reducing the amount of the compiler that |
| 198 | eventually is "aware" of debugging information.</li> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 199 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 200 | <li>LLVM debug information is automatically optimized along with the rest of |
| 201 | the program, using existing facilities. For example, duplicate |
| 202 | information is automatically merged by the linker, and unused information |
| 203 | is automatically removed.</li> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 204 | </ul> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 205 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 206 | <p>Basically, the debug information allows you to compile a program with |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 207 | "<tt>-O0 -g</tt>" and get full debug information, allowing you to arbitrarily |
| 208 | modify the program as it executes from a debugger. Compiling a program with |
| 209 | "<tt>-O3 -g</tt>" gives you full debug information that is always available |
| 210 | and accurate for reading (e.g., you get accurate stack traces despite tail |
| 211 | call elimination and inlining), but you might lose the ability to modify the |
| 212 | program and call functions where were optimized out of the program, or |
| 213 | inlined away completely.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 214 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 215 | <p><a href="TestingGuide.html#quicktestsuite">LLVM test suite</a> provides a |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 216 | framework to test optimizer's handling of debugging information. It can be |
| 217 | run like this:</p> |
Devang Patel | a5c05aa | 2008-11-21 19:35:57 +0000 | [diff] [blame] | 218 | |
| 219 | <div class="doc_code"> |
| 220 | <pre> |
| 221 | % cd llvm/projects/test-suite/MultiSource/Benchmarks # or some other level |
| 222 | % make TEST=dbgopt |
| 223 | </pre> |
| 224 | </div> |
| 225 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 226 | <p>This will test impact of debugging information on optimization passes. If |
| 227 | debugging information influences optimization passes then it will be reported |
| 228 | as a failure. See <a href="TestingGuide.html">TestingGuide</a> for more |
| 229 | information on LLVM test infrastructure and how to run various tests.</p> |
Devang Patel | a5c05aa | 2008-11-21 19:35:57 +0000 | [diff] [blame] | 230 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 231 | </div> |
| 232 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 233 | <!-- *********************************************************************** --> |
| 234 | <div class="doc_section"> |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 235 | <a name="format">Debugging information format</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 236 | </div> |
| 237 | <!-- *********************************************************************** --> |
| 238 | |
| 239 | <div class="doc_text"> |
| 240 | |
| 241 | <p>LLVM debugging information has been carefully designed to make it possible |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 242 | for the optimizer to optimize the program and debugging information without |
| 243 | necessarily having to know anything about debugging information. In |
| 244 | particular, the global constant merging pass automatically eliminates |
| 245 | duplicated debugging information (often caused by header files), the global |
| 246 | dead code elimination pass automatically deletes debugging information for a |
| 247 | function if it decides to delete the function, and the linker eliminates |
| 248 | debug information when it merges <tt>linkonce</tt> functions.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 249 | |
| 250 | <p>To do this, most of the debugging information (descriptors for types, |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 251 | variables, functions, source files, etc) is inserted by the language |
| 252 | front-end in the form of LLVM global variables. These LLVM global variables |
| 253 | are no different from any other global variables, except that they have a web |
| 254 | of LLVM intrinsic functions that point to them. If the last references to a |
| 255 | particular piece of debugging information are deleted (for example, by the |
| 256 | <tt>-globaldce</tt> pass), the extraneous debug information will |
| 257 | automatically become dead and be removed by the optimizer.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 258 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 259 | <p>Debug information is designed to be agnostic about the target debugger and |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 260 | debugging information representation (e.g. DWARF/Stabs/etc). It uses a |
| 261 | generic machine debug information pass to decode the information that |
| 262 | represents variables, types, functions, namespaces, etc: this allows for |
| 263 | arbitrary source-language semantics and type-systems to be used, as long as |
| 264 | there is a module written for the target debugger to interpret the |
| 265 | information. In addition, debug global variables are declared in |
| 266 | the <tt>"llvm.metadata"</tt> section. All values declared in this section |
| 267 | are stripped away after target debug information is constructed and before |
| 268 | the program object is emitted.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 269 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 270 | <p>To provide basic functionality, the LLVM debugger does have to make some |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 271 | assumptions about the source-level language being debugged, though it keeps |
| 272 | these to a minimum. The only common features that the LLVM debugger assumes |
| 273 | exist are <a href="#format_compile_units">source files</a>, |
| 274 | and <a href="#format_global_variables">program objects</a>. These abstract |
| 275 | objects are used by a debugger to form stack traces, show information about |
| 276 | local variables, etc.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 277 | |
| 278 | <p>This section of the documentation first describes the representation aspects |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 279 | common to any source-language. The <a href="#ccxx_frontend">next section</a> |
| 280 | describes the data layout conventions used by the C and C++ front-ends.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 281 | |
| 282 | </div> |
| 283 | |
| 284 | <!-- ======================================================================= --> |
| 285 | <div class="doc_subsection"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 286 | <a name="debug_info_descriptors">Debug information descriptors</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 287 | </div> |
| 288 | |
| 289 | <div class="doc_text"> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 290 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 291 | <p>In consideration of the complexity and volume of debug information, LLVM |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 292 | provides a specification for well formed debug global variables. The |
| 293 | constant value of each of these globals is one of a limited set of |
| 294 | structures, known as debug descriptors.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 295 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 296 | <p>Consumers of LLVM debug information expect the descriptors for program |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 297 | objects to start in a canonical format, but the descriptors can include |
| 298 | additional information appended at the end that is source-language |
| 299 | specific. All LLVM debugging information is versioned, allowing backwards |
| 300 | compatibility in the case that the core structures need to change in some |
| 301 | way. Also, all debugging information objects start with a tag to indicate |
| 302 | what type of object it is. The source-language is allowed to define its own |
| 303 | objects, by using unreserved tag numbers. We recommend using with tags in |
| 304 | the range 0x1000 thru 0x2000 (there is a defined enum DW_TAG_user_base = |
| 305 | 0x1000.)</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 306 | |
Jim Laskey | 44c3b9f | 2007-01-26 21:22:28 +0000 | [diff] [blame] | 307 | <p>The fields of debug descriptors used internally by LLVM (MachineModuleInfo) |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 308 | are restricted to only the simple data types <tt>int</tt>, <tt>uint</tt>, |
| 309 | <tt>bool</tt>, <tt>float</tt>, <tt>double</tt>, <tt>i8*</tt> and |
| 310 | <tt>{ }*</tt>. References to arbitrary values are handled using a |
| 311 | <tt>{ }*</tt> and a cast to <tt>{ }*</tt> expression; typically |
| 312 | references to other field descriptors, arrays of descriptors or global |
| 313 | variables.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 314 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 315 | <div class="doc_code"> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 316 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 317 | %llvm.dbg.object.type = type { |
| 318 | uint, ;; A tag |
| 319 | ... |
| 320 | } |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 321 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 322 | </div> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 323 | |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 324 | <p><a name="LLVMDebugVersion">The first field of a descriptor is always an |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 325 | <tt>uint</tt> containing a tag value identifying the content of the |
| 326 | descriptor. The remaining fields are specific to the descriptor. The values |
| 327 | of tags are loosely bound to the tag values of DWARF information entries. |
| 328 | However, that does not restrict the use of the information supplied to DWARF |
| 329 | targets. To facilitate versioning of debug information, the tag is augmented |
| 330 | with the current debug version (LLVMDebugVersion = 4 << 16 or 0x40000 or |
| 331 | 262144.)</a></p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 332 | |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 333 | <p>The details of the various descriptors follow.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 334 | |
| 335 | </div> |
| 336 | |
| 337 | <!-- ======================================================================= --> |
| 338 | <div class="doc_subsubsection"> |
| 339 | <a name="format_anchors">Anchor descriptors</a> |
| 340 | </div> |
| 341 | |
| 342 | <div class="doc_text"> |
| 343 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 344 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 345 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 346 | %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { |
| 347 | i32, ;; Tag = 0 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> |
| 348 | i32 ;; Tag of descriptors grouped by the anchor |
| 349 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 350 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 351 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 352 | |
| 353 | <p>One important aspect of the LLVM debug representation is that it allows the |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 354 | LLVM debugger to efficiently index all of the global objects without having |
| 355 | the scan the program. To do this, all of the global objects use "anchor" |
| 356 | descriptors with designated names. All of the global objects of a particular |
| 357 | type (e.g., compile units) contain a pointer to the anchor. This pointer |
| 358 | allows a debugger to use def-use chains to find all global objects of that |
| 359 | type.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 360 | |
| 361 | <p>The following names are recognized as anchors by LLVM:</p> |
| 362 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 363 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 364 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 365 | %<a href="#format_compile_units">llvm.dbg.compile_units</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { |
| 366 | i32 0, |
| 367 | i32 17 |
| 368 | } ;; DW_TAG_compile_unit |
| 369 | %<a href="#format_global_variables">llvm.dbg.global_variables</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { |
| 370 | i32 0, |
| 371 | i32 52 |
| 372 | } ;; DW_TAG_variable |
| 373 | %<a href="#format_subprograms">llvm.dbg.subprograms</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { |
| 374 | i32 0, |
| 375 | i32 46 |
| 376 | } ;; DW_TAG_subprogram |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 377 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 378 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 379 | |
| 380 | <p>Using anchors in this way (where the compile unit descriptor points to the |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 381 | anchors, as opposed to having a list of compile unit descriptors) allows for |
| 382 | the standard dead global elimination and merging passes to automatically |
| 383 | remove unused debugging information. If the globals were kept track of |
| 384 | through lists, there would always be an object pointing to the descriptors, |
| 385 | thus would never be deleted.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 386 | |
| 387 | </div> |
| 388 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 389 | <!-- ======================================================================= --> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 390 | <div class="doc_subsubsection"> |
| 391 | <a name="format_compile_units">Compile unit descriptors</a> |
| 392 | </div> |
| 393 | |
| 394 | <div class="doc_text"> |
| 395 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 396 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 397 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 398 | %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = type { |
| 399 | i32, ;; Tag = 17 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_compile_unit) |
| 400 | { }*, ;; Compile unit anchor = cast = (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to { }*) |
| 401 | i32, ;; DWARF language identifier (ex. DW_LANG_C89) |
| 402 | i8*, ;; Source file name |
| 403 | i8*, ;; Source file directory (includes trailing slash) |
| 404 | i8* ;; Producer (ex. "4.0.1 LLVM (LLVM research group)") |
| 405 | i1, ;; True if this is a main compile unit. |
| 406 | i1, ;; True if this is optimized. |
| 407 | i8*, ;; Flags |
| 408 | i32 ;; Runtime version |
| 409 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 410 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 411 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 412 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 413 | <p>These descriptors contain a source language ID for the file (we use the DWARF |
| 414 | 3.0 ID numbers, such as <tt>DW_LANG_C89</tt>, <tt>DW_LANG_C_plus_plus</tt>, |
| 415 | <tt>DW_LANG_Cobol74</tt>, etc), three strings describing the filename, |
| 416 | working directory of the compiler, and an identifier string for the compiler |
| 417 | that produced it.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 418 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 419 | <p>Compile unit descriptors provide the root context for objects declared in a |
| 420 | specific source file. Global variables and top level functions would be |
| 421 | defined using this context. Compile unit descriptors also provide context |
| 422 | for source line correspondence.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 423 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 424 | <p>Each input file is encoded as a separate compile unit in LLVM debugging |
| 425 | information output. However, many target specific tool chains prefer to |
| 426 | encode only one compile unit in an object file. In this situation, the LLVM |
| 427 | code generator will include debugging information entities in the compile |
| 428 | unit that is marked as main compile unit. The code generator accepts maximum |
| 429 | one main compile unit per module. If a module does not contain any main |
| 430 | compile unit then the code generator will emit multiple compile units in the |
| 431 | output object file.</p> |
| 432 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 433 | </div> |
| 434 | |
| 435 | <!-- ======================================================================= --> |
| 436 | <div class="doc_subsubsection"> |
| 437 | <a name="format_global_variables">Global variable descriptors</a> |
| 438 | </div> |
| 439 | |
| 440 | <div class="doc_text"> |
| 441 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 442 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 443 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 444 | %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type { |
| 445 | i32, ;; Tag = 52 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_variable) |
| 446 | { }*, ;; Global variable anchor = cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_global_variables">llvm.dbg.global_variables</a> to { }*), |
| 447 | { }*, ;; Reference to context descriptor |
| 448 | i8*, ;; Name |
| 449 | i8*, ;; Display name (fully qualified C++ name) |
| 450 | i8*, ;; MIPS linkage name (for C++) |
| 451 | { }*, ;; Reference to compile unit where defined |
| 452 | i32, ;; Line number where defined |
| 453 | { }*, ;; Reference to type descriptor |
| 454 | i1, ;; True if the global is local to compile unit (static) |
| 455 | i1, ;; True if the global is defined in the compile unit (not extern) |
| 456 | { }* ;; Reference to the global variable |
| 457 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 458 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 459 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 460 | |
| 461 | <p>These descriptors provide debug information about globals variables. The |
| 462 | provide details such as name, type and where the variable is defined.</p> |
| 463 | |
| 464 | </div> |
| 465 | |
| 466 | <!-- ======================================================================= --> |
| 467 | <div class="doc_subsubsection"> |
| 468 | <a name="format_subprograms">Subprogram descriptors</a> |
| 469 | </div> |
| 470 | |
| 471 | <div class="doc_text"> |
| 472 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 473 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 474 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 475 | %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type { |
| 476 | i32, ;; Tag = 46 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subprogram) |
| 477 | { }*, ;; Subprogram anchor = cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to { }*), |
| 478 | { }*, ;; Reference to context descriptor |
| 479 | i8*, ;; Name |
| 480 | i8*, ;; Display name (fully qualified C++ name) |
| 481 | i8*, ;; MIPS linkage name (for C++) |
| 482 | { }*, ;; Reference to compile unit where defined |
| 483 | i32, ;; Line number where defined |
| 484 | { }*, ;; Reference to type descriptor |
| 485 | i1, ;; True if the global is local to compile unit (static) |
| 486 | i1 ;; True if the global is defined in the compile unit (not extern) |
| 487 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 488 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 489 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 490 | |
| 491 | <p>These descriptors provide debug information about functions, methods and |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 492 | subprograms. They provide details such as name, return types and the source |
| 493 | location where the subprogram is defined.</p> |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 494 | |
| 495 | </div> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 496 | |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 497 | <!-- ======================================================================= --> |
| 498 | <div class="doc_subsubsection"> |
| 499 | <a name="format_blocks">Block descriptors</a> |
| 500 | </div> |
| 501 | |
| 502 | <div class="doc_text"> |
| 503 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 504 | <div class="doc_code"> |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 505 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 506 | %<a href="#format_blocks">llvm.dbg.block</a> = type { |
| 507 | i32, ;; Tag = 13 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_lexical_block) |
| 508 | { }* ;; Reference to context descriptor |
| 509 | } |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 510 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 511 | </div> |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 512 | |
| 513 | <p>These descriptors provide debug information about nested blocks within a |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 514 | subprogram. The array of member descriptors is used to define local |
| 515 | variables and deeper nested blocks.</p> |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 516 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 517 | </div> |
| 518 | |
| 519 | <!-- ======================================================================= --> |
| 520 | <div class="doc_subsubsection"> |
| 521 | <a name="format_basic_type">Basic type descriptors</a> |
| 522 | </div> |
| 523 | |
| 524 | <div class="doc_text"> |
| 525 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 526 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 527 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 528 | %<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type { |
| 529 | i32, ;; Tag = 36 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_base_type) |
| 530 | { }*, ;; Reference to context (typically a compile unit) |
| 531 | i8*, ;; Name (may be "" for anonymous types) |
| 532 | { }*, ;; Reference to compile unit where defined (may be NULL) |
| 533 | i32, ;; Line number where defined (may be 0) |
| 534 | i64, ;; Size in bits |
| 535 | i64, ;; Alignment in bits |
| 536 | i64, ;; Offset in bits |
| 537 | i32, ;; Flags |
| 538 | i32 ;; DWARF type encoding |
| 539 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 540 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 541 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 542 | |
| 543 | <p>These descriptors define primitive types used in the code. Example int, bool |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 544 | and float. The context provides the scope of the type, which is usually the |
| 545 | top level. Since basic types are not usually user defined the compile unit |
| 546 | and line number can be left as NULL and 0. The size, alignment and offset |
| 547 | are expressed in bits and can be 64 bit values. The alignment is used to |
| 548 | round the offset when embedded in a |
| 549 | <a href="#format_composite_type">composite type</a> (example to keep float |
| 550 | doubles on 64 bit boundaries.) The offset is the bit offset if embedded in |
| 551 | a <a href="#format_composite_type">composite type</a>.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 552 | |
| 553 | <p>The type encoding provides the details of the type. The values are typically |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 554 | one of the following:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 555 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 556 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 557 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 558 | DW_ATE_address = 1 |
| 559 | DW_ATE_boolean = 2 |
| 560 | DW_ATE_float = 4 |
| 561 | DW_ATE_signed = 5 |
| 562 | DW_ATE_signed_char = 6 |
| 563 | DW_ATE_unsigned = 7 |
| 564 | DW_ATE_unsigned_char = 8 |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 565 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 566 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 567 | |
| 568 | </div> |
| 569 | |
| 570 | <!-- ======================================================================= --> |
| 571 | <div class="doc_subsubsection"> |
| 572 | <a name="format_derived_type">Derived type descriptors</a> |
| 573 | </div> |
| 574 | |
| 575 | <div class="doc_text"> |
| 576 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 577 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 578 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 579 | %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> = type { |
| 580 | i32, ;; Tag (see below) |
| 581 | { }*, ;; Reference to context |
| 582 | i8*, ;; Name (may be "" for anonymous types) |
| 583 | { }*, ;; Reference to compile unit where defined (may be NULL) |
| 584 | i32, ;; Line number where defined (may be 0) |
| 585 | i32, ;; Size in bits |
| 586 | i32, ;; Alignment in bits |
| 587 | i32, ;; Offset in bits |
| 588 | { }* ;; Reference to type derived from |
| 589 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 590 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 591 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 592 | |
| 593 | <p>These descriptors are used to define types derived from other types. The |
| 594 | value of the tag varies depending on the meaning. The following are possible |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 595 | tag values:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 596 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 597 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 598 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 599 | DW_TAG_formal_parameter = 5 |
| 600 | DW_TAG_member = 13 |
| 601 | DW_TAG_pointer_type = 15 |
| 602 | DW_TAG_reference_type = 16 |
| 603 | DW_TAG_typedef = 22 |
| 604 | DW_TAG_const_type = 38 |
| 605 | DW_TAG_volatile_type = 53 |
| 606 | DW_TAG_restrict_type = 55 |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 607 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 608 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 609 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 610 | <p><tt>DW_TAG_member</tt> is used to define a member of |
| 611 | a <a href="#format_composite_type">composite type</a> |
| 612 | or <a href="#format_subprograms">subprogram</a>. The type of the member is |
| 613 | the <a href="#format_derived_type">derived |
| 614 | type</a>. <tt>DW_TAG_formal_parameter</tt> is used to define a member which |
| 615 | is a formal argument of a subprogram.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 616 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 617 | <p><tt>DW_TAG_typedef</tt> is used to provide a name for the derived type.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 618 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 619 | <p><tt>DW_TAG_pointer_type</tt>,<tt>DW_TAG_reference_type</tt>, |
| 620 | <tt>DW_TAG_const_type</tt>, <tt>DW_TAG_volatile_type</tt> |
| 621 | and <tt>DW_TAG_restrict_type</tt> are used to qualify |
| 622 | the <a href="#format_derived_type">derived type</a>. </p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 623 | |
| 624 | <p><a href="#format_derived_type">Derived type</a> location can be determined |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 625 | from the compile unit and line number. The size, alignment and offset are |
| 626 | expressed in bits and can be 64 bit values. The alignment is used to round |
| 627 | the offset when embedded in a <a href="#format_composite_type">composite |
| 628 | type</a> (example to keep float doubles on 64 bit boundaries.) The offset is |
| 629 | the bit offset if embedded in a <a href="#format_composite_type">composite |
| 630 | type</a>.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 631 | |
| 632 | <p>Note that the <tt>void *</tt> type is expressed as a |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 633 | <tt>llvm.dbg.derivedtype.type</tt> with tag of <tt>DW_TAG_pointer_type</tt> |
| 634 | and <tt>NULL</tt> derived type.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 635 | |
| 636 | </div> |
| 637 | |
| 638 | <!-- ======================================================================= --> |
| 639 | <div class="doc_subsubsection"> |
| 640 | <a name="format_composite_type">Composite type descriptors</a> |
| 641 | </div> |
| 642 | |
| 643 | <div class="doc_text"> |
| 644 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 645 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 646 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 647 | %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> = type { |
| 648 | i32, ;; Tag (see below) |
| 649 | { }*, ;; Reference to context |
| 650 | i8*, ;; Name (may be "" for anonymous types) |
| 651 | { }*, ;; Reference to compile unit where defined (may be NULL) |
| 652 | i32, ;; Line number where defined (may be 0) |
| 653 | i64, ;; Size in bits |
| 654 | i64, ;; Alignment in bits |
| 655 | i64, ;; Offset in bits |
| 656 | i32, ;; Flags |
| 657 | { }*, ;; Reference to type derived from |
| 658 | { }*, ;; Reference to array of member descriptors |
| 659 | i32 ;; Runtime languages |
| 660 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 661 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 662 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 663 | |
| 664 | <p>These descriptors are used to define types that are composed of 0 or more |
| 665 | elements. The value of the tag varies depending on the meaning. The following |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 666 | are possible tag values:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 667 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 668 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 669 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 670 | DW_TAG_array_type = 1 |
| 671 | DW_TAG_enumeration_type = 4 |
| 672 | DW_TAG_structure_type = 19 |
| 673 | DW_TAG_union_type = 23 |
| 674 | DW_TAG_vector_type = 259 |
| 675 | DW_TAG_subroutine_type = 46 |
| 676 | DW_TAG_inheritance = 26 |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 677 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 678 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 679 | |
Jim Laskey | f8a01a9 | 2006-06-15 20:51:43 +0000 | [diff] [blame] | 680 | <p>The vector flag indicates that an array type is a native packed vector.</p> |
| 681 | |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 682 | <p>The members of array types (tag = <tt>DW_TAG_array_type</tt>) or vector types |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 683 | (tag = <tt>DW_TAG_vector_type</tt>) are <a href="#format_subrange">subrange |
| 684 | descriptors</a>, each representing the range of subscripts at that level of |
| 685 | indexing.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 686 | |
| 687 | <p>The members of enumeration types (tag = <tt>DW_TAG_enumeration_type</tt>) are |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 688 | <a href="#format_enumeration">enumerator descriptors</a>, each representing |
| 689 | the definition of enumeration value for the set.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 690 | |
| 691 | <p>The members of structure (tag = <tt>DW_TAG_structure_type</tt>) or union (tag |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 692 | = <tt>DW_TAG_union_type</tt>) types are any one of |
| 693 | the <a href="#format_basic_type">basic</a>, |
| 694 | <a href="#format_derived_type">derived</a> |
| 695 | or <a href="#format_composite_type">composite</a> type descriptors, each |
| 696 | representing a field member of the structure or union.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 697 | |
Jim Laskey | 4a9df24 | 2006-08-21 21:21:06 +0000 | [diff] [blame] | 698 | <p>For C++ classes (tag = <tt>DW_TAG_structure_type</tt>), member descriptors |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 699 | provide information about base classes, static members and member |
| 700 | functions. If a member is a <a href="#format_derived_type">derived type |
| 701 | descriptor</a> and has a tag of <tt>DW_TAG_inheritance</tt>, then the type |
| 702 | represents a base class. If the member of is |
| 703 | a <a href="#format_global_variables">global variable descriptor</a> then it |
| 704 | represents a static member. And, if the member is |
| 705 | a <a href="#format_subprograms">subprogram descriptor</a> then it represents |
| 706 | a member function. For static members and member |
| 707 | functions, <tt>getName()</tt> returns the members link or the C++ mangled |
| 708 | name. <tt>getDisplayName()</tt> the simplied version of the name.</p> |
Jim Laskey | 4a9df24 | 2006-08-21 21:21:06 +0000 | [diff] [blame] | 709 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 710 | <p>The first member of subroutine (tag = <tt>DW_TAG_subroutine_type</tt>) type |
| 711 | elements is the return type for the subroutine. The remaining elements are |
| 712 | the formal arguments to the subroutine.</p> |
Jim Laskey | 094ee72 | 2006-06-20 21:13:20 +0000 | [diff] [blame] | 713 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 714 | <p><a href="#format_composite_type">Composite type</a> location can be |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 715 | determined from the compile unit and line number. The size, alignment and |
| 716 | offset are expressed in bits and can be 64 bit values. The alignment is used |
| 717 | to round the offset when embedded in |
| 718 | a <a href="#format_composite_type">composite type</a> (as an example, to keep |
| 719 | float doubles on 64 bit boundaries.) The offset is the bit offset if embedded |
| 720 | in a <a href="#format_composite_type">composite type</a>.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 721 | |
| 722 | </div> |
| 723 | |
| 724 | <!-- ======================================================================= --> |
| 725 | <div class="doc_subsubsection"> |
| 726 | <a name="format_subrange">Subrange descriptors</a> |
| 727 | </div> |
| 728 | |
| 729 | <div class="doc_text"> |
| 730 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 731 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 732 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 733 | %<a href="#format_subrange">llvm.dbg.subrange.type</a> = type { |
| 734 | i32, ;; Tag = 33 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subrange_type) |
| 735 | i64, ;; Low value |
| 736 | i64 ;; High value |
| 737 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 738 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 739 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 740 | |
| 741 | <p>These descriptors are used to define ranges of array subscripts for an array |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 742 | <a href="#format_composite_type">composite type</a>. The low value defines |
| 743 | the lower bounds typically zero for C/C++. The high value is the upper |
| 744 | bounds. Values are 64 bit. High - low + 1 is the size of the array. If low |
| 745 | == high the array will be unbounded.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 746 | |
| 747 | </div> |
| 748 | |
| 749 | <!-- ======================================================================= --> |
| 750 | <div class="doc_subsubsection"> |
| 751 | <a name="format_enumeration">Enumerator descriptors</a> |
| 752 | </div> |
| 753 | |
| 754 | <div class="doc_text"> |
| 755 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 756 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 757 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 758 | %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> = type { |
| 759 | i32, ;; Tag = 40 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_enumerator) |
| 760 | i8*, ;; Name |
| 761 | i64 ;; Value |
| 762 | } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 763 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 764 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 765 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 766 | <p>These descriptors are used to define members of an |
| 767 | enumeration <a href="#format_composite_type">composite type</a>, it |
| 768 | associates the name to the value.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 769 | |
| 770 | </div> |
| 771 | |
| 772 | <!-- ======================================================================= --> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 773 | <div class="doc_subsubsection"> |
| 774 | <a name="format_variables">Local variables</a> |
| 775 | </div> |
| 776 | |
| 777 | <div class="doc_text"> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 778 | |
| 779 | <div class="doc_code"> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 780 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 781 | %<a href="#format_variables">llvm.dbg.variable.type</a> = type { |
| 782 | i32, ;; Tag (see below) |
| 783 | { }*, ;; Context |
| 784 | i8*, ;; Name |
| 785 | { }*, ;; Reference to compile unit where defined |
| 786 | i32, ;; Line number where defined |
| 787 | { }* ;; Type descriptor |
| 788 | } |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 789 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 790 | </div> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 791 | |
| 792 | <p>These descriptors are used to define variables local to a sub program. The |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 793 | value of the tag depends on the usage of the variable:</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 794 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 795 | <div class="doc_code"> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 796 | <pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 797 | DW_TAG_auto_variable = 256 |
| 798 | DW_TAG_arg_variable = 257 |
| 799 | DW_TAG_return_variable = 258 |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 800 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 801 | </div> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 802 | |
| 803 | <p>An auto variable is any variable declared in the body of the function. An |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 804 | argument variable is any variable that appears as a formal argument to the |
| 805 | function. A return variable is used to track the result of a function and |
| 806 | has no source correspondent.</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 807 | |
Jim Laskey | 2d395d9 | 2006-03-24 09:20:27 +0000 | [diff] [blame] | 808 | <p>The context is either the subprogram or block where the variable is defined. |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 809 | Name the source variable name. Compile unit and line indicate where the |
| 810 | variable was defined. Type descriptor defines the declared type of the |
| 811 | variable.</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 812 | |
| 813 | </div> |
| 814 | |
| 815 | <!-- ======================================================================= --> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 816 | <div class="doc_subsection"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 817 | <a name="format_common_intrinsics">Debugger intrinsic functions</a> |
| 818 | </div> |
| 819 | |
| 820 | <div class="doc_text"> |
| 821 | |
| 822 | <p>LLVM uses several intrinsic functions (name prefixed with "llvm.dbg") to |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 823 | provide debug information at various points in generated code.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 824 | |
| 825 | </div> |
| 826 | |
| 827 | <!-- ======================================================================= --> |
| 828 | <div class="doc_subsubsection"> |
| 829 | <a name="format_common_stoppoint">llvm.dbg.stoppoint</a> |
| 830 | </div> |
| 831 | |
| 832 | <div class="doc_text"> |
| 833 | <pre> |
Jim Laskey | 108a638 | 2006-03-23 17:58:46 +0000 | [diff] [blame] | 834 | void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint, uint, { }* ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 835 | </pre> |
| 836 | |
| 837 | <p>This intrinsic is used to provide correspondence between the source file and |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 838 | the generated code. The first argument is the line number (base 1), second |
| 839 | argument is the column number (0 if unknown) and the third argument the |
| 840 | source <tt>%<a href="#format_compile_units">llvm.dbg.compile_unit</a>*</tt> |
| 841 | cast to a <tt>{ }*</tt>. Code following a call to this intrinsic will |
| 842 | have been defined in close proximity of the line, column and file. This |
| 843 | information holds until the next call |
| 844 | to <tt>%<a href="#format_common_stoppoint">lvm.dbg.stoppoint</a></tt>.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 845 | |
| 846 | </div> |
| 847 | |
| 848 | <!-- ======================================================================= --> |
| 849 | <div class="doc_subsubsection"> |
| 850 | <a name="format_common_func_start">llvm.dbg.func.start</a> |
| 851 | </div> |
| 852 | |
| 853 | <div class="doc_text"> |
| 854 | <pre> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 855 | void %<a href="#format_common_func_start">llvm.dbg.func.start</a>( { }* ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 856 | </pre> |
| 857 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 858 | <p>This intrinsic is used to link the debug information |
| 859 | in <tt>%<a href="#format_subprograms">llvm.dbg.subprogram</a></tt> to the |
| 860 | function. It defines the beginning of the function's declarative region |
| 861 | (scope). It also implies a call to |
| 862 | %<tt><a href="#format_common_stoppoint">llvm.dbg.stoppoint</a></tt> which |
| 863 | defines a source line "stop point". The intrinsic should be called early in |
| 864 | the function after the all the alloca instructions. It should be paired off |
| 865 | with a closing |
| 866 | <tt>%<a href="#format_common_region_end">llvm.dbg.region.end</a></tt>. |
| 867 | The function's single argument is |
| 868 | the <tt>%<a href="#format_subprograms">llvm.dbg.subprogram.type</a></tt>.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 869 | |
| 870 | </div> |
| 871 | |
| 872 | <!-- ======================================================================= --> |
| 873 | <div class="doc_subsubsection"> |
| 874 | <a name="format_common_region_start">llvm.dbg.region.start</a> |
| 875 | </div> |
| 876 | |
| 877 | <div class="doc_text"> |
| 878 | <pre> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 879 | void %<a href="#format_common_region_start">llvm.dbg.region.start</a>( { }* ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 880 | </pre> |
| 881 | |
| 882 | <p>This intrinsic is used to define the beginning of a declarative scope (ex. |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 883 | block) for local language elements. It should be paired off with a closing |
| 884 | <tt>%<a href="#format_common_region_end">llvm.dbg.region.end</a></tt>. The |
| 885 | function's single argument is |
| 886 | the <tt>%<a href="#format_blocks">llvm.dbg.block</a></tt> which is |
| 887 | starting.</p> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 888 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 889 | |
| 890 | </div> |
| 891 | |
| 892 | <!-- ======================================================================= --> |
| 893 | <div class="doc_subsubsection"> |
| 894 | <a name="format_common_region_end">llvm.dbg.region.end</a> |
| 895 | </div> |
| 896 | |
| 897 | <div class="doc_text"> |
| 898 | <pre> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 899 | void %<a href="#format_common_region_end">llvm.dbg.region.end</a>( { }* ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 900 | </pre> |
| 901 | |
| 902 | <p>This intrinsic is used to define the end of a declarative scope (ex. block) |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 903 | for local language elements. It should be paired off with an |
| 904 | opening <tt>%<a href="#format_common_region_start">llvm.dbg.region.start</a></tt> |
| 905 | or <tt>%<a href="#format_common_func_start">llvm.dbg.func.start</a></tt>. |
| 906 | The function's single argument is either |
| 907 | the <tt>%<a href="#format_blocks">llvm.dbg.block</a></tt> or |
| 908 | the <tt>%<a href="#format_subprograms">llvm.dbg.subprogram.type</a></tt> |
| 909 | which is ending.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 910 | |
| 911 | </div> |
| 912 | |
| 913 | <!-- ======================================================================= --> |
| 914 | <div class="doc_subsubsection"> |
| 915 | <a name="format_common_declare">llvm.dbg.declare</a> |
| 916 | </div> |
| 917 | |
| 918 | <div class="doc_text"> |
| 919 | <pre> |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 920 | void %<a href="#format_common_declare">llvm.dbg.declare</a>( { } *, { }* ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 921 | </pre> |
| 922 | |
Jim Laskey | 2d395d9 | 2006-03-24 09:20:27 +0000 | [diff] [blame] | 923 | <p>This intrinsic provides information about a local element (ex. variable.) The |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 924 | first argument is the alloca for the variable, cast to a <tt>{ }*</tt>. The |
| 925 | second argument is |
| 926 | the <tt>%<a href="#format_variables">llvm.dbg.variable</a></tt> containing |
| 927 | the description of the variable, also cast to a <tt>{ }*</tt>.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 928 | |
| 929 | </div> |
| 930 | |
| 931 | <!-- ======================================================================= --> |
| 932 | <div class="doc_subsection"> |
| 933 | <a name="format_common_stoppoints"> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 934 | Representing stopping points in the source program |
| 935 | </a> |
| 936 | </div> |
| 937 | |
| 938 | <div class="doc_text"> |
| 939 | |
| 940 | <p>LLVM debugger "stop points" are a key part of the debugging representation |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 941 | that allows the LLVM to maintain simple semantics |
| 942 | for <a href="#debugopt">debugging optimized code</a>. The basic idea is that |
| 943 | the front-end inserts calls to |
| 944 | the <a href="#format_common_stoppoint">%<tt>llvm.dbg.stoppoint</tt></a> |
| 945 | intrinsic function at every point in the program where a debugger should be |
| 946 | able to inspect the program (these correspond to places a debugger stops when |
| 947 | you "<tt>step</tt>" through it). The front-end can choose to place these as |
| 948 | fine-grained as it would like (for example, before every subexpression |
| 949 | evaluated), but it is recommended to only put them after every source |
| 950 | statement that includes executable code.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 951 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 952 | <p>Using calls to this intrinsic function to demark legal points for the |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 953 | debugger to inspect the program automatically disables any optimizations that |
| 954 | could potentially confuse debugging information. To |
| 955 | non-debug-information-aware transformations, these calls simply look like |
| 956 | calls to an external function, which they must assume to do anything |
| 957 | (including reading or writing to any part of reachable memory). On the other |
| 958 | hand, it does not impact many optimizations, such as code motion of |
| 959 | non-trapping instructions, nor does it impact optimization of subexpressions, |
| 960 | code duplication transformations, or basic-block reordering |
| 961 | transformations.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 962 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 963 | </div> |
| 964 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 965 | <!-- ======================================================================= --> |
| 966 | <div class="doc_subsection"> |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 967 | <a name="format_common_lifetime">Object lifetimes and scoping</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 968 | </div> |
| 969 | |
| 970 | <div class="doc_text"> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 971 | <p>In many languages, the local variables in functions can have their lifetime |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 972 | or scope limited to a subset of a function. In the C family of languages, |
| 973 | for example, variables are only live (readable and writable) within the |
| 974 | source block that they are defined in. In functional languages, values are |
| 975 | only readable after they have been defined. Though this is a very obvious |
| 976 | concept, it is also non-trivial to model in LLVM, because it has no notion of |
| 977 | scoping in this sense, and does not want to be tied to a language's scoping |
| 978 | rules.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 979 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 980 | <p>In order to handle this, the LLVM debug format uses the notion of "regions" |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 981 | of a function, delineated by calls to intrinsic functions. These intrinsic |
| 982 | functions define new regions of the program and indicate when the region |
| 983 | lifetime expires. Consider the following C fragment, for example:</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 984 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 985 | <div class="doc_code"> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 986 | <pre> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 987 | 1. void foo() { |
| 988 | 2. int X = ...; |
| 989 | 3. int Y = ...; |
| 990 | 4. { |
| 991 | 5. int Z = ...; |
| 992 | 6. ... |
| 993 | 7. } |
| 994 | 8. ... |
| 995 | 9. } |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 996 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 997 | </div> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 998 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 999 | <p>Compiled to LLVM, this function would be represented like this:</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1000 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1001 | <div class="doc_code"> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1002 | <pre> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1003 | void %foo() { |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1004 | entry: |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1005 | %X = alloca int |
| 1006 | %Y = alloca int |
| 1007 | %Z = alloca int |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1008 | |
| 1009 | ... |
| 1010 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1011 | call void @<a href="#format_common_func_start">llvm.dbg.func.start</a>( %<a href="#format_subprograms">llvm.dbg.subprogram.type</a>* @llvm.dbg.subprogram ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1012 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1013 | call void @<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 2, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* @llvm.dbg.compile_unit ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1014 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1015 | call void @<a href="#format_common_declare">llvm.dbg.declare</a>({}* %X, ...) |
| 1016 | call void @<a href="#format_common_declare">llvm.dbg.declare</a>({}* %Y, ...) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1017 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1018 | <i>;; Evaluate expression on line 2, assigning to X.</i> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1019 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1020 | call void @<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 3, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* @llvm.dbg.compile_unit ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1021 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1022 | <i>;; Evaluate expression on line 3, assigning to Y.</i> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1023 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1024 | call void @<a href="#format_common_stoppoint">llvm.region.start</a>() |
| 1025 | call void @<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 5, uint 4, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* @llvm.dbg.compile_unit ) |
| 1026 | call void @<a href="#format_common_declare">llvm.dbg.declare</a>({}* %X, ...) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1027 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1028 | <i>;; Evaluate expression on line 5, assigning to Z.</i> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1029 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1030 | call void @<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 7, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* @llvm.dbg.compile_unit ) |
| 1031 | call void @<a href="#format_common_region_end">llvm.region.end</a>() |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1032 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1033 | call void @<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 9, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* @llvm.dbg.compile_unit ) |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1034 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1035 | call void @<a href="#format_common_region_end">llvm.region.end</a>() |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1036 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1037 | ret void |
| 1038 | } |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1039 | </pre> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1040 | </div> |
| 1041 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1042 | <p>This example illustrates a few important details about the LLVM debugging |
| 1043 | information. In particular, it shows how the various intrinsics are applied |
| 1044 | together to allow a debugger to analyze the relationship between statements, |
| 1045 | variable definitions, and the code used to implement the function.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1046 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1047 | <p>The first |
| 1048 | intrinsic <tt>%<a href="#format_common_func_start">llvm.dbg.func.start</a></tt> |
| 1049 | provides a link with the <a href="#format_subprograms">subprogram |
| 1050 | descriptor</a> containing the details of this function. This call also |
| 1051 | defines the beginning of the function region, bounded by |
| 1052 | the <tt>%<a href="#format_common_region_end">llvm.region.end</a></tt> at the |
| 1053 | end of the function. This region is used to bracket the lifetime of |
| 1054 | variables declared within. For a function, this outer region defines a new |
| 1055 | stack frame whose lifetime ends when the region is ended.</p> |
| 1056 | |
| 1057 | <p>It is possible to define inner regions for short term variables by using the |
| 1058 | %<a href="#format_common_stoppoint"><tt>llvm.region.start</tt></a> |
| 1059 | and <a href="#format_common_region_end"><tt>%llvm.region.end</tt></a> to |
| 1060 | bound a region. The inner region in this example would be for the block |
| 1061 | containing the declaration of Z.</p> |
| 1062 | |
| 1063 | <p>Using regions to represent the boundaries of source-level functions allow |
| 1064 | LLVM interprocedural optimizations to arbitrarily modify LLVM functions |
| 1065 | without having to worry about breaking mapping information between the LLVM |
| 1066 | code and the and source-level program. In particular, the inliner requires |
| 1067 | no modification to support inlining with debugging information: there is no |
| 1068 | explicit correlation drawn between LLVM functions and their source-level |
| 1069 | counterparts (note however, that if the inliner inlines all instances of a |
| 1070 | non-strong-linkage function into its caller that it will not be possible for |
| 1071 | the user to manually invoke the inlined function from a debugger).</p> |
| 1072 | |
| 1073 | <p>Once the function has been defined, |
| 1074 | the <a href="#format_common_stoppoint"><tt>stopping point</tt></a> |
| 1075 | corresponding to line #2 (column #2) of the function is encountered. At this |
| 1076 | point in the function, <b>no</b> local variables are live. As lines 2 and 3 |
| 1077 | of the example are executed, their variable definitions are introduced into |
| 1078 | the program using |
| 1079 | %<a href="#format_common_declare"><tt>llvm.dbg.declare</tt></a>, without the |
| 1080 | need to specify a new region. These variables do not require new regions to |
| 1081 | be introduced because they go out of scope at the same point in the program: |
| 1082 | line 9.</p> |
| 1083 | |
| 1084 | <p>In contrast, the <tt>Z</tt> variable goes out of scope at a different time, |
| 1085 | on line 7. For this reason, it is defined within the inner region, which |
| 1086 | kills the availability of <tt>Z</tt> before the code for line 8 is executed. |
| 1087 | In this way, regions can support arbitrary source-language scoping rules, as |
| 1088 | long as they can only be nested (ie, one scope cannot partially overlap with |
| 1089 | a part of another scope).</p> |
| 1090 | |
| 1091 | <p>It is worth noting that this scoping mechanism is used to control scoping of |
| 1092 | all declarations, not just variable declarations. For example, the scope of |
| 1093 | a C++ using declaration is controlled with this and could change how name |
| 1094 | lookup is performed.</p> |
| 1095 | |
| 1096 | </div> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1097 | |
| 1098 | <!-- *********************************************************************** --> |
| 1099 | <div class="doc_section"> |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1100 | <a name="ccxx_frontend">C/C++ front-end specific debug information</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1101 | </div> |
Misha Brukman | 94218a7 | 2004-12-09 20:27:37 +0000 | [diff] [blame] | 1102 | <!-- *********************************************************************** --> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1103 | |
| 1104 | <div class="doc_text"> |
| 1105 | |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1106 | <p>The C and C++ front-ends represent information about the program in a format |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1107 | that is effectively identical |
| 1108 | to <a href="http://www.eagercon.com/dwarf/dwarf3std.htm">DWARF 3.0</a> in |
| 1109 | terms of information content. This allows code generators to trivially |
| 1110 | support native debuggers by generating standard dwarf information, and |
| 1111 | contains enough information for non-dwarf targets to translate it as |
| 1112 | needed.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1113 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1114 | <p>This section describes the forms used to represent C and C++ programs. Other |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1115 | languages could pattern themselves after this (which itself is tuned to |
| 1116 | representing programs in the same way that DWARF 3 does), or they could |
| 1117 | choose to provide completely different forms if they don't fit into the DWARF |
| 1118 | model. As support for debugging information gets added to the various LLVM |
| 1119 | source-language front-ends, the information used should be documented |
| 1120 | here.</p> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1121 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1122 | <p>The following sections provide examples of various C/C++ constructs and the |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1123 | debug information that would best describe those constructs.</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1124 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1125 | </div> |
| 1126 | |
| 1127 | <!-- ======================================================================= --> |
| 1128 | <div class="doc_subsection"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1129 | <a name="ccxx_compile_units">C/C++ source file information</a> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1130 | </div> |
| 1131 | |
| 1132 | <div class="doc_text"> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1133 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1134 | <p>Given the source files <tt>MySource.cpp</tt> and <tt>MyHeader.h</tt> located |
| 1135 | in the directory <tt>/Users/mine/sources</tt>, the following code:</p> |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1136 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1137 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1138 | <pre> |
| 1139 | #include "MyHeader.h" |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1140 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1141 | int main(int argc, char *argv[]) { |
| 1142 | return 0; |
| 1143 | } |
| 1144 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1145 | </div> |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1146 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1147 | <p>a C/C++ front-end would generate the following descriptors:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1148 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1149 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1150 | <pre> |
| 1151 | ... |
| 1152 | ;; |
| 1153 | ;; Define types used. In this case we need one for compile unit anchors and one |
| 1154 | ;; for compile units. |
| 1155 | ;; |
| 1156 | %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint } |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1157 | %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = type { uint, { }*, uint, uint, i8*, i8*, i8* } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1158 | ... |
| 1159 | ;; |
| 1160 | ;; Define the anchor for compile units. Note that the second field of the |
| 1161 | ;; anchor is 17, which is the same as the tag for compile units |
| 1162 | ;; (17 = DW_TAG_compile_unit.) |
| 1163 | ;; |
| 1164 | %<a href="#format_compile_units">llvm.dbg.compile_units</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 17 }, section "llvm.metadata" |
| 1165 | |
| 1166 | ;; |
| 1167 | ;; Define the compile unit for the source file "/Users/mine/sources/MySource.cpp". |
| 1168 | ;; |
| 1169 | %<a href="#format_compile_units">llvm.dbg.compile_unit1</a> = internal constant %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1170 | uint add(uint 17, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1171 | { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to { }*), |
| 1172 | uint 1, |
| 1173 | uint 1, |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1174 | i8* getelementptr ([13 x i8]* %str1, i32 0, i32 0), |
| 1175 | i8* getelementptr ([21 x i8]* %str2, i32 0, i32 0), |
| 1176 | i8* getelementptr ([33 x i8]* %str3, i32 0, i32 0) }, section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1177 | |
| 1178 | ;; |
| 1179 | ;; Define the compile unit for the header file "/Users/mine/sources/MyHeader.h". |
| 1180 | ;; |
| 1181 | %<a href="#format_compile_units">llvm.dbg.compile_unit2</a> = internal constant %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1182 | uint add(uint 17, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1183 | { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to { }*), |
| 1184 | uint 1, |
| 1185 | uint 1, |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1186 | i8* getelementptr ([11 x i8]* %str4, int 0, int 0), |
| 1187 | i8* getelementptr ([21 x i8]* %str2, int 0, int 0), |
| 1188 | i8* getelementptr ([33 x i8]* %str3, int 0, int 0) }, section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1189 | |
| 1190 | ;; |
| 1191 | ;; Define each of the strings used in the compile units. |
| 1192 | ;; |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1193 | %str1 = internal constant [13 x i8] c"MySource.cpp\00", section "llvm.metadata"; |
| 1194 | %str2 = internal constant [21 x i8] c"/Users/mine/sources/\00", section "llvm.metadata"; |
| 1195 | %str3 = internal constant [33 x i8] c"4.0.1 LLVM (LLVM research group)\00", section "llvm.metadata"; |
| 1196 | %str4 = internal constant [11 x i8] c"MyHeader.h\00", section "llvm.metadata"; |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1197 | ... |
| 1198 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1199 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1200 | |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1201 | </div> |
| 1202 | |
| 1203 | <!-- ======================================================================= --> |
| 1204 | <div class="doc_subsection"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1205 | <a name="ccxx_global_variable">C/C++ global variable information</a> |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1206 | </div> |
| 1207 | |
| 1208 | <div class="doc_text"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1209 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1210 | <p>Given an integer global variable declared as follows:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1211 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1212 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1213 | <pre> |
| 1214 | int MyGlobal = 100; |
| 1215 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1216 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1217 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1218 | <p>a C/C++ front-end would generate the following descriptors:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1219 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1220 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1221 | <pre> |
| 1222 | ;; |
| 1223 | ;; Define types used. One for global variable anchors, one for the global |
| 1224 | ;; variable descriptor, one for the global's basic type and one for the global's |
| 1225 | ;; compile unit. |
| 1226 | ;; |
| 1227 | %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint } |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1228 | %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type { uint, { }*, { }*, i8*, { }*, uint, { }*, bool, bool, { }*, uint } |
| 1229 | %<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type { uint, { }*, i8*, { }*, int, uint, uint, uint, uint } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1230 | %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ... |
| 1231 | ... |
| 1232 | ;; |
| 1233 | ;; Define the global itself. |
| 1234 | ;; |
| 1235 | %MyGlobal = global int 100 |
| 1236 | ... |
| 1237 | ;; |
| 1238 | ;; Define the anchor for global variables. Note that the second field of the |
| 1239 | ;; anchor is 52, which is the same as the tag for global variables |
| 1240 | ;; (52 = DW_TAG_variable.) |
| 1241 | ;; |
| 1242 | %<a href="#format_global_variables">llvm.dbg.global_variables</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 52 }, section "llvm.metadata" |
| 1243 | |
| 1244 | ;; |
| 1245 | ;; Define the global variable descriptor. Note the reference to the global |
| 1246 | ;; variable anchor and the global variable itself. |
| 1247 | ;; |
| 1248 | %<a href="#format_global_variables">llvm.dbg.global_variable</a> = internal constant %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1249 | uint add(uint 52, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1250 | { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_global_variables">llvm.dbg.global_variables</a> to { }*), |
| 1251 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1252 | i8* getelementptr ([9 x i8]* %str1, int 0, int 0), |
| 1253 | i8* getelementptr ([1 x i8]* %str2, int 0, int 0), |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 1254 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1255 | uint 1, |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1256 | { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*), |
| 1257 | bool false, |
| 1258 | bool true, |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 1259 | { }* cast (int* %MyGlobal to { }*) }, section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1260 | |
| 1261 | ;; |
| 1262 | ;; Define the basic type of 32 bit signed integer. Note that since int is an |
| 1263 | ;; intrinsic type the source file is NULL and line 0. |
| 1264 | ;; |
| 1265 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1266 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1267 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1268 | i8* getelementptr ([4 x i8]* %str3, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1269 | { }* null, |
| 1270 | int 0, |
| 1271 | uint 32, |
| 1272 | uint 32, |
| 1273 | uint 0, |
| 1274 | uint 5 }, section "llvm.metadata" |
| 1275 | |
| 1276 | ;; |
| 1277 | ;; Define the names of the global variable and basic type. |
| 1278 | ;; |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1279 | %str1 = internal constant [9 x i8] c"MyGlobal\00", section "llvm.metadata" |
| 1280 | %str2 = internal constant [1 x i8] c"\00", section "llvm.metadata" |
| 1281 | %str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1282 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1283 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1284 | |
Chris Lattner | 8ff7590 | 2004-01-06 05:31:32 +0000 | [diff] [blame] | 1285 | </div> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1286 | |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1287 | <!-- ======================================================================= --> |
| 1288 | <div class="doc_subsection"> |
| 1289 | <a name="ccxx_subprogram">C/C++ function information</a> |
| 1290 | </div> |
| 1291 | |
| 1292 | <div class="doc_text"> |
| 1293 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1294 | <p>Given a function declared as follows:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1295 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1296 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1297 | <pre> |
| 1298 | int main(int argc, char *argv[]) { |
| 1299 | return 0; |
| 1300 | } |
| 1301 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1302 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1303 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1304 | <p>a C/C++ front-end would generate the following descriptors:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1305 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1306 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1307 | <pre> |
| 1308 | ;; |
| 1309 | ;; Define types used. One for subprogram anchors, one for the subprogram |
| 1310 | ;; descriptor, one for the global's basic type and one for the subprogram's |
| 1311 | ;; compile unit. |
| 1312 | ;; |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1313 | %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type { uint, { }*, { }*, i8*, { }*, bool, bool } |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1314 | %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint } |
| 1315 | %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ... |
| 1316 | |
| 1317 | ;; |
| 1318 | ;; Define the anchor for subprograms. Note that the second field of the |
| 1319 | ;; anchor is 46, which is the same as the tag for subprograms |
| 1320 | ;; (46 = DW_TAG_subprogram.) |
| 1321 | ;; |
| 1322 | %<a href="#format_subprograms">llvm.dbg.subprograms</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 46 }, section "llvm.metadata" |
| 1323 | |
| 1324 | ;; |
| 1325 | ;; Define the descriptor for the subprogram. TODO - more details. |
| 1326 | ;; |
| 1327 | %<a href="#format_subprograms">llvm.dbg.subprogram</a> = internal constant %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1328 | uint add(uint 46, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1329 | { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to { }*), |
| 1330 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1331 | i8* getelementptr ([5 x i8]* %str1, int 0, int 0), |
| 1332 | i8* getelementptr ([1 x i8]* %str2, int 0, int 0), |
Jim Laskey | 3d11bee | 2006-03-15 19:10:52 +0000 | [diff] [blame] | 1333 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1334 | uint 1, |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1335 | { }* null, |
| 1336 | bool false, |
Jim Laskey | 383e009 | 2006-03-23 17:54:33 +0000 | [diff] [blame] | 1337 | bool true }, section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1338 | |
| 1339 | ;; |
| 1340 | ;; Define the name of the subprogram. |
| 1341 | ;; |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1342 | %str1 = internal constant [5 x i8] c"main\00", section "llvm.metadata" |
| 1343 | %str2 = internal constant [1 x i8] c"\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1344 | |
| 1345 | ;; |
| 1346 | ;; Define the subprogram itself. |
| 1347 | ;; |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1348 | int %main(int %argc, i8** %argv) { |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1349 | ... |
| 1350 | } |
| 1351 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1352 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1353 | |
| 1354 | </div> |
| 1355 | |
| 1356 | <!-- ======================================================================= --> |
| 1357 | <div class="doc_subsection"> |
| 1358 | <a name="ccxx_basic_types">C/C++ basic types</a> |
| 1359 | </div> |
| 1360 | |
| 1361 | <div class="doc_text"> |
| 1362 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1363 | <p>The following are the basic type descriptors for C/C++ core types:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1364 | |
| 1365 | </div> |
| 1366 | |
| 1367 | <!-- ======================================================================= --> |
| 1368 | <div class="doc_subsubsection"> |
| 1369 | <a name="ccxx_basic_type_bool">bool</a> |
| 1370 | </div> |
| 1371 | |
| 1372 | <div class="doc_text"> |
| 1373 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1374 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1375 | <pre> |
| 1376 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1377 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1378 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1379 | i8* getelementptr ([5 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1380 | { }* null, |
| 1381 | int 0, |
| 1382 | uint 32, |
| 1383 | uint 32, |
| 1384 | uint 0, |
| 1385 | uint 2 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1386 | %str1 = internal constant [5 x i8] c"bool\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1387 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1388 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1389 | |
| 1390 | </div> |
| 1391 | |
| 1392 | <!-- ======================================================================= --> |
| 1393 | <div class="doc_subsubsection"> |
| 1394 | <a name="ccxx_basic_char">char</a> |
| 1395 | </div> |
| 1396 | |
| 1397 | <div class="doc_text"> |
| 1398 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1399 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1400 | <pre> |
| 1401 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1402 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1403 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1404 | i8* getelementptr ([5 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1405 | { }* null, |
| 1406 | int 0, |
| 1407 | uint 8, |
| 1408 | uint 8, |
| 1409 | uint 0, |
| 1410 | uint 6 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1411 | %str1 = internal constant [5 x i8] c"char\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1412 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1413 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1414 | |
| 1415 | </div> |
| 1416 | |
| 1417 | <!-- ======================================================================= --> |
| 1418 | <div class="doc_subsubsection"> |
| 1419 | <a name="ccxx_basic_unsigned_char">unsigned char</a> |
| 1420 | </div> |
| 1421 | |
| 1422 | <div class="doc_text"> |
| 1423 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1424 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1425 | <pre> |
| 1426 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1427 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1428 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1429 | i8* getelementptr ([14 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1430 | { }* null, |
| 1431 | int 0, |
| 1432 | uint 8, |
| 1433 | uint 8, |
| 1434 | uint 0, |
| 1435 | uint 8 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1436 | %str1 = internal constant [14 x i8] c"unsigned char\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1437 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1438 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1439 | |
| 1440 | </div> |
| 1441 | |
| 1442 | <!-- ======================================================================= --> |
| 1443 | <div class="doc_subsubsection"> |
| 1444 | <a name="ccxx_basic_short">short</a> |
| 1445 | </div> |
| 1446 | |
| 1447 | <div class="doc_text"> |
| 1448 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1449 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1450 | <pre> |
| 1451 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1452 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1453 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1454 | i8* getelementptr ([10 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1455 | { }* null, |
| 1456 | int 0, |
| 1457 | uint 16, |
| 1458 | uint 16, |
| 1459 | uint 0, |
| 1460 | uint 5 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1461 | %str1 = internal constant [10 x i8] c"short int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1462 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1463 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1464 | |
| 1465 | </div> |
| 1466 | |
| 1467 | <!-- ======================================================================= --> |
| 1468 | <div class="doc_subsubsection"> |
| 1469 | <a name="ccxx_basic_unsigned_short">unsigned short</a> |
| 1470 | </div> |
| 1471 | |
| 1472 | <div class="doc_text"> |
| 1473 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1474 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1475 | <pre> |
| 1476 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1477 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1478 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1479 | i8* getelementptr ([19 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1480 | { }* null, |
| 1481 | int 0, |
| 1482 | uint 16, |
| 1483 | uint 16, |
| 1484 | uint 0, |
| 1485 | uint 7 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1486 | %str1 = internal constant [19 x i8] c"short unsigned int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1487 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1488 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1489 | |
| 1490 | </div> |
| 1491 | |
| 1492 | <!-- ======================================================================= --> |
| 1493 | <div class="doc_subsubsection"> |
| 1494 | <a name="ccxx_basic_int">int</a> |
| 1495 | </div> |
| 1496 | |
| 1497 | <div class="doc_text"> |
| 1498 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1499 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1500 | <pre> |
| 1501 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1502 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1503 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1504 | i8* getelementptr ([4 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1505 | { }* null, |
| 1506 | int 0, |
| 1507 | uint 32, |
| 1508 | uint 32, |
| 1509 | uint 0, |
| 1510 | uint 5 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1511 | %str1 = internal constant [4 x i8] c"int\00", section "llvm.metadata" |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1512 | </pre></div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1513 | |
| 1514 | </div> |
| 1515 | |
| 1516 | <!-- ======================================================================= --> |
| 1517 | <div class="doc_subsubsection"> |
| 1518 | <a name="ccxx_basic_unsigned_int">unsigned int</a> |
| 1519 | </div> |
| 1520 | |
| 1521 | <div class="doc_text"> |
| 1522 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1523 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1524 | <pre> |
| 1525 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1526 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1527 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1528 | i8* getelementptr ([13 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1529 | { }* null, |
| 1530 | int 0, |
| 1531 | uint 32, |
| 1532 | uint 32, |
| 1533 | uint 0, |
| 1534 | uint 7 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1535 | %str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1536 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1537 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1538 | |
| 1539 | </div> |
| 1540 | |
| 1541 | <!-- ======================================================================= --> |
| 1542 | <div class="doc_subsubsection"> |
| 1543 | <a name="ccxx_basic_long_long">long long</a> |
| 1544 | </div> |
| 1545 | |
| 1546 | <div class="doc_text"> |
| 1547 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1548 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1549 | <pre> |
| 1550 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1551 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1552 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1553 | i8* getelementptr ([14 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1554 | { }* null, |
| 1555 | int 0, |
| 1556 | uint 64, |
| 1557 | uint 64, |
| 1558 | uint 0, |
| 1559 | uint 5 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1560 | %str1 = internal constant [14 x i8] c"long long int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1561 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1562 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1563 | |
| 1564 | </div> |
| 1565 | |
| 1566 | <!-- ======================================================================= --> |
| 1567 | <div class="doc_subsubsection"> |
| 1568 | <a name="ccxx_basic_unsigned_long_long">unsigned long long</a> |
| 1569 | </div> |
| 1570 | |
| 1571 | <div class="doc_text"> |
| 1572 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1573 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1574 | <pre> |
| 1575 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1576 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1577 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1578 | i8* getelementptr ([23 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1579 | { }* null, |
| 1580 | int 0, |
| 1581 | uint 64, |
| 1582 | uint 64, |
| 1583 | uint 0, |
| 1584 | uint 7 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1585 | %str1 = internal constant [23 x 8] c"long long unsigned int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1586 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1587 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1588 | |
| 1589 | </div> |
| 1590 | |
| 1591 | <!-- ======================================================================= --> |
| 1592 | <div class="doc_subsubsection"> |
| 1593 | <a name="ccxx_basic_float">float</a> |
| 1594 | </div> |
| 1595 | |
| 1596 | <div class="doc_text"> |
| 1597 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1598 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1599 | <pre> |
| 1600 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1601 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1602 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1603 | i8* getelementptr ([6 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1604 | { }* null, |
| 1605 | int 0, |
| 1606 | uint 32, |
| 1607 | uint 32, |
| 1608 | uint 0, |
| 1609 | uint 4 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1610 | %str1 = internal constant [6 x i8] c"float\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1611 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1612 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1613 | |
| 1614 | </div> |
| 1615 | |
| 1616 | <!-- ======================================================================= --> |
| 1617 | <div class="doc_subsubsection"> |
| 1618 | <a name="ccxx_basic_double">double</a> |
| 1619 | </div> |
| 1620 | |
| 1621 | <div class="doc_text"> |
| 1622 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1623 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1624 | <pre> |
| 1625 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1626 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1627 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1628 | 8* getelementptr ([7 x 8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1629 | { }* null, |
| 1630 | int 0, |
| 1631 | uint 64, |
| 1632 | uint 64, |
| 1633 | uint 0, |
| 1634 | uint 4 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1635 | %str1 = internal constant [7 x 8] c"double\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1636 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1637 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1638 | |
| 1639 | </div> |
| 1640 | |
| 1641 | <!-- ======================================================================= --> |
| 1642 | <div class="doc_subsection"> |
| 1643 | <a name="ccxx_derived_types">C/C++ derived types</a> |
| 1644 | </div> |
| 1645 | |
| 1646 | <div class="doc_text"> |
| 1647 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1648 | <p>Given the following as an example of C/C++ derived type:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1649 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1650 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1651 | <pre> |
| 1652 | typedef const int *IntPtr; |
| 1653 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1654 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1655 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1656 | <p>a C/C++ front-end would generate the following descriptors:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1657 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1658 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1659 | <pre> |
| 1660 | ;; |
| 1661 | ;; Define the typedef "IntPtr". |
| 1662 | ;; |
| 1663 | %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1664 | uint add(uint 22, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1665 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1666 | i8* getelementptr ([7 x 8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1667 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1668 | int 1, |
| 1669 | uint 0, |
| 1670 | uint 0, |
| 1671 | uint 0, |
| 1672 | { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*) }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1673 | %str1 = internal constant [7 x 8] c"IntPtr\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1674 | |
| 1675 | ;; |
| 1676 | ;; Define the pointer type. |
| 1677 | ;; |
| 1678 | %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1679 | uint add(uint 15, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1680 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1681 | i8* null, |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1682 | { }* null, |
| 1683 | int 0, |
| 1684 | uint 32, |
| 1685 | uint 32, |
| 1686 | uint 0, |
| 1687 | { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) }, section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1688 | |
| 1689 | ;; |
| 1690 | ;; Define the const type. |
| 1691 | ;; |
| 1692 | %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1693 | uint add(uint 38, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1694 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1695 | i8* null, |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1696 | { }* null, |
| 1697 | int 0, |
| 1698 | uint 0, |
| 1699 | uint 0, |
| 1700 | uint 0, |
| 1701 | { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype1</a> to { }*) }, section "llvm.metadata" |
| 1702 | |
| 1703 | ;; |
| 1704 | ;; Define the int type. |
| 1705 | ;; |
| 1706 | %<a href="#format_basic_type">llvm.dbg.basictype1</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1707 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1708 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1709 | 8* getelementptr ([4 x 8]* %str2, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1710 | { }* null, |
| 1711 | int 0, |
| 1712 | uint 32, |
| 1713 | uint 32, |
| 1714 | uint 0, |
| 1715 | uint 5 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1716 | %str2 = internal constant [4 x 8] c"int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1717 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1718 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1719 | |
| 1720 | </div> |
| 1721 | |
| 1722 | <!-- ======================================================================= --> |
| 1723 | <div class="doc_subsection"> |
| 1724 | <a name="ccxx_composite_types">C/C++ struct/union types</a> |
| 1725 | </div> |
| 1726 | |
| 1727 | <div class="doc_text"> |
| 1728 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1729 | <p>Given the following as an example of C/C++ struct type:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1730 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1731 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1732 | <pre> |
| 1733 | struct Color { |
| 1734 | unsigned Red; |
| 1735 | unsigned Green; |
| 1736 | unsigned Blue; |
| 1737 | }; |
| 1738 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1739 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1740 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1741 | <p>a C/C++ front-end would generate the following descriptors:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1742 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1743 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1744 | <pre> |
| 1745 | ;; |
| 1746 | ;; Define basic type for unsigned int. |
| 1747 | ;; |
| 1748 | %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1749 | uint add(uint 36, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1750 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1751 | i8* getelementptr ([13 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1752 | { }* null, |
| 1753 | int 0, |
| 1754 | uint 32, |
| 1755 | uint 32, |
| 1756 | uint 0, |
| 1757 | uint 7 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1758 | %str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1759 | |
| 1760 | ;; |
| 1761 | ;; Define composite type for struct Color. |
| 1762 | ;; |
| 1763 | %<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1764 | uint add(uint 19, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1765 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1766 | i8* getelementptr ([6 x i8]* %str2, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1767 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1768 | int 1, |
| 1769 | uint 96, |
| 1770 | uint 32, |
| 1771 | uint 0, |
Jim Laskey | f8a01a9 | 2006-06-15 20:51:43 +0000 | [diff] [blame] | 1772 | { }* null, |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1773 | { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1774 | %str2 = internal constant [6 x i8] c"Color\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1775 | |
| 1776 | ;; |
| 1777 | ;; Define the Red field. |
| 1778 | ;; |
| 1779 | %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1780 | uint add(uint 13, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1781 | { }* null, |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1782 | i8* getelementptr ([4 x i8]* %str3, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1783 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1784 | int 2, |
| 1785 | uint 32, |
| 1786 | uint 32, |
| 1787 | uint 0, |
| 1788 | { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1789 | %str3 = internal constant [4 x i8] c"Red\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1790 | |
| 1791 | ;; |
| 1792 | ;; Define the Green field. |
| 1793 | ;; |
| 1794 | %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1795 | uint add(uint 13, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1796 | { }* null, |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1797 | i8* getelementptr ([6 x i8]* %str4, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1798 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1799 | int 3, |
| 1800 | uint 32, |
| 1801 | uint 32, |
| 1802 | uint 32, |
| 1803 | { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1804 | %str4 = internal constant [6 x i8] c"Green\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1805 | |
| 1806 | ;; |
| 1807 | ;; Define the Blue field. |
| 1808 | ;; |
| 1809 | %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1810 | uint add(uint 13, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1811 | { }* null, |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1812 | i8* getelementptr ([5 x i8]* %str5, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1813 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1814 | int 4, |
| 1815 | uint 32, |
| 1816 | uint 32, |
| 1817 | uint 64, |
| 1818 | { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1819 | %str5 = internal constant [5 x 8] c"Blue\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1820 | |
| 1821 | ;; |
| 1822 | ;; Define the array of fields used by the composite type Color. |
| 1823 | ;; |
| 1824 | %llvm.dbg.array = internal constant [3 x { }*] [ |
| 1825 | { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> to { }*), |
| 1826 | { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*), |
| 1827 | { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) ], section "llvm.metadata" |
| 1828 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1829 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1830 | |
| 1831 | </div> |
| 1832 | |
| 1833 | <!-- ======================================================================= --> |
| 1834 | <div class="doc_subsection"> |
| 1835 | <a name="ccxx_enumeration_types">C/C++ enumeration types</a> |
| 1836 | </div> |
| 1837 | |
| 1838 | <div class="doc_text"> |
| 1839 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1840 | <p>Given the following as an example of C/C++ enumeration type:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1841 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1842 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1843 | <pre> |
| 1844 | enum Trees { |
| 1845 | Spruce = 100, |
| 1846 | Oak = 200, |
| 1847 | Maple = 300 |
| 1848 | }; |
| 1849 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1850 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1851 | |
Misha Brukman | 96e0081 | 2008-12-16 02:54:22 +0000 | [diff] [blame] | 1852 | <p>a C/C++ front-end would generate the following descriptors:</p> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1853 | |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1854 | <div class="doc_code"> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1855 | <pre> |
| 1856 | ;; |
| 1857 | ;; Define composite type for enum Trees |
| 1858 | ;; |
| 1859 | %<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1860 | uint add(uint 4, uint 262144), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1861 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1862 | i8* getelementptr ([6 x i8]* %str1, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1863 | { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*), |
| 1864 | int 1, |
| 1865 | uint 32, |
| 1866 | uint 32, |
| 1867 | uint 0, |
| 1868 | { }* null, |
| 1869 | { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1870 | %str1 = internal constant [6 x i8] c"Trees\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1871 | |
| 1872 | ;; |
| 1873 | ;; Define Spruce enumerator. |
| 1874 | ;; |
| 1875 | %<a href="#format_enumeration">llvm.dbg.enumerator1</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1876 | uint add(uint 40, uint 262144), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1877 | i8* getelementptr ([7 x i8]* %str2, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1878 | int 100 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1879 | %str2 = internal constant [7 x i8] c"Spruce\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1880 | |
| 1881 | ;; |
| 1882 | ;; Define Oak enumerator. |
| 1883 | ;; |
| 1884 | %<a href="#format_enumeration">llvm.dbg.enumerator2</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1885 | uint add(uint 40, uint 262144), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1886 | i8* getelementptr ([4 x i8]* %str3, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1887 | int 200 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1888 | %str3 = internal constant [4 x i8] c"Oak\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1889 | |
| 1890 | ;; |
| 1891 | ;; Define Maple enumerator. |
| 1892 | ;; |
| 1893 | %<a href="#format_enumeration">llvm.dbg.enumerator3</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> { |
Jim Laskey | 7089f45 | 2006-06-16 13:14:03 +0000 | [diff] [blame] | 1894 | uint add(uint 40, uint 262144), |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1895 | i8* getelementptr ([6 x i8]* %str4, int 0, int 0), |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1896 | int 300 }, section "llvm.metadata" |
Chris Lattner | f436fed | 2009-04-03 00:29:19 +0000 | [diff] [blame] | 1897 | %str4 = internal constant [6 x i8] c"Maple\00", section "llvm.metadata" |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1898 | |
| 1899 | ;; |
| 1900 | ;; Define the array of enumerators used by composite type Trees. |
| 1901 | ;; |
| 1902 | %llvm.dbg.array = internal constant [3 x { }*] [ |
| 1903 | { }* cast (%<a href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a href="#format_enumeration">llvm.dbg.enumerator1</a> to { }*), |
| 1904 | { }* cast (%<a href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a href="#format_enumeration">llvm.dbg.enumerator2</a> to { }*), |
| 1905 | { }* cast (%<a href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a href="#format_enumeration">llvm.dbg.enumerator3</a> to { }*) ], section "llvm.metadata" |
| 1906 | </pre> |
Bill Wendling | 48839d9 | 2009-05-17 05:52:39 +0000 | [diff] [blame^] | 1907 | </div> |
Jim Laskey | cec12a5 | 2006-03-14 18:08:46 +0000 | [diff] [blame] | 1908 | |
| 1909 | </div> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1910 | |
| 1911 | <!-- *********************************************************************** --> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1912 | |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1913 | <hr> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1914 | <address> |
| 1915 | <a href="http://jigsaw.w3.org/css-validator/check/referer"><img |
Misha Brukman | 4440870 | 2008-12-11 17:34:48 +0000 | [diff] [blame] | 1916 | src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1917 | <a href="http://validator.w3.org/check/referer"><img |
Misha Brukman | 4440870 | 2008-12-11 17:34:48 +0000 | [diff] [blame] | 1918 | src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a> |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1919 | |
| 1920 | <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> |
Reid Spencer | 05fe4b0 | 2006-03-14 05:39:39 +0000 | [diff] [blame] | 1921 | <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1922 | Last modified: $Date$ |
Misha Brukman | 8287373 | 2004-05-12 19:21:57 +0000 | [diff] [blame] | 1923 | </address> |
Chris Lattner | bdfb339 | 2004-01-05 05:06:33 +0000 | [diff] [blame] | 1924 | |
| 1925 | </body> |
| 1926 | </html> |