[llvm-commits] [llvm] r79977 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Support/ lib/Analysis/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/PIC16/ lib/Transforms/IPO/ lib/Transforms/Utils/ lib/VMCore/ test/DebugInfo/ test/FrontendC++/ test/FrontendObjC/ test/Transforms/SimplifyCFG/
Evan Cheng
evan.cheng at apple.com
Tue Aug 25 23:47:22 PDT 2009
On Aug 24, 2009, at 10:24 PM, Devang Patel wrote:
> Author: dpatel
> Date: Tue Aug 25 00:24:07 2009
> New Revision: 79977
>
> URL: http://llvm.org/viewvc/llvm-project?rev=79977&view=rev
> Log:
> Update DebugInfo interface to use metadata, instead of special named
> llvm.dbg.... global variables, to encode debugging information in
> llvm IR. This is mostly a mechanical change that tests metadata
> support very well.
>
> This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured
> by compiling InstructionCombining.cpp!)
Very nice!
Evan
>
> Removed:
> llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll
> llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll
> llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll
> llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll
> llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll
> llvm/trunk/test/DebugInfo/2009-01-30-Method.ll
> llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll
> llvm/trunk/test/DebugInfo/2009-03-02-sink.ll
> llvm/trunk/test/DebugInfo/dataOnly.ll
> llvm/trunk/test/DebugInfo/forwardDecl.ll
> llvm/trunk/test/DebugInfo/printdbginfo.ll
> llvm/trunk/test/DebugInfo/printdbginfo2.ll
> llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp
> llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m
> Modified:
> llvm/trunk/docs/SourceLevelDebugging.html
> llvm/trunk/include/llvm/Analysis/DebugInfo.h
> llvm/trunk/include/llvm/AutoUpgrade.h
> llvm/trunk/include/llvm/CodeGen/DwarfWriter.h
> llvm/trunk/include/llvm/CodeGen/MachineFunction.h
> llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
> llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
> llvm/trunk/include/llvm/IntrinsicInst.h
> llvm/trunk/include/llvm/Intrinsics.td
> llvm/trunk/include/llvm/Metadata.h
> llvm/trunk/include/llvm/Support/DebugLoc.h
> llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp
> llvm/trunk/lib/Analysis/DebugInfo.cpp
> llvm/trunk/lib/AsmParser/LLParser.cpp
> llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
> llvm/trunk/lib/CodeGen/MachineFunction.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp
> llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h
> llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
> llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
> llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
> llvm/trunk/lib/VMCore/AutoUpgrade.cpp
> llvm/trunk/lib/VMCore/Metadata.cpp
> llvm/trunk/lib/VMCore/ValueTypes.cpp
> llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll
>
> Modified: llvm/trunk/docs/SourceLevelDebugging.html
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.html?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/docs/SourceLevelDebugging.html (original)
> +++ llvm/trunk/docs/SourceLevelDebugging.html Tue Aug 25 00:24:07 2009
> @@ -122,8 +122,8 @@
> <p>The approach used by the LLVM implementation is to use a small set
> of <a href="#format_common_intrinsics">intrinsic functions</a> to
> define a
> mapping between LLVM program objects and the source-level
> objects. The
> - description of the source-level program is maintained in LLVM
> global
> - variables in an <a href="#ccxx_frontend">implementation-defined
> format</a>
> + description of the source-level program is maintained in LLVM
> metadata
> + in an <a href="#ccxx_frontend">implementation-defined format</a>
> (the C/C++ front-end currently uses working draft 7 of
> the <a href="http://www.eagercon.com/dwarf/dwarf3std.htm">DWARF 3
> standard</a>).</p>
> @@ -240,31 +240,21 @@
> <p>LLVM debugging information has been carefully designed to make it
> possible
> for the optimizer to optimize the program and debugging
> information without
> necessarily having to know anything about debugging information.
> In
> - particular, the global constant merging pass automatically
> eliminates
> - duplicated debugging information (often caused by header files),
> the global
> - dead code elimination pass automatically deletes debugging
> information for a
> - function if it decides to delete the function, and the linker
> eliminates
> - debug information when it merges <tt>linkonce</tt> functions.</p>
> + particular, te use of metadadta avoids duplicated dubgging
> information from
> + the beginning, and the global dead code elimination pass
> automatically
> + deletes debugging information for a function if it decides to
> delete the
> + function. </p>
>
> <p>To do this, most of the debugging information (descriptors for
> types,
> variables, functions, source files, etc) is inserted by the
> language
> - front-end in the form of LLVM global variables. These LLVM
> global variables
> - are no different from any other global variables, except that
> they have a web
> - of LLVM intrinsic functions that point to them. If the last
> references to a
> - particular piece of debugging information are deleted (for
> example, by the
> - <tt>-globaldce</tt> pass), the extraneous debug information will
> - automatically become dead and be removed by the optimizer.</p>
> + front-end in the form of LLVM metadata. </p>
>
> <p>Debug information is designed to be agnostic about the target
> debugger and
> debugging information representation (e.g. DWARF/Stabs/etc). It
> uses a
> - generic machine debug information pass to decode the information
> that
> - represents variables, types, functions, namespaces, etc: this
> allows for
> - arbitrary source-language semantics and type-systems to be used,
> as long as
> - there is a module written for the target debugger to interpret the
> - information. In addition, debug global variables are declared in
> - the <tt>"llvm.metadata"</tt> section. All values declared in
> this section
> - are stripped away after target debug information is constructed
> and before
> - the program object is emitted.</p>
> + generic pass to decode the information that represents
> variables, types,
> + functions, namespaces, etc: this allows for arbitrary source-
> language
> + semantics and type-systems to be used, as long as there is a
> module
> + written for the target debugger to interpret the information. </p>
>
> <p>To provide basic functionality, the LLVM debugger does have to
> make some
> assumptions about the source-level language being debugged,
> though it keeps
> @@ -288,9 +278,7 @@
> <div class="doc_text">
>
> <p>In consideration of the complexity and volume of debug
> information, LLVM
> - provides a specification for well formed debug global
> variables. The
> - constant value of each of these globals is one of a limited set of
> - structures, known as debug descriptors.</p>
> + provides a specification for well formed debug descriptors. </p>
>
> <p>Consumers of LLVM debug information expect the descriptors for
> program
> objects to start in a canonical format, but the descriptors can
> include
> @@ -303,17 +291,14 @@
> the range 0x1000 thru 0x2000 (there is a defined enum
> DW_TAG_user_base =
> 0x1000.)</p>
>
> -<p>The fields of debug descriptors used internally by LLVM
> (MachineModuleInfo)
> +<p>The fields of debug descriptors used internally by LLVM
> are restricted to only the simple data types <tt>int</tt>,
> <tt>uint</tt>,
> - <tt>bool</tt>, <tt>float</tt>, <tt>double</tt>, <tt>i8*</tt> and
> - <tt>{ }*</tt>. References to arbitrary values are handled
> using a
> - <tt>{ }*</tt> and a cast to <tt>{ }*</tt> expression;
> typically
> - references to other field descriptors, arrays of descriptors or
> global
> - variables.</p>
> + <tt>bool</tt>, <tt>float</tt>, <tt>double</tt>, <tt>mdstring</
> tt> and
> + <tt>mdnode</tt>. </p>
>
> <div class="doc_code">
> <pre>
> -%llvm.dbg.object.type = type {
> +!1 = metadata !{
> uint, ;; A tag
> ...
> }
> @@ -326,8 +311,8 @@
> of tags are loosely bound to the tag values of DWARF information
> entries.
> However, that does not restrict the use of the information
> supplied to DWARF
> targets. To facilitate versioning of debug information, the tag
> is augmented
> - with the current debug version (LLVMDebugVersion = 4 << 16 or
> 0x40000 or
> - 262144.)</a></p>
> + with the current debug version (LLVMDebugVersion = 7 << 16 or
> 0x70000 or
> + 458752.)</a></p>
>
> <p>The details of the various descriptors follow.</p>
>
> @@ -342,17 +327,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> =
> type {
> - i32, ;; Tag = 17 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_compile_unit)
> - { }*, ;; Compile unit anchor = cast = (%<a
> href="#format_anchors">llvm.dbg.anchor.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_units</a> to { }*)
> - i32, ;; DWARF language identifier (ex. DW_LANG_C89)
> - i8*, ;; Source file name
> - i8*, ;; Source file directory (includes trailing slash)
> - i8* ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
> - i1, ;; True if this is a main compile unit.
> - i1, ;; True if this is optimized.
> - i8*, ;; Flags
> - i32 ;; Runtime version
> +!0 = metadata !{
> + i32, ;; Tag = 17 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a>
> + ;; (DW_TAG_compile_unit)
> + i32, ;; Unused field.
> + i32, ;; DWARF language identifier (ex. DW_LANG_C89)
> + metadata, ;; Source file name
> + metadata, ;; Source file directory (includes trailing slash)
> + metadata ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
> + i1, ;; True if this is a main compile unit.
> + i1, ;; True if this is optimized.
> + metadata, ;; Flags
> + i32 ;; Runtime version
> }
> </pre>
> </div>
> @@ -388,19 +374,20 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_global_variables">llvm.dbg.global_variable.type</
> a> = type {
> - i32, ;; Tag = 52 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_variable)
> - { }*, ;; Global variable anchor = cast (%<a
> href="#format_anchors">llvm.dbg.anchor.type</a>* %<a
> href="#format_global_variables">llvm.dbg.global_variables</a> to { }
> *),
> - { }*, ;; Reference to context descriptor
> - i8*, ;; Name
> - i8*, ;; Display name (fully qualified C++ name)
> - i8*, ;; MIPS linkage name (for C++)
> - { }*, ;; Reference to compile unit where defined
> - i32, ;; Line number where defined
> - { }*, ;; Reference to type descriptor
> - i1, ;; True if the global is local to compile unit (static)
> - i1, ;; True if the global is defined in the compile unit (not
> extern)
> - { }* ;; Reference to the global variable
> +!1 = metadata !{
> + i32, ;; Tag = 52 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a>
> + ;; (DW_TAG_variable)
> + i32, ;; Unused field.
> + metadata, ;; Reference to context descriptor
> + metadata, ;; Name
> + metadata, ;; Display name (fully qualified C++ name)
> + metadata, ;; MIPS linkage name (for C++)
> + metadata, ;; Reference to compile unit where defined
> + i32, ;; Line number where defined
> + metadata, ;; Reference to type descriptor
> + i1, ;; True if the global is local to compile unit (static)
> + i1, ;; True if the global is defined in the compile unit
> (not extern)
> + { }* ;; Reference to the global variable
> }
> </pre>
> </div>
> @@ -419,18 +406,19 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type {
> - i32, ;; Tag = 46 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subprogram)
> - { }*, ;; Subprogram anchor = cast (%<a
> href="#format_anchors">llvm.dbg.anchor.type</a>* %<a
> href="#format_subprograms">llvm.dbg.subprograms</a> to { }*),
> - { }*, ;; Reference to context descriptor
> - i8*, ;; Name
> - i8*, ;; Display name (fully qualified C++ name)
> - i8*, ;; MIPS linkage name (for C++)
> - { }*, ;; Reference to compile unit where defined
> - i32, ;; Line number where defined
> - { }*, ;; Reference to type descriptor
> - i1, ;; True if the global is local to compile unit (static)
> - i1 ;; True if the global is defined in the compile unit (not
> extern)
> +!2 = metadata !{
> + i32, ;; Tag = 46 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a>
> + ;; (DW_TAG_subprogram)
> + i32, ;; Unused field.
> + metadata, ;; Reference to context descriptor
> + metadata, ;; Name
> + metadata, ;; Display name (fully qualified C++ name)
> + metadata, ;; MIPS linkage name (for C++)
> + metadata, ;; Reference to compile unit where defined
> + i32, ;; Line number where defined
> + metadata, ;; Reference to type descriptor
> + i1, ;; True if the global is local to compile unit (static)
> + i1 ;; True if the global is defined in the compile unit
> (not extern)
> }
> </pre>
> </div>
> @@ -450,9 +438,9 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_blocks">llvm.dbg.block</a> = type {
> - i32, ;; Tag = 13 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_lexical_block)
> - { }* ;; Reference to context descriptor
> +!3 = metadata !{
> + i32, ;; Tag = 13 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_lexical_block)
> + metadata ;; Reference to context descriptor
> }
> </pre>
> </div>
> @@ -472,17 +460,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type {
> - i32, ;; Tag = 36 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_base_type)
> - { }*, ;; Reference to context (typically a compile unit)
> - i8*, ;; Name (may be "" for anonymous types)
> - { }*, ;; Reference to compile unit where defined (may be NULL)
> - i32, ;; Line number where defined (may be 0)
> - i64, ;; Size in bits
> - i64, ;; Alignment in bits
> - i64, ;; Offset in bits
> - i32, ;; Flags
> - i32 ;; DWARF type encoding
> +!4 = metadata !{
> + i32, ;; Tag = 36 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a>
> + ;; (DW_TAG_base_type)
> + metadata, ;; Reference to context (typically a compile unit)
> + metadata, ;; Name (may be "" for anonymous types)
> + metadata, ;; Reference to compile unit where defined (may be NULL)
> + i32, ;; Line number where defined (may be 0)
> + i64, ;; Size in bits
> + i64, ;; Alignment in bits
> + i64, ;; Offset in bits
> + i32, ;; Flags
> + i32 ;; DWARF type encoding
> }
> </pre>
> </div>
> @@ -523,16 +512,16 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> =
> type {
> - i32, ;; Tag (see below)
> - { }*, ;; Reference to context
> - i8*, ;; Name (may be "" for anonymous types)
> - { }*, ;; Reference to compile unit where defined (may be NULL)
> - i32, ;; Line number where defined (may be 0)
> - i32, ;; Size in bits
> - i32, ;; Alignment in bits
> - i32, ;; Offset in bits
> - { }* ;; Reference to type derived from
> +!5 = metadata !{
> + i32, ;; Tag (see below)
> + metadata, ;; Reference to context
> + metadata, ;; Name (may be "" for anonymous types)
> + metadata, ;; Reference to compile unit where defined (may be NULL)
> + i32, ;; Line number where defined (may be 0)
> + i32, ;; Size in bits
> + i32, ;; Alignment in bits
> + i32, ;; Offset in bits
> + metadata ;; Reference to type derived from
> }
> </pre>
> </div>
> @@ -591,19 +580,19 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_composite_type">llvm.dbg.compositetype.type</a> =
> type {
> - i32, ;; Tag (see below)
> - { }*, ;; Reference to context
> - i8*, ;; Name (may be "" for anonymous types)
> - { }*, ;; Reference to compile unit where defined (may be NULL)
> - i32, ;; Line number where defined (may be 0)
> - i64, ;; Size in bits
> - i64, ;; Alignment in bits
> - i64, ;; Offset in bits
> - i32, ;; Flags
> - { }*, ;; Reference to type derived from
> - { }*, ;; Reference to array of member descriptors
> - i32 ;; Runtime languages
> +!6 = metadata !{
> + i32, ;; Tag (see below)
> + metadata, ;; Reference to context
> + metadata, ;; Name (may be "" for anonymous types)
> + metadata, ;; Reference to compile unit where defined (may be NULL)
> + i32, ;; Line number where defined (may be 0)
> + i64, ;; Size in bits
> + i64, ;; Alignment in bits
> + i64, ;; Offset in bits
> + i32, ;; Flags
> + metadata, ;; Reference to type derived from
> + metadata, ;; Reference to array of member descriptors
> + i32 ;; Runtime languages
> }
> </pre>
> </div>
> @@ -702,10 +691,11 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_enumeration">llvm.dbg.enumerator.type</a> = type {
> - i32, ;; Tag = 40 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_enumerator)
> - i8*, ;; Name
> - i64 ;; Value
> +!6 = metadata !{
> + i32, ;; Tag = 40 + <a
> href="#LLVMDebugVersion">LLVMDebugVersion</a>
> + ;; (DW_TAG_enumerator)
> + metadata, ;; Name
> + i64 ;; Value
> }
> </pre>
> </div>
> @@ -725,13 +715,13 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_variables">llvm.dbg.variable.type</a> = type {
> - i32, ;; Tag (see below)
> - { }*, ;; Context
> - i8*, ;; Name
> - { }*, ;; Reference to compile unit where defined
> - i32, ;; Line number where defined
> - { }* ;; Type descriptor
> +!7 = metadata !{
> + i32, ;; Tag (see below)
> + metadata, ;; Context
> + metadata, ;; Name
> + metadata, ;; Reference to compile unit where defined
> + i32, ;; Line number where defined
> + metadata ;; Type descriptor
> }
> </pre>
> </div>
> @@ -778,14 +768,14 @@
>
> <div class="doc_text">
> <pre>
> - void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>
> ( uint, uint, { }* )
> + void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>
> ( uint, uint, metadata)
> </pre>
>
> <p>This intrinsic is used to provide correspondence between the
> source file and
> the generated code. The first argument is the line number (base
> 1), second
> argument is the column number (0 if unknown) and the third
> argument the
> - source <tt>%<a
> href="#format_compile_units">llvm.dbg.compile_unit</a>*</tt>
> - cast to a <tt>{ }*</tt>. Code following a call to this
> intrinsic will
> + source <tt>%<a
> href="#format_compile_units">llvm.dbg.compile_unit</a>.
> + Code following a call to this intrinsic will
> have been defined in close proximity of the line, column and
> file. This
> information holds until the next call
> to <tt>%<a href="#format_common_stoppoint">lvm.dbg.stoppoint</a></
> tt>.</p>
> @@ -799,7 +789,7 @@
>
> <div class="doc_text">
> <pre>
> - void %<a href="#format_common_func_start">llvm.dbg.func.start</a>
> ( { }* )
> + void %<a href="#format_common_func_start">llvm.dbg.func.start</a>
> ( metadata )
> </pre>
>
> <p>This intrinsic is used to link the debug information
> @@ -823,7 +813,7 @@
>
> <div class="doc_text">
> <pre>
> - void %<a
> href="#format_common_region_start">llvm.dbg.region.start</a>( { }* )
> + void %<a
> href="#format_common_region_start">llvm.dbg.region.start</a>
> ( metadata )
> </pre>
>
> <p>This intrinsic is used to define the beginning of a declarative
> scope (ex.
> @@ -843,7 +833,7 @@
>
> <div class="doc_text">
> <pre>
> - void %<a href="#format_common_region_end">llvm.dbg.region.end</a>
> ( { }* )
> + void %<a href="#format_common_region_end">llvm.dbg.region.end</a>
> ( metadata )
> </pre>
>
> <p>This intrinsic is used to define the end of a declarative scope
> (ex. block)
> @@ -864,14 +854,14 @@
>
> <div class="doc_text">
> <pre>
> - void %<a href="#format_common_declare">llvm.dbg.declare</a>( { }
> *, { }* )
> + void %<a href="#format_common_declare">llvm.dbg.declare</a>( { }
> *, metadata )
> </pre>
>
> <p>This intrinsic provides information about a local element (ex.
> variable.) The
> first argument is the alloca for the variable, cast to a <tt>{ }
> *</tt>. The
> second argument is
> the <tt>%<a href="#format_variables">llvm.dbg.variable</a></tt>
> containing
> - the description of the variable, also cast to a <tt>{ }*</tt>.</p>
> + the description of the variable. </p>
>
> </div>
>
> @@ -955,29 +945,29 @@
>
> ...
>
> - 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 )
> + call void @<a
> href="#format_common_func_start">llvm.dbg.func.start</a>( metadata !0)
>
> - 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 )
> + call void @<a
> href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 2, uint
> 2, metadata !1)
>
> call void @<a href="#format_common_declare">llvm.dbg.declare</a>
> ({}* %X, ...)
> call void @<a href="#format_common_declare">llvm.dbg.declare</a>
> ({}* %Y, ...)
>
> <i>;; Evaluate expression on line 2, assigning to X.</i>
>
> - 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 )
> + call void @<a
> href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 3, uint
> 2, metadata !1)
>
> <i>;; Evaluate expression on line 3, assigning to Y.</i>
>
> call void @<a href="#format_common_stoppoint">llvm.region.start</
> a>()
> - 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 )
> + call void @<a
> href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 5, uint
> 4, metadata !1)
> call void @<a href="#format_common_declare">llvm.dbg.declare</a>
> ({}* %X, ...)
>
> <i>;; Evaluate expression on line 5, assigning to Z.</i>
>
> - 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 )
> + call void @<a
> href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 7, uint
> 2, metadata !1)
> call void @<a href="#format_common_region_end">llvm.region.end</
> a>()
>
> - 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 )
> + call void @<a
> href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 9, uint
> 2, metadata !1)
>
> call void @<a href="#format_common_region_end">llvm.region.end</
> a>()
>
> @@ -1097,50 +1087,35 @@
> <pre>
> ...
> ;;
> -;; Define types used. In this case we need one for compile unit
> anchors and one
> -;; for compile units.
> -;;
> -%<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint,
> uint }
> -%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> =
> type { uint, { }*, uint, uint, i8*, i8*, i8* }
> -...
> -;;
> -;; Define the anchor for compile units. Note that the second field
> of the
> -;; anchor is 17, which is the same as the tag for compile units
> -;; (17 = DW_TAG_compile_unit.)
> -;;
> -%<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"
> -
> -;;
> ;; Define the compile unit for the source file "/Users/mine/sources/
> MySource.cpp".
> ;;
> -%<a href="#format_compile_units">llvm.dbg.compile_unit1</a> =
> internal constant %<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a> {
> - uint add(uint 17, uint 262144),
> - { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</
> a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to
> { }*),
> - uint 1,
> - uint 1,
> - i8* getelementptr ([13 x i8]* %str1, i32 0, i32 0),
> - i8* getelementptr ([21 x i8]* %str2, i32 0, i32 0),
> - i8* getelementptr ([33 x i8]* %str3, i32 0, i32 0) }, section
> "llvm.metadata"
> -
> +!3 = metadata !{
> + i32 458769, ;; Tag
> + i32 0, ;; Unused
> + i32 4, ;; Language Id
> + metadata !"MySource.cpp",
> + metadata !"/Users/mine/sources",
> + metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)",
> + i1 true, ;; Main Compile Unit
> + i1 false, ;; Optimized compile unit
> + metadata !"", ;; Compiler flags
> + i32 0} ;; Runtime version
> +
> ;;
> ;; Define the compile unit for the header file "/Users/mine/sources/
> MyHeader.h".
> ;;
> -%<a href="#format_compile_units">llvm.dbg.compile_unit2</a> =
> internal constant %<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a> {
> - uint add(uint 17, uint 262144),
> - { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</
> a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to
> { }*),
> - uint 1,
> - uint 1,
> - i8* getelementptr ([11 x i8]* %str4, int 0, int 0),
> - i8* getelementptr ([21 x i8]* %str2, int 0, int 0),
> - i8* getelementptr ([33 x i8]* %str3, int 0, int 0) }, section
> "llvm.metadata"
> -
> -;;
> -;; Define each of the strings used in the compile units.
> -;;
> -%str1 = internal constant [13 x i8] c"MySource.cpp\00", section
> "llvm.metadata";
> -%str2 = internal constant [21 x i8] c"/Users/mine/sources/\00",
> section "llvm.metadata";
> -%str3 = internal constant [33 x i8] c"4.0.1 LLVM (LLVM research
> group)\00", section "llvm.metadata";
> -%str4 = internal constant [11 x i8] c"MyHeader.h\00", section
> "llvm.metadata";
> +!1 = metadata !{
> + i32 458769, ;; Tag
> + i32 0, ;; Unused
> + i32 4, ;; Language Id
> + metadata !"MyHeader.h",
> + metadata !"/Users/mine/sources",
> + metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)",
> + i1 false, ;; Main Compile Unit
> + i1 false, ;; Optimized compile unit
> + metadata !"", ;; Compiler flags
> + i32 0} ;; Runtime version
> +
> ...
> </pre>
> </div>
> @@ -1167,65 +1142,51 @@
> <div class="doc_code">
> <pre>
> ;;
> -;; Define types used. One for global variable anchors, one for the
> global
> -;; variable descriptor, one for the global's basic type and one for
> the global's
> -;; compile unit.
> -;;
> -%<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint,
> uint }
> -%<a href="#format_global_variables">llvm.dbg.global_variable.type</
> a> = type { uint, { }*, { }*, i8*, { }*, uint, { }*, bool, bool,
> { }*, uint }
> -%<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type
> { uint, { }*, i8*, { }*, int, uint, uint, uint, uint }
> -%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ...
> -...
> -;;
> ;; Define the global itself.
> ;;
> %MyGlobal = global int 100
> ...
> ;;
> -;; Define the anchor for global variables. Note that the second
> field of the
> -;; anchor is 52, which is the same as the tag for global variables
> -;; (52 = DW_TAG_variable.)
> +;; List of debug info of globals
> ;;
> -%<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"
> +!llvm.dbg.gv = !{!0}
>
> ;;
> ;; Define the global variable descriptor. Note the reference to the
> global
> ;; variable anchor and the global variable itself.
> ;;
> -%<a href="#format_global_variables">llvm.dbg.global_variable</a> =
> internal constant %<a
> href="#format_global_variables">llvm.dbg.global_variable.type</a> {
> - uint add(uint 52, uint 262144),
> - { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</
> a>* %<a href="#format_global_variables">llvm.dbg.global_variables</
> a> to { }*),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([9 x i8]* %str1, int 0, int 0),
> - i8* getelementptr ([1 x i8]* %str2, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - uint 1,
> - { }* cast (%<a
> href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a
> href="#format_basic_type">llvm.dbg.basictype</a> to { }*),
> - bool false,
> - bool true,
> - { }* cast (int* %MyGlobal to { }*) }, section "llvm.metadata"
> -
> +!0 = metadata !{
> + i32 458804, ;; Tag
> + i32 0, ;; Unused
> + metadata !1, ;; Context
> + metadata !"MyGlobal", ;; Name
> + metadata !"MyGlobal", ;; Display Name
> + metadata !"MyGlobal", ;; Linkage Name
> + metadata !1, ;; Compile Unit
> + i32 1, ;; Line Number
> + metadata !2, ;; Type
> + i1 false, ;; Is a local variable
> + i1 true, ;; Is this a definition
> + i32* @MyGlobal ;; The global variable
> +}
> +
> ;;
> ;; Define the basic type of 32 bit signed integer. Note that since
> int is an
> ;; intrinsic type the source file is NULL and line 0.
> ;;
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([4 x i8]* %str3, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 5 }, section "llvm.metadata"
> -
> -;;
> -;; Define the names of the global variable and basic type.
> -;;
> -%str1 = internal constant [9 x i8] c"MyGlobal\00", section
> "llvm.metadata"
> -%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
> -%str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"int", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in Bits
> + i64 32, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 5 ;; Encoding
> +}
> +
> </pre>
> </div>
>
> @@ -1253,46 +1214,27 @@
> <div class="doc_code">
> <pre>
> ;;
> -;; Define types used. One for subprogram anchors, one for the
> subprogram
> -;; descriptor, one for the global's basic type and one for the
> subprogram's
> -;; compile unit.
> -;;
> -%<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type
> { uint, { }*, { }*, i8*, { }*, bool, bool }
> -%<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint,
> uint }
> -%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ...
> -
> -;;
> ;; Define the anchor for subprograms. Note that the second field of
> the
> ;; anchor is 46, which is the same as the tag for subprograms
> ;; (46 = DW_TAG_subprogram.)
> ;;
> -%<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"
> -
> -;;
> -;; Define the descriptor for the subprogram. TODO - more details.
> -;;
> -%<a href="#format_subprograms">llvm.dbg.subprogram</a> = internal
> constant %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> {
> - uint add(uint 46, uint 262144),
> - { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</
> a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to { }*),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([5 x i8]* %str1, int 0, int 0),
> - i8* getelementptr ([1 x i8]* %str2, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - uint 1,
> - { }* null,
> - bool false,
> - bool true }, section "llvm.metadata"
> -
> -;;
> -;; Define the name of the subprogram.
> -;;
> -%str1 = internal constant [5 x i8] c"main\00", section
> "llvm.metadata"
> -%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
> -
> +!0 = metadata !{
> + i32 458798, ;; Tag
> + i32 0, ;; Unused
> + metadata !1, ;; Context
> + metadata !"main", ;; Name
> + metadata !"main", ;; Display name
> + metadata !"main", ;; Linkage name
> + metadata !1, ;; Compile unit
> + i32 1, ;; Line number
> + metadata !2, ;; Type
> + i1 false, ;; Is local
> + i1 true ;; Is definition
> +}
> ;;
> ;; Define the subprogram itself.
> ;;
> -int %main(int %argc, i8** %argv) {
> +define i32 @main(i32 %argc, i8** %argv) {
> ...
> }
> </pre>
> @@ -1320,17 +1262,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([5 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 2 }, section "llvm.metadata"
> -%str1 = internal constant [5 x i8] c"bool\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"bool", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 8, ;; Size in Bits
> + i64 8, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 2 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1345,17 +1288,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([5 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 8,
> - uint 8,
> - uint 0,
> - uint 6 }, section "llvm.metadata"
> -%str1 = internal constant [5 x i8] c"char\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"char", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 8, ;; Size in Bits
> + i64 8, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 6 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1370,17 +1314,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([14 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 8,
> - uint 8,
> - uint 0,
> - uint 8 }, section "llvm.metadata"
> -%str1 = internal constant [14 x i8] c"unsigned char\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"unsigned char",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 8, ;; Size in Bits
> + i64 8, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 8 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1395,17 +1340,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([10 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 16,
> - uint 16,
> - uint 0,
> - uint 5 }, section "llvm.metadata"
> -%str1 = internal constant [10 x i8] c"short int\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"short int",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 16, ;; Size in Bits
> + i64 16, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 5 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1420,17 +1366,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([19 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 16,
> - uint 16,
> - uint 0,
> - uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [19 x i8] c"short unsigned int\00",
> section "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"short unsigned int",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 16, ;; Size in Bits
> + i64 16, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 7 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1445,17 +1392,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([4 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 5 }, section "llvm.metadata"
> -%str1 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"int", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in Bits
> + i64 32, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 5 ;; Encoding
> +}
> </pre></div>
>
> </div>
> @@ -1469,17 +1417,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([13 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [13 x i8] c"unsigned int\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"unsigned int",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in Bits
> + i64 32, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 7 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1494,17 +1443,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([14 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 64,
> - uint 64,
> - uint 0,
> - uint 5 }, section "llvm.metadata"
> -%str1 = internal constant [14 x i8] c"long long int\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"long long int",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 64, ;; Size in Bits
> + i64 64, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 5 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1519,17 +1469,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([23 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 64,
> - uint 64,
> - uint 0,
> - uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [23 x 8] c"long long unsigned int\00",
> section "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"long long unsigned int",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 64, ;; Size in Bits
> + i64 64, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 7 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1544,17 +1495,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([6 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 4 }, section "llvm.metadata"
> -%str1 = internal constant [6 x i8] c"float\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"float",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in Bits
> + i64 32, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 4 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1569,17 +1521,18 @@
>
> <div class="doc_code">
> <pre>
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - 8* getelementptr ([7 x 8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 64,
> - uint 64,
> - uint 0,
> - uint 4 }, section "llvm.metadata"
> -%str1 = internal constant [7 x 8] c"double\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"double",;; Name
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 64, ;; Size in Bits
> + i64 64, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 4 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1607,60 +1560,64 @@
> ;;
> ;; Define the typedef "IntPtr".
> ;;
> -%<a href="#format_derived_type">llvm.dbg.derivedtype1</a> =
> internal constant %<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
> - uint add(uint 22, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([7 x 8]* %str1, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - int 1,
> - uint 0,
> - uint 0,
> - uint 0,
> - { }* cast (%<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a
> href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*) },
> section "llvm.metadata"
> -%str1 = internal constant [7 x 8] c"IntPtr\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458774, ;; Tag
> + metadata !1, ;; Context
> + metadata !"IntPtr", ;; Name
> + metadata !3, ;; Compile unit
> + i32 0, ;; Line number
> + i64 0, ;; Size in bits
> + i64 0, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + metadata !4 ;; Derived From type
> +}
>
> ;;
> ;; Define the pointer type.
> ;;
> -%<a href="#format_derived_type">llvm.dbg.derivedtype2</a> =
> internal constant %<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
> - uint add(uint 15, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* null,
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - { }* cast (%<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a
> href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) },
> section "llvm.metadata"
> -
> +!4 = metadata !{
> + i32 458767, ;; Tag
> + metadata !1, ;; Context
> + metadata !"", ;; Name
> + metadata !1, ;; Compile unit
> + i32 0, ;; Line number
> + i64 64, ;; Size in bits
> + i64 64, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + metadata !5 ;; Derived From type
> +}
> ;;
> ;; Define the const type.
> ;;
> -%<a href="#format_derived_type">llvm.dbg.derivedtype3</a> =
> internal constant %<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
> - uint add(uint 38, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* null,
> - { }* null,
> - int 0,
> - uint 0,
> - uint 0,
> - uint 0,
> - { }* cast (%<a
> href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a
> href="#format_basic_type">llvm.dbg.basictype1</a> to { }*) },
> section "llvm.metadata"
> -
> +!5 = metadata !{
> + i32 458790, ;; Tag
> + metadata !1, ;; Context
> + metadata !"", ;; Name
> + metadata !1, ;; Compile unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + metadata !6 ;; Derived From type
> +}
> ;;
> ;; Define the int type.
> ;;
> -%<a href="#format_basic_type">llvm.dbg.basictype1</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - 8* getelementptr ([4 x 8]* %str2, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 5 }, section "llvm.metadata"
> -%str2 = internal constant [4 x 8] c"int\00", section "llvm.metadata"
> +!6 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"int", ;; Name
> + metadata !1, ;; Compile unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + 5 ;; Encoding
> +}
> </pre>
> </div>
>
> @@ -1692,86 +1649,88 @@
> ;;
> ;; Define basic type for unsigned int.
> ;;
> -%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal
> constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
> - uint add(uint 36, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([13 x i8]* %str1, int 0, int 0),
> - { }* null,
> - int 0,
> - uint 32,
> - uint 32,
> - uint 0,
> - uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [13 x i8] c"unsigned int\00", section
> "llvm.metadata"
> -
> +!5 = metadata !{
> + i32 458788, ;; Tag
> + metadata !1, ;; Context
> + metadata !"unsigned int",
> + metadata !1, ;; Compile Unit
> + i32 0, ;; Line number
> + i64 32, ;; Size in Bits
> + i64 32, ;; Align in Bits
> + i64 0, ;; Offset in Bits
> + i32 0, ;; Flags
> + i32 7 ;; Encoding
> +}
> ;;
> ;; Define composite type for struct Color.
> ;;
> -%<a href="#format_composite_type">llvm.dbg.compositetype</a> =
> internal constant %<a
> href="#format_composite_type">llvm.dbg.compositetype.type</a> {
> - uint add(uint 19, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([6 x i8]* %str2, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - int 1,
> - uint 96,
> - uint 32,
> - uint 0,
> - { }* null,
> - { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section
> "llvm.metadata"
> -%str2 = internal constant [6 x i8] c"Color\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458771, ;; Tag
> + metadata !1, ;; Context
> + metadata !"Color", ;; Name
> + metadata !1, ;; Compile unit
> + i32 1, ;; Line number
> + i64 96, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + null, ;; Derived From
> + metadata !3, ;; Elements
> + i32 0 ;; Runtime Language
> +}
>
> ;;
> ;; Define the Red field.
> ;;
> -%<a href="#format_derived_type">llvm.dbg.derivedtype1</a> =
> internal constant %<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
> - uint add(uint 13, uint 262144),
> - { }* null,
> - i8* getelementptr ([4 x i8]* %str3, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - int 2,
> - uint 32,
> - uint 32,
> - uint 0,
> - { }* cast (%<a
> href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a
> href="#format_basic_type">llvm.dbg.basictype</a> to { }*) },
> section "llvm.metadata"
> -%str3 = internal constant [4 x i8] c"Red\00", section "llvm.metadata"
> +!4 = metadata !{
> + i32 458765, ;; Tag
> + metadata !1, ;; Context
> + metadata !"Red", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 2, ;; Line number
> + i64 32, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + metadata !5 ;; Derived From type
> +}
>
> ;;
> ;; Define the Green field.
> ;;
> -%<a href="#format_derived_type">llvm.dbg.derivedtype2</a> =
> internal constant %<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
> - uint add(uint 13, uint 262144),
> - { }* null,
> - i8* getelementptr ([6 x i8]* %str4, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - int 3,
> - uint 32,
> - uint 32,
> - uint 32,
> - { }* cast (%<a
> href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a
> href="#format_basic_type">llvm.dbg.basictype</a> to { }*) },
> section "llvm.metadata"
> -%str4 = internal constant [6 x i8] c"Green\00", section
> "llvm.metadata"
> +!6 = metadata !{
> + i32 458765, ;; Tag
> + metadata !1, ;; Context
> + metadata !"Green", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 3, ;; Line number
> + i64 32, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 32, ;; Offset in bits
> + i32 0, ;; Flags
> + metadata !5 ;; Derived From type
> +}
>
> ;;
> ;; Define the Blue field.
> ;;
> -%<a href="#format_derived_type">llvm.dbg.derivedtype3</a> =
> internal constant %<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
> - uint add(uint 13, uint 262144),
> - { }* null,
> - i8* getelementptr ([5 x i8]* %str5, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - int 4,
> - uint 32,
> - uint 32,
> - uint 64,
> - { }* cast (%<a
> href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a
> href="#format_basic_type">llvm.dbg.basictype</a> to { }*) },
> section "llvm.metadata"
> -%str5 = internal constant [5 x 8] c"Blue\00", section "llvm.metadata"
> +!7 = metadata !{
> + i32 458765, ;; Tag
> + metadata !1, ;; Context
> + metadata !"Blue", ;; Name
> + metadata !1, ;; Compile Unit
> + i32 4, ;; Line number
> + i64 32, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 64, ;; Offset in bits
> + i32 0, ;; Flags
> + metadata !5 ;; Derived From type
> +}
>
> ;;
> ;; Define the array of fields used by the composite type Color.
> ;;
> -%llvm.dbg.array = internal constant [3 x { }*] [
> - { }* cast (%<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a
> href="#format_derived_type">llvm.dbg.derivedtype1</a> to { }*),
> - { }* cast (%<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a
> href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*),
> - { }* cast (%<a
> href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a
> href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) ],
> section "llvm.metadata"
> +!3 = metadata !{metadata !4, metadata !6, metadata !7}
> </pre>
> </div>
>
> @@ -1803,53 +1762,41 @@
> ;;
> ;; Define composite type for enum Trees
> ;;
> -%<a href="#format_composite_type">llvm.dbg.compositetype</a> =
> internal constant %<a
> href="#format_composite_type">llvm.dbg.compositetype.type</a> {
> - uint add(uint 4, uint 262144),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - i8* getelementptr ([6 x i8]* %str1, int 0, int 0),
> - { }* cast (%<a
> href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a
> href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
> - int 1,
> - uint 32,
> - uint 32,
> - uint 0,
> - { }* null,
> - { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section
> "llvm.metadata"
> -%str1 = internal constant [6 x i8] c"Trees\00", section
> "llvm.metadata"
> +!2 = metadata !{
> + i32 458756, ;; Tag
> + metadata !1, ;; Context
> + metadata !"Trees", ;; Name
> + metadata !1, ;; Compile unit
> + i32 1, ;; Line number
> + i64 32, ;; Size in bits
> + i64 32, ;; Align in bits
> + i64 0, ;; Offset in bits
> + i32 0, ;; Flags
> + null, ;; Derived From type
> + metadata !3, ;; Elements
> + i32 0 ;; Runtime language
> +}
> +
> +;;
> +;; Define the array of enumerators used by composite type Trees.
> +;;
> +!3 = metadata !{metadata !4, metadata !5, metadata !6}
>
> ;;
> ;; Define Spruce enumerator.
> ;;
> -%<a href="#format_enumeration">llvm.dbg.enumerator1</a> = internal
> constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
> - uint add(uint 40, uint 262144),
> - i8* getelementptr ([7 x i8]* %str2, int 0, int 0),
> - int 100 }, section "llvm.metadata"
> -%str2 = internal constant [7 x i8] c"Spruce\00", section
> "llvm.metadata"
> +!4 = metadata !{i32 458792, metadata !"Spruce", i64 100}
>
> ;;
> ;; Define Oak enumerator.
> ;;
> -%<a href="#format_enumeration">llvm.dbg.enumerator2</a> = internal
> constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
> - uint add(uint 40, uint 262144),
> - i8* getelementptr ([4 x i8]* %str3, int 0, int 0),
> - int 200 }, section "llvm.metadata"
> -%str3 = internal constant [4 x i8] c"Oak\00", section "llvm.metadata"
> +!5 = metadata !{i32 458792, metadata !"Oak", i64 200}
>
> ;;
> ;; Define Maple enumerator.
> ;;
> -%<a href="#format_enumeration">llvm.dbg.enumerator3</a> = internal
> constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
> - uint add(uint 40, uint 262144),
> - i8* getelementptr ([6 x i8]* %str4, int 0, int 0),
> - int 300 }, section "llvm.metadata"
> -%str4 = internal constant [6 x i8] c"Maple\00", section
> "llvm.metadata"
> +!6 = metadata !{i32 458792, metadata !"Maple", i64 300}
>
> -;;
> -;; Define the array of enumerators used by composite type Trees.
> -;;
> -%llvm.dbg.array = internal constant [3 x { }*] [
> - { }* cast (%<a
> href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a
> href="#format_enumeration">llvm.dbg.enumerator1</a> to { }*),
> - { }* cast (%<a
> href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a
> href="#format_enumeration">llvm.dbg.enumerator2</a> to { }*),
> - { }* cast (%<a
> href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a
> href="#format_enumeration">llvm.dbg.enumerator3</a> to { }*) ],
> section "llvm.metadata"
> </pre>
> </div>
>
>
> Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
> +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Aug 25 00:24:07
> 2009
> @@ -17,6 +17,7 @@
> #ifndef LLVM_ANALYSIS_DEBUGINFO_H
> #define LLVM_ANALYSIS_DEBUGINFO_H
>
> +#include "llvm/Metadata.h"
> #include "llvm/Target/TargetMachine.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/ADT/DenseMap.h"
> @@ -44,12 +45,12 @@
>
> class DIDescriptor {
> protected:
> - GlobalVariable *DbgGV;
> + MDNode *DbgNode;
>
> - /// DIDescriptor constructor. If the specified GV is non-null,
> this checks
> + /// DIDescriptor constructor. If the specified node is non-
> null, check
> /// to make sure that the tag in the descriptor matches
> 'RequiredTag'. If
> /// not, the debug info is corrupt and we ignore it.
> - DIDescriptor(GlobalVariable *GV, unsigned RequiredTag);
> + DIDescriptor(MDNode *N, unsigned RequiredTag);
>
> const std::string &getStringField(unsigned Elt, std::string
> &Result) const;
> unsigned getUnsignedField(unsigned Elt) const {
> @@ -60,18 +61,18 @@
>
> template <typename DescTy>
> DescTy getFieldAs(unsigned Elt) const {
> - return DescTy(getDescriptorField(Elt).getGV());
> + return DescTy(getDescriptorField(Elt).getNode());
> }
>
> GlobalVariable *getGlobalVariableField(unsigned Elt) const;
>
> public:
> - explicit DIDescriptor() : DbgGV(0) {}
> - explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {}
> + explicit DIDescriptor() : DbgNode(0) {}
> + explicit DIDescriptor(MDNode *N) : DbgNode(N) {}
>
> - bool isNull() const { return DbgGV == 0; }
> + bool isNull() const { return DbgNode == 0; }
>
> - GlobalVariable *getGV() const { return DbgGV; }
> + MDNode *getNode() const { return DbgNode; }
>
> unsigned getVersion() const {
> return getUnsignedField(0) & LLVMDebugVersionMask;
> @@ -81,8 +82,8 @@
> return getUnsignedField(0) & ~LLVMDebugVersionMask;
> }
>
> - /// ValidDebugInfo - Return true if V represents valid debug
> info value.
> - static bool ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel);
> + /// ValidDebugInfo - Return true if N represents valid debug
> info value.
> + static bool ValidDebugInfo(MDNode *N, CodeGenOpt::Level
> OptLevel);
>
> /// dump - print descriptor.
> void dump() const;
> @@ -91,8 +92,8 @@
> /// DISubrange - This is used to represent ranges, for array bounds.
> class DISubrange : public DIDescriptor {
> public:
> - explicit DISubrange(GlobalVariable *GV = 0)
> - : DIDescriptor(GV, dwarf::DW_TAG_subrange_type) {}
> + explicit DISubrange(MDNode *N = 0)
> + : DIDescriptor(N, dwarf::DW_TAG_subrange_type) {}
>
> int64_t getLo() const { return (int64_t)getUInt64Field(1); }
> int64_t getHi() const { return (int64_t)getUInt64Field(2); }
> @@ -101,7 +102,8 @@
> /// DIArray - This descriptor holds an array of descriptors.
> class DIArray : public DIDescriptor {
> public:
> - explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {}
> + explicit DIArray(MDNode *N = 0)
> + : DIDescriptor(N) {}
>
> unsigned getNumElements() const;
> DIDescriptor getElement(unsigned Idx) const {
> @@ -112,8 +114,8 @@
> /// DICompileUnit - A wrapper for a compile unit.
> class DICompileUnit : public DIDescriptor {
> public:
> - explicit DICompileUnit(GlobalVariable *GV = 0)
> - : DIDescriptor(GV, dwarf::DW_TAG_compile_unit) {}
> + explicit DICompileUnit(MDNode *N = 0)
> + : DIDescriptor(N, dwarf::DW_TAG_compile_unit) {}
>
> unsigned getLanguage() const { return getUnsignedField(2); }
> const std::string &getFilename(std::string &F) const {
> @@ -154,8 +156,8 @@
> /// type/precision or a file/line pair for location info.
> class DIEnumerator : public DIDescriptor {
> public:
> - explicit DIEnumerator(GlobalVariable *GV = 0)
> - : DIDescriptor(GV, dwarf::DW_TAG_enumerator) {}
> + explicit DIEnumerator(MDNode *N = 0)
> + : DIDescriptor(N, dwarf::DW_TAG_enumerator) {}
>
> const std::string &getName(std::string &F) const {
> return getStringField(1, F);
> @@ -175,10 +177,11 @@
> };
>
> protected:
> - DIType(GlobalVariable *GV, unsigned Tag) : DIDescriptor(GV,
> Tag) {}
> + DIType(MDNode *N, unsigned Tag)
> + : DIDescriptor(N, Tag) {}
> // This ctor is used when the Tag has already been validated by
> a derived
> // ctor.
> - DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {}
> + DIType(MDNode *N, bool, bool) : DIDescriptor(N) {}
>
> public:
> /// isDerivedType - Return true if the specified tag is legal for
> @@ -198,7 +201,7 @@
> /// Verify - Verify that a type descriptor is well formed.
> bool Verify() const;
> public:
> - explicit DIType(GlobalVariable *GV);
> + explicit DIType(MDNode *N);
> explicit DIType() {}
> virtual ~DIType() {}
>
> @@ -231,8 +234,8 @@
> /// DIBasicType - A basic type, like 'int' or 'float'.
> class DIBasicType : public DIType {
> public:
> - explicit DIBasicType(GlobalVariable *GV)
> - : DIType(GV, dwarf::DW_TAG_base_type) {}
> + explicit DIBasicType(MDNode *N = 0)
> + : DIType(N, dwarf::DW_TAG_base_type) {}
>
> unsigned getEncoding() const { return getUnsignedField(9); }
>
> @@ -244,13 +247,13 @@
> /// a typedef, a pointer or reference, etc.
> class DIDerivedType : public DIType {
> protected:
> - explicit DIDerivedType(GlobalVariable *GV, bool, bool)
> - : DIType(GV, true, true) {}
> + explicit DIDerivedType(MDNode *N, bool, bool)
> + : DIType(N, true, true) {}
> public:
> - explicit DIDerivedType(GlobalVariable *GV)
> - : DIType(GV, true, true) {
> - if (GV && !isDerivedType(getTag()))
> - DbgGV = 0;
> + explicit DIDerivedType(MDNode *N = 0)
> + : DIType(N, true, true) {
> + if (DbgNode && !isDerivedType(getTag()))
> + DbgNode = 0;
> }
>
> DIType getTypeDerivedFrom() const { return getFieldAs<DIType>
> (9); }
> @@ -272,10 +275,10 @@
> /// FIXME: Why is this a DIDerivedType??
> class DICompositeType : public DIDerivedType {
> public:
> - explicit DICompositeType(GlobalVariable *GV)
> - : DIDerivedType(GV, true, true) {
> - if (GV && !isCompositeType(getTag()))
> - DbgGV = 0;
> + explicit DICompositeType(MDNode *N = 0)
> + : DIDerivedType(N, true, true) {
> + if (N && !isCompositeType(getTag()))
> + DbgNode = 0;
> }
>
> DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
> @@ -291,8 +294,8 @@
> /// DIGlobal - This is a common class for global variables and
> subprograms.
> class DIGlobal : public DIDescriptor {
> protected:
> - explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag)
> - : DIDescriptor(GV, RequiredTag) {}
> + explicit DIGlobal(MDNode *N, unsigned RequiredTag)
> + : DIDescriptor(N, RequiredTag) {}
>
> /// isSubprogram - Return true if the specified tag is legal for
> /// DISubprogram.
> @@ -335,8 +338,8 @@
> /// DISubprogram - This is a wrapper for a subprogram (e.g. a
> function).
> class DISubprogram : public DIGlobal {
> public:
> - explicit DISubprogram(GlobalVariable *GV = 0)
> - : DIGlobal(GV, dwarf::DW_TAG_subprogram) {}
> + explicit DISubprogram(MDNode *N = 0)
> + : DIGlobal(N, dwarf::DW_TAG_subprogram) {}
>
> DICompositeType getType() const { return
> getFieldAs<DICompositeType>(8); }
>
> @@ -346,7 +349,7 @@
> DICompositeType DCT(getFieldAs<DICompositeType>(8));
> if (!DCT.isNull()) {
> DIArray A = DCT.getTypeArray();
> - DIType T(A.getElement(0).getGV());
> + DIType T(A.getElement(0).getNode());
> return T.getName(F);
> }
> DIType T(getFieldAs<DIType>(8));
> @@ -367,8 +370,8 @@
> /// DIGlobalVariable - This is a wrapper for a global variable.
> class DIGlobalVariable : public DIGlobal {
> public:
> - explicit DIGlobalVariable(GlobalVariable *GV = 0)
> - : DIGlobal(GV, dwarf::DW_TAG_variable) {}
> + explicit DIGlobalVariable(MDNode *N = 0)
> + : DIGlobal(N, dwarf::DW_TAG_variable) {}
>
> GlobalVariable *getGlobal() const { return getGlobalVariableField
> (11); }
>
> @@ -383,10 +386,10 @@
> /// global etc).
> class DIVariable : public DIDescriptor {
> public:
> - explicit DIVariable(GlobalVariable *GV = 0)
> - : DIDescriptor(GV) {
> - if (GV && !isVariable(getTag()))
> - DbgGV = 0;
> + explicit DIVariable(MDNode *N = 0)
> + : DIDescriptor(N) {
> + if (DbgNode && !isVariable(getTag()))
> + DbgNode = 0;
> }
>
> DIDescriptor getContext() const { return getDescriptorField(1); }
> @@ -410,8 +413,8 @@
> /// DIBlock - This is a wrapper for a block (e.g. a function,
> scope, etc).
> class DIBlock : public DIDescriptor {
> public:
> - explicit DIBlock(GlobalVariable *GV = 0)
> - : DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {}
> + explicit DIBlock(MDNode *N = 0)
> + : DIDescriptor(N, dwarf::DW_TAG_lexical_block) {}
>
> DIDescriptor getContext() const { return getDescriptorField(1); }
> };
> @@ -538,10 +541,6 @@
>
> private:
> Constant *GetTagConstant(unsigned TAG);
> - Constant *GetStringConstant(const std::string &String);
> -
> - /// getCastToEmpty - Return the descriptor as a Constant* with
> type '{}*'.
> - Constant *getCastToEmpty(DIDescriptor D);
> };
>
> /// Finds the stoppoint coressponding to this instruction, that is
> the
> @@ -603,7 +602,6 @@
>
> /// isInlinedFnEnd - Return true if REI is ending an inlined
> function.
> bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function
> *CurrentFn);
> -
> /// DebugInfoFinder - This object collects DebugInfo from a module.
> class DebugInfoFinder {
>
> @@ -647,7 +645,7 @@
> bool addType(DIType DT);
>
> public:
> - typedef SmallVector<GlobalVariable *, 8>::iterator iterator;
> + typedef SmallVector<MDNode *, 8>::iterator iterator;
> iterator compile_unit_begin() { return CUs.begin(); }
> iterator compile_unit_end() { return CUs.end(); }
> iterator subprogram_begin() { return SPs.begin(); }
> @@ -663,12 +661,11 @@
> unsigned type_count() { return TYs.size(); }
>
> private:
> - SmallVector<GlobalVariable *, 8> CUs; // Compile Units
> - SmallVector<GlobalVariable *, 8> SPs; // Subprograms
> - SmallVector<GlobalVariable *, 8> GVs; // Global Variables
> - SmallVector<GlobalVariable *, 8> TYs; // Types
> - SmallPtrSet<GlobalVariable *, 64> NodesSeen;
> -
> + SmallVector<MDNode *, 8> CUs; // Compile Units
> + SmallVector<MDNode *, 8> SPs; // Subprograms
> + SmallVector<MDNode *, 8> GVs; // Global Variables;
> + SmallVector<MDNode *, 8> TYs; // Types
> + SmallPtrSet<MDNode *, 64> NodesSeen;
> };
> } // end namespace llvm
>
>
> Modified: llvm/trunk/include/llvm/AutoUpgrade.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AutoUpgrade.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/AutoUpgrade.h (original)
> +++ llvm/trunk/include/llvm/AutoUpgrade.h Tue Aug 25 00:24:07 2009
> @@ -15,6 +15,7 @@
> #define LLVM_AUTOUPGRADE_H
>
> namespace llvm {
> + class Module;
> class Function;
> class CallInst;
>
> @@ -34,6 +35,9 @@
> /// so that it can update all calls to the old function.
> void UpgradeCallsToIntrinsic(Function* F);
>
> + /// This function checks debug info intrinsics. If an intrinsic
> is invalid
> + /// then this function simply removes the intrinsic.
> + void CheckDebugInfoIntrinsics(Module *M);
> } // End llvm namespace
>
> #endif
>
> Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Aug 25
> 00:24:07 2009
> @@ -33,7 +33,7 @@
> class MachineInstr;
> class Value;
> class Module;
> -class GlobalVariable;
> +class MDNode;
> class MCAsmInfo;
> class raw_ostream;
> class Instruction;
> @@ -88,17 +88,17 @@
> unsigned RecordSourceLine(unsigned Line, unsigned Col,
> DICompileUnit CU);
>
> /// RecordRegionStart - Indicate the start of a region.
> - unsigned RecordRegionStart(GlobalVariable *V);
> + unsigned RecordRegionStart(MDNode *N);
>
> /// RecordRegionEnd - Indicate the end of a region.
> - unsigned RecordRegionEnd(GlobalVariable *V);
> + unsigned RecordRegionEnd(MDNode *N);
>
> /// getRecordSourceLineCount - Count source lines.
> unsigned getRecordSourceLineCount();
>
> /// RecordVariable - Indicate the declaration of a local variable.
> ///
> - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex);
> + void RecordVariable(MDNode *N, unsigned FrameIndex);
>
> /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging
> declarations should
> /// be emitted.
>
> Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Tue Aug 25
> 00:24:07 2009
> @@ -327,7 +327,7 @@
> /// getOrCreateDebugLocID - Look up the DebugLocTuple index with
> the given
> /// source file, line, and column. If none currently exists,
> create a new
> /// DebugLocTuple, and insert it into the DebugIdMap.
> - unsigned getOrCreateDebugLocID(GlobalVariable *CompileUnit,
> + unsigned getOrCreateDebugLocID(MDNode *CompileUnit,
> unsigned Line, unsigned Col);
>
> /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc
> object.
>
> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Aug 25
> 00:24:07 2009
> @@ -322,7 +322,7 @@
> SDValue getValueType(EVT);
> SDValue getRegister(unsigned Reg, EVT VT);
> SDValue getDbgStopPoint(DebugLoc DL, SDValue Root,
> - unsigned Line, unsigned Col, Value *CU);
> + unsigned Line, unsigned Col, MDNode *CU);
> SDValue getLabel(unsigned Opcode, DebugLoc dl, SDValue Root,
> unsigned LabelID);
>
>
> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Aug 25
> 00:24:07 2009
> @@ -2015,10 +2015,10 @@
> SDUse Chain;
> unsigned Line;
> unsigned Column;
> - Value *CU;
> + MDNode *CU;
> friend class SelectionDAG;
> DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c,
> - Value *cu)
> + MDNode *cu)
> : SDNode(ISD::DBG_STOPPOINT, DebugLoc::getUnknownLoc(),
> getSDVTList(MVT::Other)), Line(l), Column(c), CU(cu) {
> InitOperands(&Chain, ch);
> @@ -2026,7 +2026,7 @@
> public:
> unsigned getLine() const { return Line; }
> unsigned getColumn() const { return Column; }
> - Value *getCompileUnit() const { return CU; }
> + MDNode *getCompileUnit() const { return CU; }
>
> static bool classof(const DbgStopPointSDNode *) { return true; }
> static bool classof(const SDNode *N) {
>
> Modified: llvm/trunk/include/llvm/IntrinsicInst.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicInst.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/IntrinsicInst.h (original)
> +++ llvm/trunk/include/llvm/IntrinsicInst.h Tue Aug 25 00:24:07 2009
> @@ -25,6 +25,7 @@
> #define LLVM_INTRINSICINST_H
>
> #include "llvm/Constants.h"
> +#include "llvm/Metadata.h"
> #include "llvm/Function.h"
> #include "llvm/Instructions.h"
> #include "llvm/Intrinsics.h"
> @@ -85,8 +86,8 @@
> struct DbgStopPointInst : public DbgInfoIntrinsic {
> Value *getLineValue() const { return const_cast<Value*>
> (getOperand(1)); }
> Value *getColumnValue() const { return const_cast<Value*>
> (getOperand(2)); }
> - Value *getContext() const {
> - return StripCast(getOperand(3));
> + MDNode *getContext() const {
> + return cast<MDNode>(getOperand(3));
> }
>
> unsigned getLine() const {
> @@ -112,7 +113,7 @@
> /// DbgFuncStartInst - This represents the llvm.dbg.func.start
> instruction.
> ///
> struct DbgFuncStartInst : public DbgInfoIntrinsic {
> - Value *getSubprogram() const { return StripCast(getOperand(1)); }
> + MDNode *getSubprogram() const { return cast<MDNode>(getOperand
> (1)); }
>
> // Methods for support type inquiry through isa, cast, and
> dyn_cast:
> static inline bool classof(const DbgFuncStartInst *) { return
> true; }
> @@ -127,7 +128,7 @@
> /// DbgRegionStartInst - This represents the llvm.dbg.region.start
> /// instruction.
> struct DbgRegionStartInst : public DbgInfoIntrinsic {
> - Value *getContext() const { return StripCast(getOperand(1)); }
> + MDNode *getContext() const { return cast<MDNode>(getOperand
> (1)); }
>
> // Methods for support type inquiry through isa, cast, and
> dyn_cast:
> static inline bool classof(const DbgRegionStartInst *) { return
> true; }
> @@ -142,7 +143,7 @@
> /// DbgRegionEndInst - This represents the llvm.dbg.region.end
> instruction.
> ///
> struct DbgRegionEndInst : public DbgInfoIntrinsic {
> - Value *getContext() const { return StripCast(getOperand(1)); }
> + MDNode *getContext() const { return cast<MDNode>(getOperand
> (1)); }
>
> // Methods for support type inquiry through isa, cast, and
> dyn_cast:
> static inline bool classof(const DbgRegionEndInst *) { return
> true; }
> @@ -158,7 +159,7 @@
> ///
> struct DbgDeclareInst : public DbgInfoIntrinsic {
> Value *getAddress() const { return getOperand(1); }
> - Value *getVariable() const { return StripCast(getOperand(2)); }
> + MDNode *getVariable() const { return cast<MDNode>(getOperand
> (2)); }
>
> // Methods for support type inquiry through isa, cast, and
> dyn_cast:
> static inline bool classof(const DbgDeclareInst *) { return
> true; }
>
> Modified: llvm/trunk/include/llvm/Intrinsics.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Intrinsics.td (original)
> +++ llvm/trunk/include/llvm/Intrinsics.td Tue Aug 25 00:24:07 2009
> @@ -110,6 +110,7 @@
> def llvm_anyptr_ty : LLVMAnyPointerType<llvm_i8_ty>; //
> (space)i8*
> def llvm_empty_ty : LLVMType<OtherVT>; //
> { }
> def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; //
> { }*
> +def llvm_metadata_ty :
> LLVMType<MetadataVT>; // !{...}
>
> def llvm_v2i8_ty : LLVMType<v2i8>; // 2 x i8
> def llvm_v4i8_ty : LLVMType<v4i8>; // 4 x i8
> @@ -278,12 +279,12 @@
> let Properties = [IntrNoMem] in {
> def int_dbg_stoppoint : Intrinsic<[llvm_void_ty],
> [llvm_i32_ty, llvm_i32_ty,
> - llvm_descriptor_ty]>;
> - def int_dbg_region_start : Intrinsic<[llvm_void_ty],
> [llvm_descriptor_ty]>;
> - def int_dbg_region_end : Intrinsic<[llvm_void_ty],
> [llvm_descriptor_ty]>;
> - def int_dbg_func_start : Intrinsic<[llvm_void_ty],
> [llvm_descriptor_ty]>;
> + llvm_metadata_ty]>;
> + def int_dbg_region_start : Intrinsic<[llvm_void_ty],
> [llvm_metadata_ty]>;
> + def int_dbg_region_end : Intrinsic<[llvm_void_ty],
> [llvm_metadata_ty]>;
> + def int_dbg_func_start : Intrinsic<[llvm_void_ty],
> [llvm_metadata_ty]>;
> def int_dbg_declare : Intrinsic<[llvm_void_ty],
> - [llvm_descriptor_ty,
> llvm_descriptor_ty]>;
> + [llvm_descriptor_ty,
> llvm_metadata_ty]>;
> }
>
> //===------------------ Exception Handling
> Intrinsics----------------------===//
>
> Modified: llvm/trunk/include/llvm/Metadata.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Metadata.h (original)
> +++ llvm/trunk/include/llvm/Metadata.h Tue Aug 25 00:24:07 2009
> @@ -110,7 +110,6 @@
> unsigned getNumOperands() { return User::getNumOperands(); }
>
> SmallVector<WeakVH, 4> Node;
> -
> friend struct ConstantCreator<MDNode, Type, std::vector<Value*> >;
> protected:
> explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned
> NumVals);
>
> Modified: llvm/trunk/include/llvm/Support/DebugLoc.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DebugLoc.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Support/DebugLoc.h (original)
> +++ llvm/trunk/include/llvm/Support/DebugLoc.h Tue Aug 25 00:24:07
> 2009
> @@ -19,19 +19,19 @@
> #include <vector>
>
> namespace llvm {
> - class GlobalVariable;
> + class MDNode;
>
> /// DebugLocTuple - Debug location tuple of filename id, line and
> column.
> ///
> struct DebugLocTuple {
> - GlobalVariable *CompileUnit;
> + MDNode *CompileUnit;
> unsigned Line, Col;
>
> DebugLocTuple()
> : CompileUnit(0), Line(~0U), Col(~0U) {};
>
> - DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c)
> - : CompileUnit(v), Line(l), Col(c) {};
> + DebugLocTuple(MDNode *n, unsigned l, unsigned c)
> + : CompileUnit(n), Line(l), Col(c) {};
>
> bool operator==(const DebugLocTuple &DLT) const {
> return CompileUnit == DLT.CompileUnit &&
> @@ -69,10 +69,10 @@
> return DebugLocTuple(0, ~0U, ~0U);
> }
> static inline DebugLocTuple getTombstoneKey() {
> - return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U);
> + return DebugLocTuple((MDNode*)~1U, ~1U, ~1U);
> }
> static unsigned getHashValue(const DebugLocTuple &Val) {
> - return DenseMapInfo<GlobalVariable*>::getHashValue
> (Val.CompileUnit) ^
> + return DenseMapInfo<MDNode*>::getHashValue(Val.CompileUnit) ^
> DenseMapInfo<unsigned>::getHashValue(Val.Line) ^
> DenseMapInfo<unsigned>::getHashValue(Val.Col);
> }
>
> Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original)
> +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Tue Aug 25 00:24:07
> 2009
> @@ -90,7 +90,7 @@
> }
>
> void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS) {
> - DISubprogram Subprogram(cast<GlobalVariable>(FS->getSubprogram()));
> + DISubprogram Subprogram(FS->getSubprogram());
> std::string Res1, Res2;
> Out << "; fully qualified function name: " <<
> Subprogram.getDisplayName(Res1)
> << " return type: " << Subprogram.getReturnTypeName(Res2)
>
> Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
> +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Aug 25 00:24:07 2009
> @@ -21,6 +21,7 @@
> #include "llvm/LLVMContext.h"
> #include "llvm/Module.h"
> #include "llvm/Analysis/ValueTracking.h"
> +#include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/Support/Dwarf.h"
> #include "llvm/Support/DebugLoc.h"
> #include "llvm/Support/raw_ostream.h"
> @@ -32,18 +33,12 @@
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
>
> /// ValidDebugInfo - Return true if V represents valid debug info
> value.
> -bool DIDescriptor::ValidDebugInfo(Value *V, CodeGenOpt::Level
> OptLevel) {
> - if (!V)
> +/// FIXME : Add DIDescriptor.isValid()
> +bool DIDescriptor::ValidDebugInfo(MDNode *N, CodeGenOpt::Level
> OptLevel) {
> + if (!N)
> return false;
>
> - GlobalVariable *GV = dyn_cast<GlobalVariable>(V->stripPointerCasts
> ());
> - if (!GV)
> - return false;
> -
> - if (!GV->hasInternalLinkage () && !GV->hasLinkOnceLinkage())
> - return false;
> -
> - DIDescriptor DI(GV);
> + DIDescriptor DI(N);
>
> // Check current version. Allow Version6 for now.
> unsigned Version = DI.getVersion();
> @@ -53,13 +48,13 @@
> unsigned Tag = DI.getTag();
> switch (Tag) {
> case DW_TAG_variable:
> - assert(DIVariable(GV).Verify() && "Invalid DebugInfo value");
> + assert(DIVariable(N).Verify() && "Invalid DebugInfo value");
> break;
> case DW_TAG_compile_unit:
> - assert(DICompileUnit(GV).Verify() && "Invalid DebugInfo value");
> + assert(DICompileUnit(N).Verify() && "Invalid DebugInfo value");
> break;
> case DW_TAG_subprogram:
> - assert(DISubprogram(GV).Verify() && "Invalid DebugInfo value");
> + assert(DISubprogram(N).Verify() && "Invalid DebugInfo value");
> break;
> case DW_TAG_lexical_block:
> // FIXME: This interfers with the quality of generated code during
> @@ -74,67 +69,58 @@
> return true;
> }
>
> -DIDescriptor::DIDescriptor(GlobalVariable *GV, unsigned
> RequiredTag) {
> - DbgGV = GV;
> +DIDescriptor::DIDescriptor(MDNode *N, unsigned RequiredTag) {
> + DbgNode = N;
>
> // If this is non-null, check to see if the Tag matches. If not,
> set to null.
> - if (GV && getTag() != RequiredTag)
> - DbgGV = 0;
> + if (N && getTag() != RequiredTag) {
> + DbgNode = 0;
> + }
> }
>
> const std::string &
> DIDescriptor::getStringField(unsigned Elt, std::string &Result)
> const {
> - if (DbgGV == 0) {
> - Result.clear();
> + Result.clear();
> + if (DbgNode == 0)
> return Result;
> - }
> -
> - Constant *C = DbgGV->getInitializer();
> - if (C == 0 || Elt >= C->getNumOperands()) {
> - Result.clear();
> - return Result;
> - }
> -
> - // Fills in the string if it succeeds
> - if (!GetConstantStringInfo(C->getOperand(Elt), Result))
> - Result.clear();
>
> + if (Elt < DbgNode->getNumElements())
> + if (MDString *MDS = dyn_cast_or_null<MDString>(DbgNode-
> >getElement(Elt))) {
> + Result.assign(MDS->begin(), MDS->begin() + MDS->length());
> + return Result;
> + }
> +
> return Result;
> }
>
> uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const {
> - if (DbgGV == 0) return 0;
> - if (!DbgGV->hasInitializer()) return 0;
> -
> - Constant *C = DbgGV->getInitializer();
> - if (C == 0 || Elt >= C->getNumOperands())
> + if (DbgNode == 0)
> return 0;
>
> - if (ConstantInt *CI = dyn_cast<ConstantInt>(C->getOperand(Elt)))
> - return CI->getZExtValue();
> + if (Elt < DbgNode->getNumElements())
> + if (ConstantInt *CI = dyn_cast<ConstantInt>(DbgNode->getElement
> (Elt)))
> + return CI->getZExtValue();
> +
> return 0;
> }
>
> DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const {
> - if (DbgGV == 0) return DIDescriptor();
> -
> - Constant *C = DbgGV->getInitializer();
> - if (C == 0 || Elt >= C->getNumOperands())
> + if (DbgNode == 0)
> return DIDescriptor();
>
> - C = C->getOperand(Elt);
> - return DIDescriptor(dyn_cast<GlobalVariable>(C->stripPointerCasts
> ()));
> + if (Elt < DbgNode->getNumElements() && DbgNode->getElement(Elt))
> + return DIDescriptor(dyn_cast<MDNode>(DbgNode->getElement(Elt)));
> +
> + return DIDescriptor();
> }
>
> GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt)
> const {
> - if (DbgGV == 0) return 0;
> -
> - Constant *C = DbgGV->getInitializer();
> - if (C == 0 || Elt >= C->getNumOperands())
> + if (DbgNode == 0)
> return 0;
>
> - C = C->getOperand(Elt);
> - return dyn_cast<GlobalVariable>(C->stripPointerCasts());
> + if (Elt < DbgNode->getNumElements())
> + return dyn_cast<GlobalVariable>(DbgNode->getElement(Elt));
> + return 0;
> }
>
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> @@ -142,12 +128,13 @@
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
>
> // Needed by DIVariable::getType().
> -DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) {
> - if (!GV) return;
> +DIType::DIType(MDNode *N) : DIDescriptor(N) {
> + if (!N) return;
> unsigned tag = getTag();
> if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType
> (tag) &&
> - !DICompositeType::isCompositeType(tag))
> - DbgGV = 0;
> + !DICompositeType::isCompositeType(tag)) {
> + DbgNode = 0;
> + }
> }
>
> /// isDerivedType - Return true if the specified tag is legal for
> @@ -164,9 +151,8 @@
> case dwarf::DW_TAG_inheritance:
> return true;
> default:
> - // FIXME: Even though it doesn't make sense, CompositeTypes are
> current
> - // modelled as DerivedTypes, this should return true for them
> as well.
> - return false;
> + // CompositeTypes are currently modelled as DerivedTypes.
> + return isCompositeType(Tag);
> }
> }
>
> @@ -200,10 +186,8 @@
> }
>
> unsigned DIArray::getNumElements() const {
> - assert (DbgGV && "Invalid DIArray");
> - Constant *C = DbgGV->getInitializer();
> - assert (C && "Invalid DIArray initializer");
> - return C->getNumOperands();
> + assert (DbgNode && "Invalid DIArray");
> + return DbgNode->getNumElements();
> }
>
> /// replaceAllUsesWith - Replace all uses of debug info referenced by
> @@ -214,8 +198,8 @@
> return;
>
> assert (!D.isNull() && "Can not replace with null");
> - getGV()->replaceAllUsesWith(D.getGV());
> - getGV()->eraseFromParent();
> + DbgNode->replaceAllUsesWith(D.getNode());
> + delete DbgNode;
> }
>
> /// Verify - Verify that a compile unit is well formed.
> @@ -341,8 +325,8 @@
>
> /// dump - Print descriptor.
> void DIDescriptor::dump() const {
> - errs() << "[" << dwarf::TagString(getTag()) << "] [GV:";
> - errs().write_hex((intptr_t)DbgGV) << ']';
> + errs() << "[" << dwarf::TagString(getTag()) << "] ";
> + errs().write_hex((intptr_t)DbgNode) << ']';
> }
>
> /// dump - Print compile unit.
> @@ -383,11 +367,11 @@
> errs() << " [fwd] ";
>
> if (isBasicType(Tag))
> - DIBasicType(DbgGV).dump();
> + DIBasicType(DbgNode).dump();
> else if (isDerivedType(Tag))
> - DIDerivedType(DbgGV).dump();
> + DIDerivedType(DbgNode).dump();
> else if (isCompositeType(Tag))
> - DICompositeType(DbgGV).dump();
> + DICompositeType(DbgNode).dump();
> else {
> errs() << "Invalid DIType\n";
> return;
> @@ -434,7 +418,7 @@
> errs() << " [def] ";
>
> if (isGlobalVariable(Tag))
> - DIGlobalVariable(DbgGV).dump();
> + DIGlobalVariable(DbgNode).dump();
>
> errs() << "\n";
> }
> @@ -474,43 +458,12 @@
> EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext));
> }
>
> -/// getCastToEmpty - Return this descriptor as a Constant* with
> type '{}*'.
> -/// This is only valid when the descriptor is non-null.
> -Constant *DIFactory::getCastToEmpty(DIDescriptor D) {
> - if (D.isNull()) return llvm::Constant::getNullValue
> (EmptyStructPtr);
> - return ConstantExpr::getBitCast(D.getGV(), EmptyStructPtr);
> -}
> -
> Constant *DIFactory::GetTagConstant(unsigned TAG) {
> assert((TAG & LLVMDebugVersionMask) == 0 &&
> "Tag too large for debug encoding!");
> return ConstantInt::get(Type::getInt32Ty(VMContext), TAG |
> LLVMDebugVersion);
> }
>
> -Constant *DIFactory::GetStringConstant(const std::string &String) {
> - // Check string cache for previous edition.
> - Constant *&Slot = StringCache[String];
> -
> - // Return Constant if previously defined.
> - if (Slot) return Slot;
> -
> - const PointerType *DestTy = PointerType::getUnqual(Type::getInt8Ty
> (VMContext));
> -
> - // If empty string then use a i8* null instead.
> - if (String.empty())
> - return Slot = ConstantPointerNull::get(DestTy);
> -
> - // Construct string as an llvm constant.
> - Constant *ConstStr = ConstantArray::get(VMContext, String);
> -
> - // Otherwise create and return a new string global.
> - GlobalVariable *StrGV = new GlobalVariable(M, ConstStr->getType
> (), true,
> -
> GlobalVariable::InternalLinkage,
> - ConstStr, ".str");
> - StrGV->setSection("llvm.metadata");
> - return Slot = ConstantExpr::getBitCast(StrGV, DestTy);
> -}
> -
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> // DIFactory: Primary Constructors
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> @@ -518,50 +471,27 @@
> /// GetOrCreateArray - Create an descriptor for an array of
> descriptors.
> /// This implicitly uniques the arrays created.
> DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned
> NumTys) {
> - SmallVector<Constant*, 16> Elts;
> + SmallVector<Value*, 16> Elts;
>
> - for (unsigned i = 0; i != NumTys; ++i)
> - Elts.push_back(getCastToEmpty(Tys[i]));
> + if (NumTys == 0)
> + Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty
> (VMContext)));
> + else
> + for (unsigned i = 0; i != NumTys; ++i)
> + Elts.push_back(Tys[i].getNode());
>
> - Constant *Init = ConstantArray::get(ArrayType::get(EmptyStructPtr,
> - Elts.size()),
> - Elts.data(), Elts.size());
> - // If we already have this array, just return the uniqued version.
> - DIDescriptor &Entry = SimpleConstantCache[Init];
> - if (!Entry.isNull()) return DIArray(Entry.getGV());
> -
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init, "llvm.dbg.array");
> - GV->setSection("llvm.metadata");
> - Entry = DIDescriptor(GV);
> - return DIArray(GV);
> + return DIArray(MDNode::get(VMContext,Elts.data(), Elts.size()));
> }
>
> /// GetOrCreateSubrange - Create a descriptor for a value range. This
> /// implicitly uniques the values returned.
> DISubrange DIFactory::GetOrCreateSubrange(int64_t Lo, int64_t Hi) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_subrange_type),
> ConstantInt::get(Type::getInt64Ty(VMContext), Lo),
> ConstantInt::get(Type::getInt64Ty(VMContext), Hi)
> };
>
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - // If we already have this range, just return the uniqued version.
> - DIDescriptor &Entry = SimpleConstantCache[Init];
> - if (!Entry.isNull()) return DISubrange(Entry.getGV());
> -
> - M.addTypeName("llvm.dbg.subrange.type", Init->getType());
> -
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init, "llvm.dbg.subrange");
> - GV->setSection("llvm.metadata");
> - Entry = DIDescriptor(GV);
> - return DISubrange(GV);
> + return DISubrange(MDNode::get(VMContext, &Elts[0], 3));
> }
>
>
> @@ -576,47 +506,31 @@
> bool isOptimized,
> const char *Flags,
> unsigned RunTimeVer) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_compile_unit),
> - llvm::Constant::getNullValue(EmptyStructPtr),
> + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
> ConstantInt::get(Type::getInt32Ty(VMContext), LangID),
> - GetStringConstant(Filename),
> - GetStringConstant(Directory),
> - GetStringConstant(Producer),
> + MDString::get(VMContext, Filename),
> + MDString::get(VMContext, Directory),
> + MDString::get(VMContext, Producer),
> ConstantInt::get(Type::getInt1Ty(VMContext), isMain),
> ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized),
> - GetStringConstant(Flags),
> + MDString::get(VMContext, Flags),
> ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer)
> };
> -
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.compile_unit.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init,
> "llvm.dbg.compile_unit");
> - GV->setSection("llvm.metadata");
> - return DICompileUnit(GV);
> +
> + return DICompileUnit(MDNode::get(VMContext, &Elts[0], 10));
> }
>
> /// CreateEnumerator - Create a single enumerator value.
> DIEnumerator DIFactory::CreateEnumerator(const std::string &Name,
> uint64_t Val){
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_enumerator),
> - GetStringConstant(Name),
> + MDString::get(VMContext, Name),
> ConstantInt::get(Type::getInt64Ty(VMContext), Val)
> };
> -
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.enumerator.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init,
> "llvm.dbg.enumerator");
> - GV->setSection("llvm.metadata");
> - return DIEnumerator(GV);
> +
> + return DIEnumerator(MDNode::get(VMContext, &Elts[0], 3));
> }
>
>
> @@ -629,11 +543,11 @@
> uint64_t AlignInBits,
> uint64_t OffsetInBits,
> unsigned Flags,
> unsigned Encoding) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_base_type),
> - getCastToEmpty(Context),
> - GetStringConstant(Name),
> - getCastToEmpty(CompileUnit),
> + Context.getNode(),
> + MDString::get(VMContext, Name),
> + CompileUnit.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
> ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
> ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
> @@ -642,15 +556,7 @@
> ConstantInt::get(Type::getInt32Ty(VMContext), Encoding)
> };
>
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.basictype.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init,
> "llvm.dbg.basictype");
> - GV->setSection("llvm.metadata");
> - return DIBasicType(GV);
> + return DIBasicType(MDNode::get(VMContext, &Elts[0], 10));
> }
>
> /// CreateDerivedType - Create a derived type like const qualified
> type,
> @@ -665,28 +571,20 @@
> uint64_t OffsetInBits,
> unsigned Flags,
> DIType DerivedFrom) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(Tag),
> - getCastToEmpty(Context),
> - GetStringConstant(Name),
> - getCastToEmpty(CompileUnit),
> + Context.getNode(),
> + MDString::get(VMContext, Name),
> + CompileUnit.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
> ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
> ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
> ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits),
> ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
> - getCastToEmpty(DerivedFrom)
> + DerivedFrom.getNode(),
> };
> -
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.derivedtype.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init,
> "llvm.dbg.derivedtype");
> - GV->setSection("llvm.metadata");
> - return DIDerivedType(GV);
> +
> + return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10));
> }
>
> /// CreateCompositeType - Create a composite type like array,
> struct, etc.
> @@ -703,30 +601,22 @@
> DIArray Elements,
> unsigned RuntimeLang) {
>
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(Tag),
> - getCastToEmpty(Context),
> - GetStringConstant(Name),
> - getCastToEmpty(CompileUnit),
> + Context.getNode(),
> + MDString::get(VMContext, Name),
> + CompileUnit.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
> ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
> ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
> ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits),
> ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
> - getCastToEmpty(DerivedFrom),
> - getCastToEmpty(Elements),
> + DerivedFrom.getNode(),
> + Elements.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
> };
> -
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.composite.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init,
> "llvm.dbg.composite");
> - GV->setSection("llvm.metadata");
> - return DICompositeType(GV);
> +
> + return DICompositeType(MDNode::get(VMContext, &Elts[0], 12));
> }
>
>
> @@ -742,29 +632,21 @@
> bool isLocalToUnit,
> bool isDefinition) {
>
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_subprogram),
> - llvm::Constant::getNullValue(EmptyStructPtr),
> - getCastToEmpty(Context),
> - GetStringConstant(Name),
> - GetStringConstant(DisplayName),
> - GetStringConstant(LinkageName),
> - getCastToEmpty(CompileUnit),
> + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
> + Context.getNode(),
> + MDString::get(VMContext, Name),
> + MDString::get(VMContext, DisplayName),
> + MDString::get(VMContext, LinkageName),
> + CompileUnit.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
> - getCastToEmpty(Type),
> + Type.getNode(),
> ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit),
> ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition)
> };
>
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.subprogram.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init,
> "llvm.dbg.subprogram");
> - GV->setSection("llvm.metadata");
> - return DISubprogram(GV);
> + return DISubprogram(MDNode::get(VMContext, &Elts[0], 11));
> }
>
> /// CreateGlobalVariable - Create a new descriptor for the specified
> global.
> @@ -775,30 +657,29 @@
> DICompileUnit CompileUnit,
> unsigned LineNo, DIType Type,bool
> isLocalToUnit,
> bool isDefinition,
> llvm::GlobalVariable *Val) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_variable),
> - llvm::Constant::getNullValue(EmptyStructPtr),
> - getCastToEmpty(Context),
> - GetStringConstant(Name),
> - GetStringConstant(DisplayName),
> - GetStringConstant(LinkageName),
> - getCastToEmpty(CompileUnit),
> + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
> + Context.getNode(),
> + MDString::get(VMContext, Name),
> + MDString::get(VMContext, DisplayName),
> + MDString::get(VMContext, LinkageName),
> + CompileUnit.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
> - getCastToEmpty(Type),
> + Type.getNode(),
> ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit),
> ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition),
> - ConstantExpr::getBitCast(Val, EmptyStructPtr)
> + Val
> };
> -
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.global_variable.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::LinkOnceAnyLinkage,
> - Init,
> "llvm.dbg.global_variable");
> - GV->setSection("llvm.metadata");
> - return DIGlobalVariable(GV);
> +
> + Value *const *Vs = &Elts[0];
> + MDNode *Node = MDNode::get(VMContext,Vs, 12);
> +
> + // Create a named metadata so that we do not lose this mdnode.
> + NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv");
> + NMD->addElement(Node);
> +
> + return DIGlobalVariable(Node);
> }
>
>
> @@ -807,44 +688,28 @@
> const std::string &Name,
> DICompileUnit CompileUnit,
> unsigned LineNo,
> DIType Type) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(Tag),
> - getCastToEmpty(Context),
> - GetStringConstant(Name),
> - getCastToEmpty(CompileUnit),
> + Context.getNode(),
> + MDString::get(VMContext, Name),
> + CompileUnit.getNode(),
> ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
> - getCastToEmpty(Type)
> + Type.getNode(),
> };
>
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.variable.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init, "llvm.dbg.variable");
> - GV->setSection("llvm.metadata");
> - return DIVariable(GV);
> + return DIVariable(MDNode::get(VMContext, &Elts[0], 6));
> }
>
>
> /// CreateBlock - This creates a descriptor for a lexical block with
> the
> /// specified parent VMContext.
> DIBlock DIFactory::CreateBlock(DIDescriptor Context) {
> - Constant *Elts[] = {
> + Value *Elts[] = {
> GetTagConstant(dwarf::DW_TAG_lexical_block),
> - getCastToEmpty(Context)
> + Context.getNode()
> };
> -
> - Constant *Init = ConstantStruct::get(VMContext, Elts,
> - sizeof(Elts)/sizeof(Elts[0]));
> -
> - M.addTypeName("llvm.dbg.block.type", Init->getType());
> - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
> -
> GlobalValue::InternalLinkage,
> - Init, "llvm.dbg.block");
> - GV->setSection("llvm.metadata");
> - return DIBlock(GV);
> +
> + return DIBlock(MDNode::get(VMContext, &Elts[0], 2));
> }
>
>
> @@ -866,7 +731,7 @@
> Value *Args[] = {
> ConstantInt::get(llvm::Type::getInt32Ty(VMContext), LineNo),
> ConstantInt::get(llvm::Type::getInt32Ty(VMContext), ColNo),
> - getCastToEmpty(CU)
> + CU.getNode()
> };
> CallInst::Create(StopPointFn, Args, Args+3, "", BB);
> }
> @@ -879,7 +744,7 @@
> FuncStartFn = Intrinsic::getDeclaration(&M,
> Intrinsic::dbg_func_start);
>
> // Call llvm.dbg.func.start which also implicitly sets a stoppoint.
> - CallInst::Create(FuncStartFn, getCastToEmpty(SP), "", BB);
> + CallInst::Create(FuncStartFn, SP.getNode(), "", BB);
> }
>
> /// InsertRegionStart - Insert a new llvm.dbg.region.start intrinsic
> call to
> @@ -890,7 +755,7 @@
> RegionStartFn = Intrinsic::getDeclaration(&M,
> Intrinsic::dbg_region_start);
>
> // Call llvm.dbg.func.start.
> - CallInst::Create(RegionStartFn, getCastToEmpty(D), "", BB);
> + CallInst::Create(RegionStartFn, D.getNode(), "", BB);
> }
>
> /// InsertRegionEnd - Insert a new llvm.dbg.region.end intrinsic
> call to
> @@ -901,7 +766,7 @@
> RegionEndFn = Intrinsic::getDeclaration(&M,
> Intrinsic::dbg_region_end);
>
> // Call llvm.dbg.region.end.
> - CallInst::Create(RegionEndFn, getCastToEmpty(D), "", BB);
> + CallInst::Create(RegionEndFn, D.getNode(), "", BB);
> }
>
> /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
> @@ -912,17 +777,19 @@
> if (!DeclareFn)
> DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
>
> - Value *Args[] = { Storage, getCastToEmpty(D) };
> + Value *Args[] = { Storage, D.getNode() };
> CallInst::Create(DeclareFn, Args, Args+2, "", BB);
> }
>
> +
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> // DebugInfoFinder implementations.
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
>
> /// processModule - Process entire module and collect debug info.
> void DebugInfoFinder::processModule(Module &M) {
> -
> +
> +
> for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
> for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI !
> = FE; ++FI)
> for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end
> (); BI != BE;
> @@ -938,15 +805,13 @@
> else if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI))
> processDeclare(DDI);
> }
> -
> - for (Module::global_iterator GVI = M.global_begin(), GVE =
> M.global_end();
> - GVI != GVE; ++GVI) {
> - GlobalVariable *GV = GVI;
> - if (!GV->hasName() || !GV->isConstant()
> - || strncmp(GV->getName().data(),
> "llvm.dbg.global_variable", 24)
> - || !GV->hasInitializer())
> - continue;
> - DIGlobalVariable DIG(GV);
> +
> + NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv");
> + if (!NMD)
> + return;
> +
> + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) {
> + DIGlobalVariable DIG(cast<MDNode>(NMD->getElement(i)));
> if (addGlobalVariable(DIG)) {
> addCompileUnit(DIG.getCompileUnit());
> processType(DIG.getType());
> @@ -961,20 +826,20 @@
>
> addCompileUnit(DT.getCompileUnit());
> if (DT.isCompositeType(DT.getTag())) {
> - DICompositeType DCT(DT.getGV());
> + DICompositeType DCT(DT.getNode());
> processType(DCT.getTypeDerivedFrom());
> DIArray DA = DCT.getTypeArray();
> if (!DA.isNull())
> for (unsigned i = 0, e = DA.getNumElements(); i != e; ++i) {
> DIDescriptor D = DA.getElement(i);
> - DIType TypeE = DIType(D.getGV());
> + DIType TypeE = DIType(D.getNode());
> if (!TypeE.isNull())
> processType(TypeE);
> else
> - processSubprogram(DISubprogram(D.getGV()));
> + processSubprogram(DISubprogram(D.getNode()));
> }
> } else if (DT.isDerivedType(DT.getTag())) {
> - DIDerivedType DDT(DT.getGV());
> + DIDerivedType DDT(DT.getNode());
> if (!DDT.isNull())
> processType(DDT.getTypeDerivedFrom());
> }
> @@ -992,35 +857,35 @@
>
> /// processStopPoint - Process DbgStopPointInst.
> void DebugInfoFinder::processStopPoint(DbgStopPointInst *SPI) {
> - GlobalVariable *Context = dyn_cast<GlobalVariable>(SPI->getContext
> ());
> + MDNode *Context = dyn_cast<MDNode>(SPI->getContext());
> addCompileUnit(DICompileUnit(Context));
> }
>
> /// processFuncStart - Process DbgFuncStartInst.
> void DebugInfoFinder::processFuncStart(DbgFuncStartInst *FSI) {
> - GlobalVariable *SP = dyn_cast<GlobalVariable>(FSI->getSubprogram
> ());
> + MDNode *SP = dyn_cast<MDNode>(FSI->getSubprogram());
> processSubprogram(DISubprogram(SP));
> }
>
> /// processRegionStart - Process DbgRegionStart.
> void DebugInfoFinder::processRegionStart(DbgRegionStartInst *DRS) {
> - GlobalVariable *SP = dyn_cast<GlobalVariable>(DRS->getContext());
> + MDNode *SP = dyn_cast<MDNode>(DRS->getContext());
> processSubprogram(DISubprogram(SP));
> }
>
> /// processRegionEnd - Process DbgRegionEnd.
> void DebugInfoFinder::processRegionEnd(DbgRegionEndInst *DRE) {
> - GlobalVariable *SP = dyn_cast<GlobalVariable>(DRE->getContext());
> + MDNode *SP = dyn_cast<MDNode>(DRE->getContext());
> processSubprogram(DISubprogram(SP));
> }
>
> /// processDeclare - Process DbgDeclareInst.
> void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) {
> - DIVariable DV(cast<GlobalVariable>(DDI->getVariable()));
> + DIVariable DV(cast<MDNode>(DDI->getVariable()));
> if (DV.isNull())
> return;
>
> - if (!NodesSeen.insert(DV.getGV()))
> + if (!NodesSeen.insert(DV.getNode()))
> return;
>
> addCompileUnit(DV.getCompileUnit());
> @@ -1032,10 +897,10 @@
> if (DT.isNull())
> return false;
>
> - if (!NodesSeen.insert(DT.getGV()))
> + if (!NodesSeen.insert(DT.getNode()))
> return false;
>
> - TYs.push_back(DT.getGV());
> + TYs.push_back(DT.getNode());
> return true;
> }
>
> @@ -1044,10 +909,10 @@
> if (CU.isNull())
> return false;
>
> - if (!NodesSeen.insert(CU.getGV()))
> + if (!NodesSeen.insert(CU.getNode()))
> return false;
>
> - CUs.push_back(CU.getGV());
> + CUs.push_back(CU.getNode());
> return true;
> }
>
> @@ -1056,10 +921,10 @@
> if (DIG.isNull())
> return false;
>
> - if (!NodesSeen.insert(DIG.getGV()))
> + if (!NodesSeen.insert(DIG.getNode()))
> return false;
>
> - GVs.push_back(DIG.getGV());
> + GVs.push_back(DIG.getNode());
> return true;
> }
>
> @@ -1068,10 +933,10 @@
> if (SP.isNull())
> return false;
>
> - if (!NodesSeen.insert(SP.getGV()))
> + if (!NodesSeen.insert(SP.getNode()))
> return false;
>
> - SPs.push_back(SP.getGV());
> + SPs.push_back(SP.getNode());
> return true;
> }
>
> @@ -1124,31 +989,17 @@
>
> Value *findDbgGlobalDeclare(GlobalVariable *V) {
> const Module *M = V->getParent();
> + NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.gv");
> + if (!NMD)
> + return 0;
>
> - const Type *Ty = M->getTypeByName
> ("llvm.dbg.global_variable.type");
> - if (!Ty) return 0;
> -
> - Ty = PointerType::get(Ty, 0);
> -
> - Value *Val = V->stripPointerCasts();
> - for (Value::use_iterator I = Val->use_begin(), E = Val->use_end
> ();
> - I != E; ++I) {
> - if (ConstantExpr *CE = dyn_cast<ConstantExpr>(I)) {
> - if (CE->getOpcode() == Instruction::BitCast) {
> - Value *VV = CE;
> -
> - while (VV->hasOneUse())
> - VV = *VV->use_begin();
> -
> - if (VV->getType() == Ty)
> - return VV;
> - }
> - }
> + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) {
> + DIGlobalVariable DIG(cast_or_null<MDNode>(NMD->getElement(i)));
> + if (DIG.isNull())
> + continue;
> + if (DIG.getGlobal() == V)
> + return DIG.getNode();
> }
> -
> - if (Val->getType() == Ty)
> - return Val;
> -
> return 0;
> }
>
> @@ -1185,7 +1036,7 @@
> if (GlobalVariable *GV = dyn_cast<GlobalVariable>
> (const_cast<Value*>(V))) {
> Value *DIGV = findDbgGlobalDeclare(GV);
> if (!DIGV) return false;
> - DIGlobalVariable Var(cast<GlobalVariable>(DIGV));
> + DIGlobalVariable Var(cast<MDNode>(DIGV));
>
> Var.getDisplayName(DisplayName);
> LineNo = Var.getLineNumber();
> @@ -1194,7 +1045,7 @@
> } else {
> const DbgDeclareInst *DDI = findDbgDeclare(V);
> if (!DDI) return false;
> - DIVariable Var(cast<GlobalVariable>(DDI->getVariable()));
> + DIVariable Var(cast<MDNode>(DDI->getVariable()));
>
> Var.getName(DisplayName);
> LineNo = Var.getLineNumber();
> @@ -1252,7 +1103,7 @@
> Value *Context = SPI.getContext();
>
> // If this location is already tracked then use it.
> - DebugLocTuple Tuple(cast<GlobalVariable>(Context), SPI.getLine(),
> + DebugLocTuple Tuple(cast<MDNode>(Context), SPI.getLine(),
> SPI.getColumn());
> DenseMap<DebugLocTuple, unsigned>::iterator II
> = DebugLocInfo.DebugIdMap.find(Tuple);
> @@ -1274,12 +1125,12 @@
> DebugLoc DL;
> Value *SP = FSI.getSubprogram();
>
> - DISubprogram Subprogram(cast<GlobalVariable>(SP));
> + DISubprogram Subprogram(cast<MDNode>(SP));
> unsigned Line = Subprogram.getLineNumber();
> DICompileUnit CU(Subprogram.getCompileUnit());
>
> // If this location is already tracked then use it.
> - DebugLocTuple Tuple(CU.getGV(), Line, /* Column */ 0);
> + DebugLocTuple Tuple(CU.getNode(), Line, /* Column */ 0);
> DenseMap<DebugLocTuple, unsigned>::iterator II
> = DebugLocInfo.DebugIdMap.find(Tuple);
> if (II != DebugLocInfo.DebugIdMap.end())
> @@ -1295,7 +1146,7 @@
>
> /// isInlinedFnStart - Return true if FSI is starting an inlined
> function.
> bool isInlinedFnStart(DbgFuncStartInst &FSI, const Function
> *CurrentFn) {
> - DISubprogram Subprogram(cast<GlobalVariable>(FSI.getSubprogram
> ()));
> + DISubprogram Subprogram(cast<MDNode>(FSI.getSubprogram()));
> if (Subprogram.describes(CurrentFn))
> return false;
>
> @@ -1304,11 +1155,10 @@
>
> /// isInlinedFnEnd - Return true if REI is ending an inlined
> function.
> bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function
> *CurrentFn) {
> - DISubprogram Subprogram(cast<GlobalVariable>(REI.getContext()));
> + DISubprogram Subprogram(cast<MDNode>(REI.getContext()));
> if (Subprogram.isNull() || Subprogram.describes(CurrentFn))
> return false;
>
> return true;
> }
> -
> }
>
> Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
> +++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Aug 25 00:24:07 2009
> @@ -98,6 +98,8 @@
> for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; )
> UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we
> remove
>
> + // Check debug info intrinsics.
> + CheckDebugInfoIntrinsics(M);
> return false;
> }
>
>
> Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Aug 25
> 00:24:07 2009
> @@ -16,7 +16,7 @@
> #include "llvm/Constants.h"
> #include "llvm/DerivedTypes.h"
> #include "llvm/InlineAsm.h"
> -#include "llvm/Instructions.h"
> +#include "llvm/IntrinsicInst.h"
> #include "llvm/LLVMContext.h"
> #include "llvm/Metadata.h"
> #include "llvm/Module.h"
> @@ -2192,7 +2192,10 @@
> }
> }
> std::vector<std::pair<Function*, Function*> >().swap
> (UpgradedIntrinsics);
> -
> +
> + // Check debug info intrinsics.
> + CheckDebugInfoIntrinsics(TheModule);
> +
> return TheModule;
> }
>
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Aug 25
> 00:24:07 2009
> @@ -1739,11 +1739,10 @@
> // Print source line info.
> O.PadToColumn(MAI->getCommentColumn());
> O << MAI->getCommentString() << " SrcLine ";
> - if (DLT.CompileUnit->hasInitializer()) {
> - Constant *Name = DLT.CompileUnit->getInitializer();
> - if (ConstantArray *NameString = dyn_cast<ConstantArray>(Name))
> - if (NameString->isString())
> - O << NameString->getAsString() << " ";
> + if (DLT.CompileUnit) {
> + std::string Str;
> + DICompileUnit CU(DLT.CompileUnit);
> + O << CU.getFilename(Str) << " ";
> }
> O << DLT.Line;
> if (DLT.Col != 0)
> @@ -1761,11 +1760,10 @@
> // Print source line info
> O.PadToColumn(MAI->getCommentColumn());
> O << MAI->getCommentString() << " SrcLine ";
> - if (DLT.CompileUnit->hasInitializer()) {
> - Constant *Name = DLT.CompileUnit->getInitializer();
> - if (ConstantArray *NameString = dyn_cast<ConstantArray>(Name))
> - if (NameString->isString())
> - O << NameString->getAsString() << " ";
> + if (DLT.CompileUnit) {
> + std::string Str;
> + DICompileUnit CU(DLT.CompileUnit);
> + O << CU.getFilename(Str) << " ";
> }
> O << DLT.Line;
> if (DLT.Col != 0)
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Aug 25
> 00:24:07 2009
> @@ -10,7 +10,7 @@
> // This file contains support for writing dwarf debug info into asm
> files.
> //
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> -
> +#define DEBUG_TYPE "dwarfdebug"
> #include "DwarfDebug.h"
> #include "llvm/Module.h"
> #include "llvm/CodeGen/MachineFunction.h"
> @@ -24,6 +24,7 @@
> #include "llvm/Target/TargetRegisterInfo.h"
> #include "llvm/ADT/StringExtras.h"
> #include "llvm/Support/Timer.h"
> +#include "llvm/Support/Debug.h"
> #include "llvm/System/Path.h"
> using namespace llvm;
>
> @@ -56,11 +57,13 @@
>
> /// GVToDieMap - Tracks the mapping of unit level debug informaton
> /// variables to debug information entries.
> - std::map<GlobalVariable *, DIE *> GVToDieMap;
> + /// FIXME : Rename GVToDieMap -> NodeToDieMap
> + std::map<MDNode *, DIE *> GVToDieMap;
>
> /// GVToDIEEntryMap - Tracks the mapping of unit level debug
> informaton
> /// descriptors to debug information entries using a DIEEntry proxy.
> - std::map<GlobalVariable *, DIEEntry *> GVToDIEEntryMap;
> + /// FIXME : Rename
> + std::map<MDNode *, DIEEntry *> GVToDIEEntryMap;
>
> /// Globals - A map of globally visible named entities for this
> unit.
> ///
> @@ -89,12 +92,12 @@
>
> /// getDieMapSlotFor - Returns the debug information entry map
> slot for the
> /// specified debug variable.
> - DIE *&getDieMapSlotFor(GlobalVariable *GV) { return GVToDieMap
> [GV]; }
> + DIE *&getDieMapSlotFor(MDNode *N) { return GVToDieMap[N]; }
>
> /// getDIEEntrySlotFor - Returns the debug information entry proxy
> slot for
> /// the specified debug variable.
> - DIEEntry *&getDIEEntrySlotFor(GlobalVariable *GV) {
> - return GVToDIEEntryMap[GV];
> + DIEEntry *&getDIEEntrySlotFor(MDNode *N) {
> + return GVToDIEEntryMap[N];
> }
>
> /// AddDie - Adds or interns the DIE to the compile unit.
> @@ -239,7 +242,7 @@
> for (unsigned j = 0, M = Values.size(); j < M; ++j)
> delete Values[j];
>
> - for (DenseMap<const GlobalVariable *, DbgScope *>::iterator
> + for (DenseMap<const MDNode *, DbgScope *>::iterator
> I = AbstractInstanceRootMap.begin(),
> E = AbstractInstanceRootMap.end(); I != E;++I)
> delete I->second;
> @@ -531,7 +534,7 @@
> return;
>
> // Check for pre-existence.
> - DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getGV());
> + DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getNode());
>
> // If it exists then use the existing value.
> if (Slot) {
> @@ -545,19 +548,20 @@
> // Construct type.
> DIE Buffer(dwarf::DW_TAG_base_type);
> if (Ty.isBasicType(Ty.getTag()))
> - ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getGV()));
> - else if (Ty.isDerivedType(Ty.getTag()))
> - ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getGV()));
> + ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getNode()));
> + else if (Ty.isCompositeType(Ty.getTag()))
> + ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getNode()));
> else {
> - assert(Ty.isCompositeType(Ty.getTag()) && "Unknown kind of
> DIType");
> - ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV()));
> + assert(Ty.isDerivedType(Ty.getTag()) && "Unknown kind of
> DIType");
> + ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getNode()));
> +
> }
>
> // Add debug information entry to entity and appropriate context.
> DIE *Die = NULL;
> DIDescriptor Context = Ty.getContext();
> if (!Context.isNull())
> - Die = DW_Unit->getDieMapSlotFor(Context.getGV());
> + Die = DW_Unit->getDieMapSlotFor(Context.getNode());
>
> if (Die) {
> DIE *Child = new DIE(Buffer);
> @@ -642,7 +646,7 @@
> // Add enumerators to enumeration type.
> for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
> DIE *ElemDie = NULL;
> - DIEnumerator Enum(Elements.getElement(i).getGV());
> + DIEnumerator Enum(Elements.getElement(i).getNode());
> ElemDie = ConstructEnumTypeDIE(DW_Unit, &Enum);
> Buffer.AddChild(ElemDie);
> }
> @@ -652,7 +656,7 @@
> // Add return type.
> DIArray Elements = CTy.getTypeArray();
> DIDescriptor RTy = Elements.getElement(0);
> - AddType(DW_Unit, &Buffer, DIType(RTy.getGV()));
> + AddType(DW_Unit, &Buffer, DIType(RTy.getNode()));
>
> // Add prototype flag.
> AddUInt(&Buffer, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag, 1);
> @@ -661,7 +665,7 @@
> for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) {
> DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
> DIDescriptor Ty = Elements.getElement(i);
> - AddType(DW_Unit, Arg, DIType(Ty.getGV()));
> + AddType(DW_Unit, Arg, DIType(Ty.getNode()));
> Buffer.AddChild(Arg);
> }
> }
> @@ -679,13 +683,15 @@
> // Add elements to structure type.
> for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
> DIDescriptor Element = Elements.getElement(i);
> + if (Element.isNull())
> + continue;
> DIE *ElemDie = NULL;
> if (Element.getTag() == dwarf::DW_TAG_subprogram)
> ElemDie = CreateSubprogramDIE(DW_Unit,
> - DISubprogram(Element.getGV()));
> + DISubprogram(Element.getNode
> ()));
> else
> ElemDie = CreateMemberDIE(DW_Unit,
> - DIDerivedType(Element.getGV()));
> + DIDerivedType(Element.getNode()));
> Buffer.AddChild(ElemDie);
> }
>
> @@ -765,7 +771,7 @@
> for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
> DIDescriptor Element = Elements.getElement(i);
> if (Element.getTag() == dwarf::DW_TAG_subrange_type)
> - ConstructSubrangeDIE(Buffer, DISubrange(Element.getGV()),
> IndexTy);
> + ConstructSubrangeDIE(Buffer, DISubrange(Element.getNode()),
> IndexTy);
> }
> }
>
> @@ -892,7 +898,7 @@
> if (Args.isNull() || SPTag != dwarf::DW_TAG_subroutine_type)
> AddType(DW_Unit, SPDie, SPTy);
> else
> - AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV()));
> + AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getNode()));
> }
>
> if (!SP.isDefinition()) {
> @@ -903,7 +909,7 @@
> if (SPTag == dwarf::DW_TAG_subroutine_type)
> for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) {
> DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
> - AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV()));
> + AddType(DW_Unit, Arg, DIType(Args.getElement(i).getNode()));
> AddUInt(Arg, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag,
> 1); // ??
> SPDie->AddChild(Arg);
> }
> @@ -913,7 +919,7 @@
> AddUInt(SPDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);
>
> // DW_TAG_inlined_subroutine may refer to this DIE.
> - DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getGV());
> + DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getNode());
> Slot = SPDie;
> return SPDie;
> }
> @@ -922,7 +928,7 @@
> ///
> CompileUnit &DwarfDebug::FindCompileUnit(DICompileUnit Unit) const {
> DenseMap<Value *, CompileUnit *>::const_iterator I =
> - CompileUnitMap.find(Unit.getGV());
> + CompileUnitMap.find(Unit.getNode());
> assert(I != CompileUnitMap.end() && "Missing compile unit.");
> return *I->second;
> }
> @@ -975,26 +981,26 @@
>
> /// getOrCreateScope - Returns the scope associated with the given
> descriptor.
> ///
> -DbgScope *DwarfDebug::getOrCreateScope(GlobalVariable *V) {
> - DbgScope *&Slot = DbgScopeMap[V];
> +DbgScope *DwarfDebug::getOrCreateScope(MDNode *N) {
> + DbgScope *&Slot = DbgScopeMap[N];
> if (Slot) return Slot;
>
> DbgScope *Parent = NULL;
> - DIBlock Block(V);
> + DIBlock Block(N);
>
> // Don't create a new scope if we already created one for an
> inlined function.
> - DenseMap<const GlobalVariable *, DbgScope *>::iterator
> - II = AbstractInstanceRootMap.find(V);
> + DenseMap<const MDNode *, DbgScope *>::iterator
> + II = AbstractInstanceRootMap.find(N);
> if (II != AbstractInstanceRootMap.end())
> return LexicalScopeStack.back();
>
> if (!Block.isNull()) {
> DIDescriptor ParentDesc = Block.getContext();
> Parent =
> - ParentDesc.isNull() ? NULL : getOrCreateScope
> (ParentDesc.getGV());
> + ParentDesc.isNull() ? NULL : getOrCreateScope
> (ParentDesc.getNode());
> }
>
> - Slot = new DbgScope(Parent, DIDescriptor(V));
> + Slot = new DbgScope(Parent, DIDescriptor(N));
>
> if (Parent)
> Parent->AddScope(Slot);
> @@ -1103,10 +1109,10 @@
> return;
>
> // Get the subprogram debug information entry.
> - DISubprogram SPD(Desc.getGV());
> + DISubprogram SPD(Desc.getNode());
>
> // Get the subprogram die.
> - DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getGV());
> + DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getNode());
> assert(SPDie && "Missing subprogram descriptor");
>
> if (!AbstractScope) {
> @@ -1179,8 +1185,8 @@
> return SrcId;
> }
>
> -void DwarfDebug::ConstructCompileUnit(GlobalVariable *GV) {
> - DICompileUnit DIUnit(GV);
> +void DwarfDebug::ConstructCompileUnit(MDNode *N) {
> + DICompileUnit DIUnit(N);
> std::string Dir, FN, Prod;
> unsigned ID = GetOrCreateSourceID(DIUnit.getDirectory(Dir),
> DIUnit.getFilename(FN));
> @@ -1217,15 +1223,15 @@
> ModuleCU = Unit;
> }
>
> - CompileUnitMap[DIUnit.getGV()] = Unit;
> + CompileUnitMap[DIUnit.getNode()] = Unit;
> CompileUnits.push_back(Unit);
> }
>
> -void DwarfDebug::ConstructGlobalVariableDIE(GlobalVariable *GV) {
> - DIGlobalVariable DI_GV(GV);
> +void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) {
> + DIGlobalVariable DI_GV(N);
>
> // Check for pre-existence.
> - DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getGV());
> + DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getNode());
> if (Slot)
> return;
>
> @@ -1251,11 +1257,11 @@
> return;
> }
>
> -void DwarfDebug::ConstructSubprogram(GlobalVariable *GV) {
> - DISubprogram SP(GV);
> +void DwarfDebug::ConstructSubprogram(MDNode *N) {
> + DISubprogram SP(N);
>
> // Check for pre-existence.
> - DIE *&Slot = ModuleCU->getDieMapSlotFor(GV);
> + DIE *&Slot = ModuleCU->getDieMapSlotFor(N);
> if (Slot)
> return;
>
> @@ -1538,6 +1544,9 @@
> /// correspondence to the source line list.
> unsigned DwarfDebug::RecordSourceLine(unsigned Line, unsigned Col,
> DICompileUnit CU) {
> + if (!MMI)
> + return 0;
> +
> if (TimePassesIsEnabled)
> DebugTimer->startTimer();
>
> @@ -1572,11 +1581,11 @@
> }
>
> /// RecordRegionStart - Indicate the start of a region.
> -unsigned DwarfDebug::RecordRegionStart(GlobalVariable *V) {
> +unsigned DwarfDebug::RecordRegionStart(MDNode *N) {
> if (TimePassesIsEnabled)
> DebugTimer->startTimer();
>
> - DbgScope *Scope = getOrCreateScope(V);
> + DbgScope *Scope = getOrCreateScope(N);
> unsigned ID = MMI->NextLabelID();
> if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID);
> LexicalScopeStack.push_back(Scope);
> @@ -1588,11 +1597,11 @@
> }
>
> /// RecordRegionEnd - Indicate the end of a region.
> -unsigned DwarfDebug::RecordRegionEnd(GlobalVariable *V) {
> +unsigned DwarfDebug::RecordRegionEnd(MDNode *N) {
> if (TimePassesIsEnabled)
> DebugTimer->startTimer();
>
> - DbgScope *Scope = getOrCreateScope(V);
> + DbgScope *Scope = getOrCreateScope(N);
> unsigned ID = MMI->NextLabelID();
> Scope->setEndLabelID(ID);
> // FIXME : region.end() may not be in the last basic block.
> @@ -1609,41 +1618,36 @@
> }
>
> /// RecordVariable - Indicate the declaration of a local variable.
> -void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned
> FrameIndex) {
> +void DwarfDebug::RecordVariable(MDNode *N, unsigned FrameIndex) {
> if (TimePassesIsEnabled)
> DebugTimer->startTimer();
>
> - DIDescriptor Desc(GV);
> + DIDescriptor Desc(N);
> DbgScope *Scope = NULL;
> bool InlinedFnVar = false;
>
> - if (Desc.getTag() == dwarf::DW_TAG_variable) {
> - // GV is a global variable.
> - DIGlobalVariable DG(GV);
> - Scope = getOrCreateScope(DG.getContext().getGV());
> - } else {
> + if (Desc.getTag() == dwarf::DW_TAG_variable)
> + Scope = getOrCreateScope(DIGlobalVariable(N).getContext
> ().getNode());
> + else {
> bool InlinedVar = false;
> - DIVariable DV(GV);
> - GlobalVariable *V = DV.getContext().getGV();
> - DISubprogram SP(V);
> + MDNode *Context = DIVariable(N).getContext().getNode();
> + DISubprogram SP(Context);
> if (!SP.isNull()) {
> // SP is inserted into DbgAbstractScopeMap when inlined function
> // start was recorded by RecordInlineFnStart.
> - DenseMap<GlobalVariable *, DbgScope *>::iterator
> - I = DbgAbstractScopeMap.find(SP.getGV());
> + DenseMap<MDNode *, DbgScope *>::iterator
> + I = DbgAbstractScopeMap.find(SP.getNode());
> if (I != DbgAbstractScopeMap.end()) {
> InlinedVar = true;
> Scope = I->second;
> }
> }
> - if (!InlinedVar) {
> - // GV is a local variable.
> - Scope = getOrCreateScope(V);
> - }
> + if (!InlinedVar)
> + Scope = getOrCreateScope(Context);
> }
>
> assert(Scope && "Unable to find the variable's scope");
> - DbgVariable *DV = new DbgVariable(DIVariable(GV), FrameIndex,
> InlinedFnVar);
> + DbgVariable *DV = new DbgVariable(DIVariable(N), FrameIndex,
> InlinedFnVar);
> Scope->AddVariable(DV);
>
> if (TimePassesIsEnabled)
> @@ -1661,17 +1665,17 @@
> if (TimePassesIsEnabled)
> DebugTimer->startTimer();
>
> - GlobalVariable *GV = SP.getGV();
> - DenseMap<const GlobalVariable *, DbgScope *>::iterator
> - II = AbstractInstanceRootMap.find(GV);
> + MDNode *Node = SP.getNode();
> + DenseMap<const MDNode *, DbgScope *>::iterator
> + II = AbstractInstanceRootMap.find(Node);
>
> if (II == AbstractInstanceRootMap.end()) {
> // Create an abstract instance entry for this inlined function
> if it doesn't
> // already exist.
> - DbgScope *Scope = new DbgScope(NULL, DIDescriptor(GV));
> + DbgScope *Scope = new DbgScope(NULL, DIDescriptor(Node));
>
> // Get the compile unit context.
> - DIE *SPDie = ModuleCU->getDieMapSlotFor(GV);
> + DIE *SPDie = ModuleCU->getDieMapSlotFor(Node);
> if (!SPDie)
> SPDie = CreateSubprogramDIE(ModuleCU, SP, false, true);
>
> @@ -1683,18 +1687,18 @@
> AddUInt(SPDie, dwarf::DW_AT_inline, 0,
> dwarf::DW_INL_declared_not_inlined);
>
> // Keep track of the abstract scope for this function.
> - DbgAbstractScopeMap[GV] = Scope;
> + DbgAbstractScopeMap[Node] = Scope;
>
> - AbstractInstanceRootMap[GV] = Scope;
> + AbstractInstanceRootMap[Node] = Scope;
> AbstractInstanceRootList.push_back(Scope);
> }
>
> // Create a concrete inlined instance for this inlined function.
> - DbgConcreteScope *ConcreteScope = new DbgConcreteScope
> (DIDescriptor(GV));
> + DbgConcreteScope *ConcreteScope = new DbgConcreteScope
> (DIDescriptor(Node));
> DIE *ScopeDie = new DIE(dwarf::DW_TAG_inlined_subroutine);
> ScopeDie->setAbstractCompileUnit(ModuleCU);
>
> - DIE *Origin = ModuleCU->getDieMapSlotFor(GV);
> + DIE *Origin = ModuleCU->getDieMapSlotFor(Node);
> AddDIEEntry(ScopeDie, dwarf::DW_AT_abstract_origin,
> dwarf::DW_FORM_ref4, Origin);
> AddUInt(ScopeDie, dwarf::DW_AT_call_file, 0, ModuleCU->getID());
> @@ -1708,20 +1712,20 @@
> LexicalScopeStack.back()->AddConcreteInst(ConcreteScope);
>
> // Keep track of the concrete scope that's inlined into this
> function.
> - DenseMap<GlobalVariable *, SmallVector<DbgScope *, 8> >::iterator
> - SI = DbgConcreteScopeMap.find(GV);
> + DenseMap<MDNode *, SmallVector<DbgScope *, 8> >::iterator
> + SI = DbgConcreteScopeMap.find(Node);
>
> if (SI == DbgConcreteScopeMap.end())
> - DbgConcreteScopeMap[GV].push_back(ConcreteScope);
> + DbgConcreteScopeMap[Node].push_back(ConcreteScope);
> else
> SI->second.push_back(ConcreteScope);
>
> // Track the start label for this inlined function.
> - DenseMap<GlobalVariable *, SmallVector<unsigned, 4> >::iterator
> - I = InlineInfo.find(GV);
> + DenseMap<MDNode *, SmallVector<unsigned, 4> >::iterator
> + I = InlineInfo.find(Node);
>
> if (I == InlineInfo.end())
> - InlineInfo[GV].push_back(LabelID);
> + InlineInfo[Node].push_back(LabelID);
> else
> I->second.push_back(LabelID);
>
> @@ -1739,9 +1743,9 @@
> if (TimePassesIsEnabled)
> DebugTimer->startTimer();
>
> - GlobalVariable *GV = SP.getGV();
> - DenseMap<GlobalVariable *, SmallVector<DbgScope *, 8> >::iterator
> - I = DbgConcreteScopeMap.find(GV);
> + MDNode *Node = SP.getNode();
> + DenseMap<MDNode *, SmallVector<DbgScope *, 8> >::iterator
> + I = DbgConcreteScopeMap.find(Node);
>
> if (I == DbgConcreteScopeMap.end()) {
> // FIXME: Can this situation actually happen? And if so, should
> it?
> @@ -2446,11 +2450,11 @@
> Asm->EmitInt16(dwarf::DWARF_VERSION); Asm->EOL("Dwarf Version");
> Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in
> bytes)");
>
> - for (DenseMap<GlobalVariable *, SmallVector<unsigned, 4>
> >::iterator
> + for (DenseMap<MDNode *, SmallVector<unsigned, 4> >::iterator
> I = InlineInfo.begin(), E = InlineInfo.end(); I != E; ++I) {
> - GlobalVariable *GV = I->first;
> + MDNode *Node = I->first;
> SmallVector<unsigned, 4> &Labels = I->second;
> - DISubprogram SP(GV);
> + DISubprogram SP(Node);
> std::string Name;
> std::string LName;
>
> @@ -2476,7 +2480,7 @@
>
> for (SmallVector<unsigned, 4>::iterator LI = Labels.begin(),
> LE = Labels.end(); LI != LE; ++LI) {
> - DIE *SP = ModuleCU->getDieMapSlotFor(GV);
> + DIE *SP = ModuleCU->getDieMapSlotFor(Node);
> Asm->EmitInt32(SP->getOffset()); Asm->EOL("DIE offset");
>
> if (TD->getPointerSize() == sizeof(int32_t))
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Aug 25
> 00:24:07 2009
> @@ -139,25 +139,25 @@
> DbgScope *FunctionDbgScope;
>
> /// DbgScopeMap - Tracks the scopes in the current function.
> - DenseMap<GlobalVariable *, DbgScope *> DbgScopeMap;
> + DenseMap<MDNode *, DbgScope *> DbgScopeMap;
>
> /// DbgAbstractScopeMap - Tracks abstract instance scopes in the
> current
> /// function.
> - DenseMap<GlobalVariable *, DbgScope *> DbgAbstractScopeMap;
> + DenseMap<MDNode *, DbgScope *> DbgAbstractScopeMap;
>
> /// DbgConcreteScopeMap - Tracks concrete instance scopes in the
> current
> /// function.
> - DenseMap<GlobalVariable *,
> + DenseMap<MDNode *,
> SmallVector<DbgScope *, 8> > DbgConcreteScopeMap;
>
> /// InlineInfo - Keep track of inlined functions and their
> location. This
> /// information is used to populate debug_inlined section.
> - DenseMap<GlobalVariable *, SmallVector<unsigned, 4> > InlineInfo;
> + DenseMap<MDNode *, SmallVector<unsigned, 4> > InlineInfo;
>
> /// AbstractInstanceRootMap - Map of abstract instance roots of
> inlined
> /// functions. These are subroutine entries that contain a
> DW_AT_inline
> /// attribute.
> - DenseMap<const GlobalVariable *, DbgScope *>
> AbstractInstanceRootMap;
> + DenseMap<const MDNode *, DbgScope *> AbstractInstanceRootMap;
>
> /// AbstractInstanceRootList - List of abstract instance roots of
> inlined
> /// functions. These are subroutine entries that contain a
> DW_AT_inline
> @@ -335,7 +335,7 @@
>
> /// getOrCreateScope - Returns the scope associated with the given
> descriptor.
> ///
> - DbgScope *getOrCreateScope(GlobalVariable *V);
> + DbgScope *getOrCreateScope(MDNode *N);
>
> /// ConstructDbgScope - Construct the components of a scope.
> ///
> @@ -448,11 +448,11 @@
> unsigned GetOrCreateSourceID(const std::string &DirName,
> const std::string &FileName);
>
> - void ConstructCompileUnit(GlobalVariable *GV);
> + void ConstructCompileUnit(MDNode *N);
>
> - void ConstructGlobalVariableDIE(GlobalVariable *GV);
> + void ConstructGlobalVariableDIE(MDNode *N);
>
> - void ConstructSubprogram(GlobalVariable *GV);
> + void ConstructSubprogram(MDNode *N);
>
> public:
> //
> =
> =
> =--------------------------------------------------------------------
> ===//
> @@ -506,13 +506,13 @@
> const std::string &FileName);
>
> /// RecordRegionStart - Indicate the start of a region.
> - unsigned RecordRegionStart(GlobalVariable *V);
> + unsigned RecordRegionStart(MDNode *N);
>
> /// RecordRegionEnd - Indicate the end of a region.
> - unsigned RecordRegionEnd(GlobalVariable *V);
> + unsigned RecordRegionEnd(MDNode *N);
>
> /// RecordVariable - Indicate the declaration of a local variable.
> - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex);
> + void RecordVariable(MDNode *N, unsigned FrameIndex);
>
> //// RecordInlinedFnStart - Indicate the start of inlined
> subroutine.
> unsigned RecordInlinedFnStart(DISubprogram &SP, DICompileUnit CU,
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Aug 25
> 00:24:07 2009
> @@ -80,13 +80,13 @@
> }
>
> /// RecordRegionStart - Indicate the start of a region.
> -unsigned DwarfWriter::RecordRegionStart(GlobalVariable *V) {
> - return DD->RecordRegionStart(V);
> +unsigned DwarfWriter::RecordRegionStart(MDNode *N) {
> + return DD->RecordRegionStart(N);
> }
>
> /// RecordRegionEnd - Indicate the end of a region.
> -unsigned DwarfWriter::RecordRegionEnd(GlobalVariable *V) {
> - return DD->RecordRegionEnd(V);
> +unsigned DwarfWriter::RecordRegionEnd(MDNode *N) {
> + return DD->RecordRegionEnd(N);
> }
>
> /// getRecordSourceLineCount - Count source lines.
> @@ -96,8 +96,8 @@
>
> /// RecordVariable - Indicate the declaration of a local variable.
> ///
> -void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned
> FrameIndex) {
> - DD->RecordVariable(GV, FrameIndex);
> +void DwarfWriter::RecordVariable(MDNode *N, unsigned FrameIndex) {
> + DD->RecordVariable(N, FrameIndex);
> }
>
> /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging
> declarations should
> @@ -106,8 +106,7 @@
> return DD && DD->ShouldEmitDwarfDebug();
> }
>
> -//// RecordInlinedFnStart - Global variable GV is inlined at the
> location marked
> -//// by LabelID label.
> +//// RecordInlinedFnStart
> unsigned DwarfWriter::RecordInlinedFnStart(DISubprogram SP,
> DICompileUnit CU,
> unsigned Line, unsigned
> Col) {
> return DD->RecordInlinedFnStart(SP, CU, Line, Col);
>
> Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Aug 25 00:24:07
> 2009
> @@ -333,7 +333,7 @@
> /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the
> given
> /// source file, line, and column. If none currently exists, create
> a new
> /// DebugLocTuple, and insert it into the DebugIdMap.
> -unsigned MachineFunction::getOrCreateDebugLocID(GlobalVariable
> *CompileUnit,
> +unsigned MachineFunction::getOrCreateDebugLocID(MDNode *CompileUnit,
> unsigned Line,
> unsigned Col) {
> DebugLocTuple Tuple(CompileUnit, Line, Col);
> DenseMap<DebugLocTuple, unsigned>::iterator II
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Aug 25
> 00:24:07 2009
> @@ -335,7 +335,7 @@
> if (isValidDebugInfoIntrinsic(*RSI, CodeGenOpt::None) && DW
> && DW->ShouldEmitDwarfDebug()) {
> unsigned ID =
> - DW->RecordRegionStart(cast<GlobalVariable>(RSI->getContext
> ()));
> + DW->RecordRegionStart(RSI->getContext());
> const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
> BuildMI(MBB, DL, II).addImm(ID);
> }
> @@ -346,7 +346,7 @@
> if (isValidDebugInfoIntrinsic(*REI, CodeGenOpt::None) && DW
> && DW->ShouldEmitDwarfDebug()) {
> unsigned ID = 0;
> - DISubprogram Subprogram(cast<GlobalVariable>(REI->getContext
> ()));
> + DISubprogram Subprogram(REI->getContext());
> if (isInlinedFnEnd(*REI, MF.getFunction())) {
> // This is end of an inlined function.
> const TargetInstrDesc &II = TII.get
> (TargetInstrInfo::DBG_LABEL);
> @@ -359,7 +359,7 @@
> BuildMI(MBB, DL, II).addImm(ID);
> } else {
> const TargetInstrDesc &II = TII.get
> (TargetInstrInfo::DBG_LABEL);
> - ID = DW->RecordRegionEnd(cast<GlobalVariable>(REI-
> >getContext()));
> + ID = DW->RecordRegionEnd(REI->getContext());
> BuildMI(MBB, DL, II).addImm(ID);
> }
> }
> @@ -384,7 +384,7 @@
> setCurDebugLoc(ExtractDebugLocation(*FSI, MF.getDebugLocInfo
> ()));
>
> DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
> - DISubprogram SP(cast<GlobalVariable>(FSI->getSubprogram()));
> + DISubprogram SP(FSI->getSubprogram());
> unsigned LabelID = DW->RecordInlinedFnStart(SP,
> DICompileUnit
> (PrevLocTpl.CompileUnit),
> PrevLocTpl.Line,
> @@ -398,7 +398,7 @@
> MF.setDefaultDebugLoc(ExtractDebugLocation(*FSI,
> MF.getDebugLocInfo()));
>
> // llvm.dbg.func_start also defines beginning of function scope.
> - DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram
> ()));
> + DW->RecordRegionStart(FSI->getSubprogram());
> return true;
> }
> case Intrinsic::dbg_declare: {
> @@ -419,10 +419,7 @@
> if (SI == StaticAllocaMap.end()) break; // VLAs.
> int FI = SI->second;
>
> - // Determine the debug globalvariable.
> - GlobalValue *GV = cast<GlobalVariable>(Variable);
> -
> - DW->RecordVariable(cast<GlobalVariable>(GV), FI);
> + DW->RecordVariable(cast<MDNode>(Variable), FI);
> return true;
> }
> case Intrinsic::eh_exception: {
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Aug 25
> 00:24:07 2009
> @@ -1593,9 +1593,9 @@
> bool useLABEL = TLI.isOperationLegalOrCustom(ISD::DBG_LABEL,
> MVT::Other);
>
> const DbgStopPointSDNode *DSP = cast<DbgStopPointSDNode>(Node);
> - GlobalVariable *CU_GV = cast<GlobalVariable>(DSP->getCompileUnit
> ());
> - if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) {
> - DICompileUnit CU(cast<GlobalVariable>(DSP->getCompileUnit()));
> + MDNode *CU_Node = DSP->getCompileUnit();
> + if (DW && (useDEBUG_LOC || useLABEL)) {
> + DICompileUnit CU(CU_Node);
>
> unsigned Line = DSP->getLine();
> unsigned Col = DSP->getColumn();
> @@ -1607,7 +1607,7 @@
> return DAG.getNode(ISD::DEBUG_LOC, dl, MVT::Other, Node-
> >getOperand(0),
> DAG.getConstant(Line, MVT::i32),
> DAG.getConstant(Col, MVT::i32),
> - DAG.getSrcValue(CU.getGV()));
> + DAG.getSrcValue(CU.getNode()));
> } else {
> unsigned ID = DW->RecordSourceLine(Line, Col, CU);
> return DAG.getLabel(ISD::DBG_LABEL, dl, Node->getOperand(0),
> ID);
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 25
> 00:24:07 2009
> @@ -1286,7 +1286,7 @@
>
> SDValue SelectionDAG::getDbgStopPoint(DebugLoc DL, SDValue Root,
> unsigned Line, unsigned Col,
> - Value *CU) {
> + MDNode *CU) {
> SDNode *N = NodeAllocator.Allocate<DbgStopPointSDNode>();
> new (N) DbgStopPointSDNode(Root, Line, Col, CU);
> N->setDebugLoc(DL);
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue
> Aug 25 00:24:07 2009
> @@ -3876,7 +3876,7 @@
> if (isValidDebugInfoIntrinsic(RSI, OptLevel) && DW
> && DW->ShouldEmitDwarfDebug()) {
> unsigned LabelID =
> - DW->RecordRegionStart(cast<GlobalVariable>(RSI.getContext
> ()));
> + DW->RecordRegionStart(RSI.getContext());
> DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
> getRoot(), LabelID));
> }
> @@ -3891,7 +3891,7 @@
> return 0;
>
> MachineFunction &MF = DAG.getMachineFunction();
> - DISubprogram Subprogram(cast<GlobalVariable>(REI.getContext()));
> + DISubprogram Subprogram(REI.getContext());
>
> if (isInlinedFnEnd(REI, MF.getFunction())) {
> // This is end of inlined function. Debugging information for
> inlined
> @@ -3910,7 +3910,7 @@
> }
>
> unsigned LabelID =
> - DW->RecordRegionEnd(cast<GlobalVariable>(REI.getContext()));
> + DW->RecordRegionEnd(REI.getContext());
> DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
> getRoot(), LabelID));
> return 0;
> @@ -3942,7 +3942,7 @@
> if (!DW || !DW->ShouldEmitDwarfDebug())
> return 0;
> DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
> - DISubprogram SP(cast<GlobalVariable>(FSI.getSubprogram()));
> + DISubprogram SP(FSI.getSubprogram());
> DICompileUnit CU(PrevLocTpl.CompileUnit);
> unsigned LabelID = DW->RecordInlinedFnStart(SP, CU,
> PrevLocTpl.Line,
> @@ -3958,7 +3958,7 @@
> if (!DW || !DW->ShouldEmitDwarfDebug())
> return 0;
> // llvm.dbg.func_start also defines beginning of function scope.
> - DW->RecordRegionStart(cast<GlobalVariable>(FSI.getSubprogram()));
> + DW->RecordRegionStart(FSI.getSubprogram());
> return 0;
> }
> case Intrinsic::dbg_declare: {
> @@ -3981,7 +3981,7 @@
> if (!AI)
> return 0;
> int FI = FuncInfo.StaticAllocaMap[AI];
> - DW->RecordVariable(cast<GlobalVariable>(Variable), FI);
> + DW->RecordVariable(cast<MDNode>(Variable), FI);
> return 0;
> }
> case Intrinsic::eh_exception: {
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp Tue Aug 25
> 00:24:07 2009
> @@ -1,3 +1,4 @@
> +
> //===-- PIC16DebugInfo.cpp - Implementation for PIC16 Debug
> Information ======//
> //
> // The LLVM Compiler Infrastructure
> @@ -69,7 +70,7 @@
>
> // We also need to encode the the information about the base type of
> // pointer in TypeNo.
> - DIType BaseType = DIDerivedType(Ty.getGV()).getTypeDerivedFrom();
> + DIType BaseType = DIDerivedType(Ty.getNode()).getTypeDerivedFrom();
> PopulateDebugInfo(BaseType, TypeNo, HasAux, Aux, TagName);
> }
>
> @@ -78,7 +79,7 @@
> bool &HasAux, int Aux[],
> std::string &TagName) {
>
> - DICompositeType CTy = DICompositeType(Ty.getGV());
> + DICompositeType CTy = DICompositeType(Ty.getNode());
> DIArray Elements = CTy.getTypeArray();
> unsigned short size = 1;
> unsigned short Dimension[4]={0,0,0,0};
> @@ -87,7 +88,7 @@
> if (Element.getTag() == dwarf::DW_TAG_subrange_type) {
> TypeNo = TypeNo << PIC16Dbg::S_DERIVED;
> TypeNo = TypeNo | PIC16Dbg::DT_ARY;
> - DISubrange SubRange = DISubrange(Element.getGV());
> + DISubrange SubRange = DISubrange(Element.getNode());
> Dimension[i] = SubRange.getHi() - SubRange.getLo() + 1;
> // Each dimension is represented by 2 bytes starting at byte 9.
> Aux[8+i*2+0] = Dimension[i];
> @@ -110,7 +111,7 @@
> unsigned short
> &TypeNo,
> bool &HasAux, int
> Aux[],
> std::string
> &TagName) {
> - DICompositeType CTy = DICompositeType(Ty.getGV());
> + DICompositeType CTy = DICompositeType(Ty.getNode());
> TypeNo = TypeNo << PIC16Dbg::S_BASIC;
> if (Ty.getTag() == dwarf::DW_TAG_structure_type)
> TypeNo = TypeNo | PIC16Dbg::T_STRUCT;
> @@ -123,7 +124,7 @@
> // llvm.dbg.composite* global variable. Since we need to revisit
> // PIC16DebugInfo implementation anyways after the MDNodes based
> // framework is done, let us continue with the way it is.
> - std::string UniqueSuffix = "." + Ty.getGV()->getNameStr().substr
> (18);
> + std::string UniqueSuffix = "." + Ty.getNode()->getNameStr().substr
> (18);
> TagName += UniqueSuffix;
> unsigned short size = CTy.getSizeInBits()/8;
> // 7th and 8th byte represent size.
> @@ -210,11 +211,10 @@
> DbgFinder.processModule(M);
> if (DbgFinder.compile_unit_count() != 0) {
> // FIXME : What if more then one CUs are present in a module ?
> - GlobalVariable *CU = *DbgFinder.compile_unit_begin();
> + MDNode *CU = *DbgFinder.compile_unit_begin();
> EmitDebugDirectives = true;
> SwitchToCU(CU);
> }
> -
> // Emit debug info for decls of composite types.
> EmitCompositeTypeDecls(M);
> }
> @@ -259,7 +259,7 @@
> if (! EmitDebugDirectives) return;
> assert (! DL.isUnknown() && "can't change to invalid debug loc");
>
> - GlobalVariable *CU = MF.getDebugLocTuple(DL).CompileUnit;
> + MDNode *CU = MF.getDebugLocTuple(DL).CompileUnit;
> unsigned line = MF.getDebugLocTuple(DL).Line;
>
> SwitchToCU(CU);
> @@ -306,8 +306,7 @@
> int ElementAux[PIC16Dbg::AuxSize] = { 0 };
> std::string TagName = "";
> std::string ElementName;
> - GlobalVariable *GV = Element.getGV();
> - DIDerivedType DITy(GV);
> + DIDerivedType DITy(Element.getNode());
> DITy.getName(ElementName);
> unsigned short ElementSize = DITy.getSizeInBits()/8;
> // Get mangleddd name for this structure/union element.
> @@ -343,7 +342,7 @@
> CTy.getName(Name);
> // Get the number after llvm.dbg.composite and make
> UniqueSuffix from
> // it.
> - std::string DIVar = CTy.getGV()->getNameStr();
> + std::string DIVar = CTy.getNode()->getNameStr();
> std::string UniqueSuffix = "." + DIVar.substr(18);
> std::string MangledCTyName = Name + UniqueSuffix;
> unsigned short size = CTy.getSizeInBits()/8;
> @@ -441,7 +440,7 @@
> void PIC16DbgInfo::EmitVarDebugInfo(Module &M) {
> DebugInfoFinder DbgFinder;
> DbgFinder.processModule(M);
> -
> +
> for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin
> (),
> E = DbgFinder.global_variable_end(); I != E; ++I) {
> DIGlobalVariable DIGV(*I);
> @@ -466,7 +465,7 @@
>
> /// SwitchToCU - Switch to a new compilation unit.
> ///
> -void PIC16DbgInfo::SwitchToCU(GlobalVariable *CU) {
> +void PIC16DbgInfo::SwitchToCU(MDNode *CU) {
> // Get the file path from CU.
> DICompileUnit cu(CU);
> std::string DirName, FileName;
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h Tue Aug 25 00:24:07
> 2009
> @@ -117,7 +117,7 @@
>
>
> private:
> - void SwitchToCU (GlobalVariable *CU);
> + void SwitchToCU (MDNode *CU);
> void SwitchToLine (unsigned Line, bool IsInBeginFunction = false);
>
> void PopulateDebugInfo (DIType Ty, unsigned short &TypeNo, bool
> &HasAux,
>
> Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Tue Aug 25
> 00:24:07 2009
> @@ -203,167 +203,56 @@
> // llvm.dbg.region.end calls, and any globals they point to if now
> dead.
> static bool StripDebugInfo(Module &M) {
>
> - SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
> - findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
> - findUsedValues(M.getGlobalVariable("llvm.compiler.used"),
> llvmUsedValues);
> -
> - DebugInfoFinder DbgFinder;
> - DbgFinder.processModule(M);
> -
> - // These anchors use LinkOnce linkage so that the optimizer does
> not
> - // remove them accidently. Set InternalLinkage for all these debug
> - // info anchors.
> - for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
> - E = DbgFinder.compile_unit_end(); I != E; ++I)
> - (*I)->setLinkage(GlobalValue::InternalLinkage);
> - for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin
> (),
> - E = DbgFinder.global_variable_end(); I != E; ++I)
> - (*I)->setLinkage(GlobalValue::InternalLinkage);
> - for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(),
> - E = DbgFinder.subprogram_end(); I != E; ++I)
> - (*I)->setLinkage(GlobalValue::InternalLinkage);
> -
> -
> - // Delete all dbg variables.
> - for (Module::global_iterator I = M.global_begin(), E =
> M.global_end();
> - I != E; ++I) {
> - GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
> - if (!GV) continue;
> - if (!GV->use_empty() && llvmUsedValues.count(I) == 0) {
> - if (GV->getName().startswith("llvm.dbg")) {
> - GV->replaceAllUsesWith(UndefValue::get(GV->getType()));
> - }
> - }
> - }
> -
> + // Remove all of the calls to the debugger intrinsics, and remove
> them from
> + // the module.
> Function *FuncStart = M.getFunction("llvm.dbg.func.start");
> Function *StopPoint = M.getFunction("llvm.dbg.stoppoint");
> Function *RegionStart = M.getFunction("llvm.dbg.region.start");
> Function *RegionEnd = M.getFunction("llvm.dbg.region.end");
> Function *Declare = M.getFunction("llvm.dbg.declare");
>
> - std::vector<Constant*> DeadConstants;
> -
> - // Remove all of the calls to the debugger intrinsics, and remove
> them from
> - // the module.
> if (FuncStart) {
> while (!FuncStart->use_empty()) {
> CallInst *CI = cast<CallInst>(FuncStart->use_back());
> - Value *Arg = CI->getOperand(1);
> - assert(CI->use_empty() && "llvm.dbg intrinsic should have
> void result");
> CI->eraseFromParent();
> - if (Arg->use_empty())
> - if (Constant *C = dyn_cast<Constant>(Arg))
> - DeadConstants.push_back(C);
> }
> FuncStart->eraseFromParent();
> }
> if (StopPoint) {
> while (!StopPoint->use_empty()) {
> CallInst *CI = cast<CallInst>(StopPoint->use_back());
> - Value *Arg = CI->getOperand(3);
> - assert(CI->use_empty() && "llvm.dbg intrinsic should have
> void result");
> CI->eraseFromParent();
> - if (Arg->use_empty())
> - if (Constant *C = dyn_cast<Constant>(Arg))
> - DeadConstants.push_back(C);
> }
> StopPoint->eraseFromParent();
> }
> if (RegionStart) {
> while (!RegionStart->use_empty()) {
> CallInst *CI = cast<CallInst>(RegionStart->use_back());
> - Value *Arg = CI->getOperand(1);
> - assert(CI->use_empty() && "llvm.dbg intrinsic should have
> void result");
> CI->eraseFromParent();
> - if (Arg->use_empty())
> - if (Constant *C = dyn_cast<Constant>(Arg))
> - DeadConstants.push_back(C);
> }
> RegionStart->eraseFromParent();
> }
> if (RegionEnd) {
> while (!RegionEnd->use_empty()) {
> CallInst *CI = cast<CallInst>(RegionEnd->use_back());
> - Value *Arg = CI->getOperand(1);
> - assert(CI->use_empty() && "llvm.dbg intrinsic should have
> void result");
> CI->eraseFromParent();
> - if (Arg->use_empty())
> - if (Constant *C = dyn_cast<Constant>(Arg))
> - DeadConstants.push_back(C);
> }
> RegionEnd->eraseFromParent();
> }
> if (Declare) {
> while (!Declare->use_empty()) {
> CallInst *CI = cast<CallInst>(Declare->use_back());
> - Value *Arg1 = CI->getOperand(1);
> - Value *Arg2 = CI->getOperand(2);
> - assert(CI->use_empty() && "llvm.dbg intrinsic should have
> void result");
> CI->eraseFromParent();
> - if (Arg1->use_empty()) {
> - if (Constant *C = dyn_cast<Constant>(Arg1))
> - DeadConstants.push_back(C);
> - else
> - RecursivelyDeleteTriviallyDeadInstructions(Arg1);
> - }
> - if (Arg2->use_empty())
> - if (Constant *C = dyn_cast<Constant>(Arg2))
> - DeadConstants.push_back(C);
> }
> Declare->eraseFromParent();
> }
>
> - // llvm.dbg.compile_units and llvm.dbg.subprograms are marked as
> linkonce
> - // but since we are removing all debug information, make them
> internal now.
> - // FIXME: Use private linkage maybe?
> - if (Constant *C = M.getNamedGlobal("llvm.dbg.compile_units"))
> - if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
> - GV->setLinkage(GlobalValue::InternalLinkage);
> -
> - if (Constant *C = M.getNamedGlobal("llvm.dbg.subprograms"))
> - if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
> - GV->setLinkage(GlobalValue::InternalLinkage);
> -
> - if (Constant *C = M.getNamedGlobal("llvm.dbg.global_variables"))
> - if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
> - GV->setLinkage(GlobalValue::InternalLinkage);
> -
> - // Delete all dbg variables.
> - for (Module::global_iterator I = M.global_begin(), E =
> M.global_end();
> - I != E; ++I) {
> - GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
> - if (!GV) continue;
> - if (GV->use_empty() && llvmUsedValues.count(I) == 0
> - && (!GV->hasSection()
> - || strcmp(GV->getSection().c_str(), "llvm.metadata") ==
> 0))
> - DeadConstants.push_back(GV);
> - }
> -
> - if (DeadConstants.empty())
> - return false;
> -
> - // Delete any internal globals that were only used by the
> debugger intrinsics.
> - while (!DeadConstants.empty()) {
> - Constant *C = DeadConstants.back();
> - DeadConstants.pop_back();
> - if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
> - if (GV->hasLocalLinkage())
> - RemoveDeadConstant(GV);
> - }
> - else
> - RemoveDeadConstant(C);
> - }
> + NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv");
> + if (NMD)
> + NMD->eraseFromParent();
>
> - // Remove all llvm.dbg types.
> - TypeSymbolTable &ST = M.getTypeSymbolTable();
> - for (TypeSymbolTable::iterator TI = ST.begin(), TE = ST.end();
> TI != TE; ) {
> - if (!strncmp(TI->first.c_str(), "llvm.dbg.", 9))
> - ST.remove(TI++);
> - else
> - ++TI;
> - }
> -
> + // Remove dead metadata.
> + M.getContext().RemoveDeadMetadata();
> return true;
> }
>
>
> Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Tue Aug 25
> 00:24:07 2009
> @@ -238,7 +238,7 @@
> // Do not clone llvm.dbg.region.end. It will be adjusted by the
> inliner.
> if (const DbgFuncStartInst *DFSI = dyn_cast<DbgFuncStartInst>
> (II)) {
> if (DbgFnStart == NULL) {
> - DISubprogram SP(cast<GlobalVariable>(DFSI->getSubprogram()));
> + DISubprogram SP(DFSI->getSubprogram());
> if (SP.describes(BB->getParent()))
> DbgFnStart = DFSI->getSubprogram();
> }
>
> Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Tue Aug 25
> 00:24:07 2009
> @@ -207,17 +207,17 @@
> /// to the llvm.dbg.func.start of the function F. Otherwise return
> NULL.
> static const DbgRegionEndInst *findFnRegionEndMarker(const Function
> *F) {
>
> - GlobalVariable *FnStart = NULL;
> + MDNode *FnStart = NULL;
> const DbgRegionEndInst *FnEnd = NULL;
> for (Function::const_iterator FI = F->begin(), FE =F->end(); FI !=
> FE; ++FI)
> for (BasicBlock::const_iterator BI = FI->begin(), BE = FI->end
> (); BI != BE;
> ++BI) {
> if (FnStart == NULL) {
> if (const DbgFuncStartInst *FSI = dyn_cast<DbgFuncStartInst>
> (BI)) {
> - DISubprogram SP(cast<GlobalVariable>(FSI->getSubprogram
> ()));
> + DISubprogram SP(FSI->getSubprogram());
> assert (SP.isNull() == false && "Invalid
> llvm.dbg.func.start");
> if (SP.describes(F))
> - FnStart = SP.getGV();
> + FnStart = SP.getNode();
> }
> } else {
> if (const DbgRegionEndInst *REI = dyn_cast<DbgRegionEndInst>
> (BI))
>
> Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original)
> +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Tue Aug 25 00:24:07 2009
> @@ -16,8 +16,7 @@
> #include "llvm/Function.h"
> #include "llvm/LLVMContext.h"
> #include "llvm/Module.h"
> -#include "llvm/Instructions.h"
> -#include "llvm/Intrinsics.h"
> +#include "llvm/IntrinsicInst.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/Support/ErrorHandling.h"
> #include <cstring>
> @@ -434,3 +433,74 @@
> }
> }
> }
> +
> +/// This function checks debug info intrinsics. If an intrinsic is
> invalid
> +/// then this function simply removes the intrinsic.
> +void llvm::CheckDebugInfoIntrinsics(Module *M) {
> +
> +
> + if (Function *FuncStart = M->getFunction("llvm.dbg.func.start")) {
> + if (!FuncStart->use_empty()) {
> + DbgFuncStartInst *DFSI = cast<DbgFuncStartInst>(FuncStart-
> >use_back());
> + if (!isa<MDNode>(DFSI->getOperand(1))) {
> + while (!FuncStart->use_empty()) {
> + CallInst *CI = cast<CallInst>(FuncStart->use_back());
> + CI->eraseFromParent();
> + }
> + FuncStart->eraseFromParent();
> + }
> + }
> + }
> +
> + if (Function *StopPoint = M->getFunction("llvm.dbg.stoppoint")) {
> + if (!StopPoint->use_empty()) {
> + DbgStopPointInst *DSPI = cast<DbgStopPointInst>(StopPoint-
> >use_back());
> + if (!isa<MDNode>(DSPI->getOperand(3))) {
> + while (!StopPoint->use_empty()) {
> + CallInst *CI = cast<CallInst>(StopPoint->use_back());
> + CI->eraseFromParent();
> + }
> + StopPoint->eraseFromParent();
> + }
> + }
> + }
> +
> + if (Function *RegionStart = M->getFunction
> ("llvm.dbg.region.start")) {
> + if (!RegionStart->use_empty()) {
> + DbgRegionStartInst *DRSI = cast<DbgRegionStartInst>
> (RegionStart->use_back());
> + if (!isa<MDNode>(DRSI->getOperand(1))) {
> + while (!RegionStart->use_empty()) {
> + CallInst *CI = cast<CallInst>(RegionStart->use_back());
> + CI->eraseFromParent();
> + }
> + RegionStart->eraseFromParent();
> + }
> + }
> + }
> +
> + if (Function *RegionEnd = M->getFunction("llvm.dbg.region.end")) {
> + if (!RegionEnd->use_empty()) {
> + DbgRegionEndInst *DREI = cast<DbgRegionEndInst>(RegionEnd-
> >use_back());
> + if (!isa<MDNode>(DREI->getOperand(1))) {
> + while (!RegionEnd->use_empty()) {
> + CallInst *CI = cast<CallInst>(RegionEnd->use_back());
> + CI->eraseFromParent();
> + }
> + RegionEnd->eraseFromParent();
> + }
> + }
> + }
> +
> + if (Function *Declare = M->getFunction("llvm.dbg.declare")) {
> + if (!Declare->use_empty()) {
> + DbgDeclareInst *DDI = cast<DbgDeclareInst>(Declare->use_back
> ());
> + if (!isa<MDNode>(DDI->getOperand(2))) {
> + while (!Declare->use_empty()) {
> + CallInst *CI = cast<CallInst>(Declare->use_back());
> + CI->eraseFromParent();
> + }
> + Declare->eraseFromParent();
> + }
> + }
> + }
> +}
>
> Modified: llvm/trunk/lib/VMCore/Metadata.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/VMCore/Metadata.cpp (original)
> +++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Aug 25 00:24:07 2009
> @@ -82,7 +82,7 @@
> V.reserve(NumVals);
> for (unsigned i = 0; i < NumVals; ++i)
> V.push_back(Vals[i]);
> -
> +
> return pImpl->MDNodes.getOrCreate(Type::getMetadataTy(Context), V);
> }
>
>
> Modified: llvm/trunk/lib/VMCore/ValueTypes.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueTypes.cpp?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/VMCore/ValueTypes.cpp (original)
> +++ llvm/trunk/lib/VMCore/ValueTypes.cpp Tue Aug 25 00:24:07 2009
> @@ -169,6 +169,7 @@
> case MVT::v8f32: return VectorType::get(Type::getFloatTy
> (Context), 8);
> case MVT::v2f64: return VectorType::get(Type::getDoubleTy
> (Context), 2);
> case MVT::v4f64: return VectorType::get(Type::getDoubleTy
> (Context), 4);
> + case MVT::Metadata: return Type::getMetadataTy(Context);
> }
> }
>
>
> Removed: llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll (original)
> +++ llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll (removed)
> @@ -1,56 +0,0 @@
> -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | grep alloca | count 1
> -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-
> f80:128:128"
> -target triple = "i386-apple-darwin9.5"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 393262, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 2, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }
> *), i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6
> x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2,
> i32 0, i32 0) }, section "llvm.metadata" ; <
> %llvm.dbg.compile_unit.type*> [#uses=1]
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [7 x i8] c"adce.c\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at .str1 = internal constant [6 x i8] c"/tmp/\00", section
> "llvm.metadata" ; <[6 x i8]*> [#uses=1]
> - at .str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc.
> build 5623) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x
> i8]*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 393252, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str4, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 393472, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at .str5 = internal constant [2 x i8] c"i\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> -
> -define i32 @foo() nounwind {
> -entry:
> - %retval = alloca i32 ; <i32*> [#uses=2]
> - %i = alloca i32 ; <i32*> [#uses=4]
> - %0 = alloca i32 ; <i32*> [#uses=2]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - %i1 = bitcast i32* %i to { }* ; <{ }*> [#uses=1]
> - call void @llvm.dbg.declare({ }* %i1, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))
> - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - store i32 4, i32* %i, align 4
> - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %1 = load i32* %i, align 4 ; <i32> [#uses=1]
> - %2 = mul i32 %1, 84 ; <i32> [#uses=1]
> - store i32 %2, i32* %i, align 4
> - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - store i32 42, i32* %0, align 4
> - %3 = load i32* %0, align 4 ; <i32> [#uses=1]
> - store i32 %3, i32* %retval, align 4
> - br label %return
> -
> -return: ; preds = %entry
> - %retval2 = load i32* %retval ; <i32> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - ret i32 %retval2
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll (original)
> +++ llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll (removed)
> @@ -1,44 +0,0 @@
> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep stoppoint
> | count 3
> -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-
> f80:128:128"
> -target triple = "i386-apple-darwin9.5"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 393262, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 2, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }
> *), i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6
> x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2,
> i32 0, i32 0) }, section "llvm.metadata" ; <
> %llvm.dbg.compile_unit.type*> [#uses=1]
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [7 x i8] c"adce.c\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at .str1 = internal constant [6 x i8] c"/tmp/\00", section
> "llvm.metadata" ; <[6 x i8]*> [#uses=1]
> - at .str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc.
> build 5623) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x
> i8]*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 393252, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str4, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 393472, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0]
> - at .str5 = internal constant [2 x i8] c"i\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> -
> -define i32 @foo() nounwind {
> -entry:
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %0 = mul i32 4, 84 ; <i32> [#uses=0]
> - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - br label %return
> -
> -return: ; preds = %entry
> - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - ret i32 42
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll (original)
> +++ llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll (removed)
> @@ -1,23 +0,0 @@
> -; RUN: llvm-as < %s | llc | grep 0x49 | count 3
> -; Count number of DW_AT_Type attributes.
> -target triple = "i386-apple-darwin*"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8*, i1, i1, i8* }
> - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, { }*, { }* }
> - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*,
> i8*, { }*, i32, { }*, i1, i1, { }* }
> - %llvm.dbg.subrange.type = type { i32, i64, i64 }
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [8 x i8] c"array.c\00", section
> "llvm.metadata" ; <[8 x i8]*> [#uses=1]
> - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test
> \00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at c = common global [3 x i32] zeroinitializer ; <[3 x i32]*>
> [#uses=1]
> - at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type
> { i32 458785, i64 0, i64 2 }, section "llvm.metadata" ; <
> %llvm.dbg.subrange.type*> [#uses=1]
> - at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast
> (%llvm.dbg.subrange.type* @llvm.dbg.subrange to { }*) ], section
> "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type
> { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 96, i64 32, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }*
> bitcast ([1 x { }*]* @llvm.dbg.array to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.global_variables = linkonce constant
> %llvm.dbg.anchor.type { i32 458752, i32 52 }, section
> "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
> - at .str4 = internal constant [2 x i8] c"c\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.global_variable = internal constant
> %llvm.dbg.global_variable.type { i32 458804, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }
> *), i8* getelementptr ([2 x i8]* @.str4, i32 0, i32 0), i8*
> getelementptr ([2 x i8]* @.str4, i32 0, i32 0), i8* null, { }*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }
> *), i32 2, { }* bitcast (%llvm.dbg.composite.type*
> @llvm.dbg.composite to { }*), i1 false, i1 true, { }* bitcast ([3 x
> i32]* @c to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.global_variable.type*> [#uses=0]
>
> Removed: llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (original)
> +++ llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (removed)
> @@ -1,46 +0,0 @@
> -; RUN: llvm-as < %s | llc | grep "\\"m.h\\"" | count 1
> -target triple = "i386-apple-darwin9.6"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8*, i1, i1, i8* }
> - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, { }*, { }* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [4 x i8] c"m.c\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test
> \00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section
> "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
> - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]*
> @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"m.h\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.compile_unit5 = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr
> ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 false, i1 false, i8* null }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str6 = internal constant [5 x i8] c"main\00", section
> "llvm.metadata" ; <[5 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([5 x i8]* @.str6, i32 0, i32 0), i8* getelementptr
> ([5 x i8]* @.str6, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*), i32
> 2, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }
> *), i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> -
> -define i32 @main() nounwind {
> -entry:
> - %retval = alloca i32 ; <i32*> [#uses=2]
> - %0 = alloca i32 ; <i32*> [#uses=2]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*))
> - store i32 0, i32* %0, align 4
> - %1 = load i32* %0, align 4 ; <i32> [#uses=1]
> - store i32 %1, i32* %retval, align 4
> - br label %return
> -
> -return: ; preds = %entry
> - %retval1 = load i32* %retval ; <i32> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - ret i32 %retval1
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll
> (original)
> +++ llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll
> (removed)
> @@ -1,32 +0,0 @@
> -; RUN: llvm-as < %s | llc | grep 0x3C | count 1
> -; Check DW_AT_declaration attribute for class method foo.
> -target triple = "i386-apple-darwin*"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32, i8*, i8* }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8*, i1, i8* }
> - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, { }*, { }*, i8*, i8* }
> - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, { }*, i8*, i8* }
> - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*,
> i8*, { }*, i32, { }*, i1, i1, { }*, i8*, i8* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1, i8*, i8* }
> - %struct.A = type <{ i8 }>
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [6 x i8] c"cl.cc\00", section
> "llvm.metadata" ; <[6 x i8]*> [#uses=1]
> - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test
> \00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8*
> getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 false, i8* null }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at a = global %struct.A zeroinitializer ; <%struct.A*> [#uses=1]
> - at .str3 = internal constant [2 x i8] c"A\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <
> %llvm.dbg.basictype.type*> [#uses=1]
> - at llvm.dbg.derivedtype = internal constant
> %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite9 to
> { }*), i8* null, i8* null }, section "llvm.metadata" ; <
> %llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.array = internal constant [2 x { }*] [ { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }
> *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
> - at llvm.dbg.composite5 = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]*
> @llvm.dbg.array to { }*), i8* null, i8* null }, section
> "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str6 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at .str7 = internal constant [12 x i8] c"_ZN1A3fooEv\00", section
> "llvm.metadata" ; <[12 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str6, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str6, i32 0, i32 0), i8* getelementptr ([12 x i8]*
> @.str7, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 4, { }* bitcast
> (%llvm.dbg.composite.type* @llvm.dbg.composite5 to { }*), i1 false,
> i1 false, i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8*
> getelementptr ([26 x i8]* @.str1, i32 0, i32 0) }, section
> "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.array8 = internal constant [1 x { }*] [ { }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) ], section
> "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
> - at llvm.dbg.composite9 = internal constant %llvm.dbg.composite.type
> { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]*
> @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 2, i64 8, i64 8, i64 0, i32 0,
> { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array8 to { }*), i8*
> getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([26 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.global_variables = linkonce constant
> %llvm.dbg.anchor.type { i32 458752, i32 52 }, section
> "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
> - at .str10 = internal constant [2 x i8] c"a\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.global_variable = internal constant
> %llvm.dbg.global_variable.type { i32 458804, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }
> *), i8* getelementptr ([2 x i8]* @.str10, i32 0, i32 0), i8*
> getelementptr ([2 x i8]* @.str10, i32 0, i32 0), i8* null, { }*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }
> *), i32 7, { }* bitcast (%llvm.dbg.composite.type*
> @llvm.dbg.composite9 to { }*), i1 false, i1 true, { }* bitcast
> (%struct.A* @a to { }*), i8* getelementptr ([6 x i8]* @.str, i32 0,
> i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0) },
> section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
>
> Removed: llvm/trunk/test/DebugInfo/2009-01-30-Method.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-30-Method.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2009-01-30-Method.ll (original)
> +++ llvm/trunk/test/DebugInfo/2009-01-30-Method.ll (removed)
> @@ -1,103 +0,0 @@
> -; RUN: llvm-as < %s | llc -O0 | grep "\\"foo" | count 3
> -; 1 declaration, 1 definition and 1 pubnames entry.
> -target triple = "i386-apple-darwin*"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8*, i1, i1, i8* }
> - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, { }*, { }* }
> - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, { }* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - %struct.Fibonancci = type { i32 }
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [10 x i8] c"method.cc\00", section
> "llvm.metadata" ; <[10 x i8]*> [#uses=1]
> - at .str1 = internal constant [64 x i8] c"/Volumes/Nanpura/mainline/
> llvmgcc42.build/gcc/../../../dbg.test\00", section
> "llvm.metadata" ; <[64 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8*
> getelementptr ([10 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([64 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at .str3 = internal constant [11 x i8] c"Fibonancci\00", section
> "llvm.metadata" ; <[11 x i8]*> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at .str5 = internal constant [2 x i8] c"N\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.derivedtype = internal constant
> %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 5, i64 32, i64 32, i64 0, i32 1, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.derivedtype6 = internal constant
> %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to
> { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*>
> [#uses=1]
> - at llvm.dbg.array = internal constant [3 x { }*] [ { }* null, { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype6 to { }
> *), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to
> { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1]
> - at llvm.dbg.composite7 = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]*
> @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str8 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at .str9 = internal constant [22 x i8] c"_ZN10Fibonancci3fooEi\00",
> section "llvm.metadata" ; <[22 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([22 x i8]*
> @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast
> (%llvm.dbg.composite.type* @llvm.dbg.composite7 to { }*), i1 false,
> i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*>
> [#uses=1]
> - at llvm.dbg.array10 = internal constant [2 x { }*] [ { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), { }*
> bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) ],
> section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
> - at llvm.dbg.composite11 = internal constant %llvm.dbg.composite.type
> { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]*
> @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 3, i64 32, i64 32, i64 0, i32
> 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array10 to { }
> *) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.derivedtype12 = internal constant
> %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to
> { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*>
> [#uses=1]
> - at llvm.dbg.array13 = internal constant [3 x { }*] [ { }* null, { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { }
> *), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to
> { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1]
> - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]*
> @llvm.dbg.array13 to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.subprogram14 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([22 x i8]*
> @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast
> (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false,
> i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*>
> [#uses=1]
> - at llvm.dbg.derivedtype15 = internal constant
> %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12
> to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*>
> [#uses=1]
> - at .str16 = internal constant [5 x i8] c"this\00", section
> "llvm.metadata" ; <[5 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram14 to { }*), i8* getelementptr ([5 x i8]*
> @.str16, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype15 to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at .str17 = internal constant [2 x i8] c"i\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.variable18 = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram14 to { }*), i8* getelementptr ([2 x i8]*
> @.str17, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at llvm.dbg.array19 = internal constant [1 x { }*] [ { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section
> "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
> - at llvm.dbg.composite20 = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]*
> @llvm.dbg.array19 to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at .str21 = internal constant [5 x i8] c"main\00", section
> "llvm.metadata" ; <[5 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram22 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([5 x i8]* @.str21, i32 0, i32 0), i8* getelementptr
> ([5 x i8]* @.str21, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 14, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite20 to
> { }*), i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at .str23 = internal constant [4 x i8] c"fib\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.variable24 = internal constant %llvm.dbg.variable.type
> { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram22 to { }*), i8* getelementptr ([4 x i8]*
> @.str23, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 15, { }* bitcast
> (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> -
> -define void @_ZN10Fibonancci3fooEi(%struct.Fibonancci* %this, i32
> %i) nounwind {
> -entry:
> - %this_addr = alloca %struct.Fibonancci* ; <%struct.Fibonancci**>
> [#uses=3]
> - %i_addr = alloca i32 ; <i32*> [#uses=3]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*))
> - %0 = bitcast %struct.Fibonancci** %this_addr to { }* ; <{ }*>
> [#uses=1]
> - call void @llvm.dbg.declare({ }* %0, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))
> - store %struct.Fibonancci* %this, %struct.Fibonancci** %this_addr
> - %1 = bitcast i32* %i_addr to { }* ; <{ }*> [#uses=1]
> - call void @llvm.dbg.declare({ }* %1, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable18 to { }*))
> - store i32 %i, i32* %i_addr
> - call void @llvm.dbg.stoppoint(i32 11, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %2 = load %struct.Fibonancci** %this_addr, align 4 ; <
> %struct.Fibonancci*> [#uses=1]
> - %3 = getelementptr %struct.Fibonancci* %2, i32 0, i32 0 ; <i32*>
> [#uses=1]
> - %4 = load i32* %i_addr, align 4 ; <i32> [#uses=1]
> - store i32 %4, i32* %3, align 4
> - call void @llvm.dbg.stoppoint(i32 12, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - br label %return
> -
> -return: ; preds = %entry
> - call void @llvm.dbg.stoppoint(i32 12, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*))
> - ret void
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
> -
> -define i32 @main() nounwind {
> -entry:
> - %retval = alloca i32 ; <i32*> [#uses=2]
> - %fib = alloca %struct.Fibonancci ; <%struct.Fibonancci*> [#uses=2]
> - %0 = alloca i32 ; <i32*> [#uses=2]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*))
> - %1 = bitcast %struct.Fibonancci* %fib to { }* ; <{ }*> [#uses=1]
> - call void @llvm.dbg.declare({ }* %1, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*))
> - call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @_ZN10Fibonancci3fooEi(%struct.Fibonancci* %fib, i32 42)
> nounwind
> - call void @llvm.dbg.stoppoint(i32 17, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - store i32 0, i32* %0, align 4
> - %2 = load i32* %0, align 4 ; <i32> [#uses=1]
> - store i32 %2, i32* %retval, align 4
> - br label %return
> -
> -return: ; preds = %entry
> - %retval1 = load i32* %retval ; <i32> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 17, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*))
> - ret i32 %retval1
> -}
>
> Removed: llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll (original)
> +++ llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll (removed)
> @@ -1,41 +0,0 @@
> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep stoppoint
> | count 3
> -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-
> f80:32:32"
> -target triple = "i386-pc-linux-gnu"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8*, i1, i1, i8*, i32 }
> - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, { }*, { }*, i32 }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [8 x i8] c"brach.c\00", section
> "llvm.metadata" ; <[8 x i8]*> [#uses=1]
> - at .str1 = internal constant [38 x i8] c"/developer/home2/zsth/test/
> debug/tmp/\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([38 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 -1 },
> section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at llvm.dbg.array = internal constant [2 x { }*] [{ }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }*
> bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*)],
> section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
> - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]*
> @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }
> *), i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at .str5 = internal constant [2 x i8] c"x\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0]
> -
> -define i32 @foo(i32 %x) nounwind {
> -entry:
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %0 = icmp sgt i32 %x, 5 ; <i1> [#uses=1]
> - %.0 = select i1 %0, i32 %x, i32 0 ; <i32> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - ret i32 %.0
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/2009-03-02-sink.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-02-sink.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/2009-03-02-sink.ll (original)
> +++ llvm/trunk/test/DebugInfo/2009-03-02-sink.ll (removed)
> @@ -1,57 +0,0 @@
> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext sdiv
> 1 | grep {stoppoint(i32 2}
> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext add
> 1 | grep {stoppoint(i32 3}
> -; ModuleID = 'sink.c'
> -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-
> f80:128:128"
> -target triple = "i386-apple-darwin9.6"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8*, i1, i1, i8*, i32 }
> - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, { }*, { }*, i32 }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [7 x i8] c"sink.c\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00",
> section "llvm.metadata" ; <[23 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([23 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at llvm.dbg.array = internal constant [4 x { }*] [{ }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }*
> bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }
> * bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
> { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }
> *)], section "llvm.metadata" ; <[4 x { }*]*> [#uses=1]
> - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type
> { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([4 x { }*]*
> @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }
> *), i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at .str5 = internal constant [2 x i8] c"c\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at .str6 = internal constant [2 x i8] c"a\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.variable7 = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str6,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at .str8 = internal constant [2 x i8] c"b\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.variable9 = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str8,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> -
> -define i32 @foo(i32 %c, i32 %a, i32 %b) nounwind {
> -entry:
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %tmp.2 = sdiv i32 %a, %b ; <i32> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %tmp.9 = add i32 %b, %a ; <i32> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %tmp.10 = icmp ne i32 %c, 0 ; <i1> [#uses=1]
> - br i1 %tmp.10, label %bb, label %bb1
> -
> -bb: ; preds = %entry
> - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - ret i32 %tmp.9
> -
> -bb1: ; preds = %entry
> - call void @llvm.dbg.stoppoint(i32 7, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - ret i32 %tmp.2
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/dataOnly.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dataOnly.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/dataOnly.ll (original)
> +++ llvm/trunk/test/DebugInfo/dataOnly.ll (removed)
> @@ -1,47 +0,0 @@
> -; RUN: llvm-as < %s | llc | grep DWARF
> -; ModuleID = 'foo.c'
> -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-
> f80:128:128"
> -target triple = "i386-apple-darwin8"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*,
> i8* }
> - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*,
> i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
> - at x = common global i32 0 ; <i32*> [#uses=1]
> - at llvm.dbg.global_variable = internal constant
> %llvm.dbg.global_variable.type {
> - i32 393268,
> - { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.global_variables to { }*),
> - { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*),
> - i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0),
> - i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0),
> - i8* null,
> - { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*),
> - i32 1,
> - { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to
> { }*),
> - i1 false,
> - i1 true,
> - { }* bitcast (i32* @x to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.global_variable.type*> [#uses=0]
> - at llvm.dbg.global_variables = linkonce constant
> %llvm.dbg.anchor.type { i32 393216, i32 52 }, section
> "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type {
> - i32 393233,
> - { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units
> to { }*),
> - i32 1,
> - i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0),
> - i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0),
> - i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [6 x i8] c"foo.c\00", section
> "llvm.metadata" ; <[6 x i8]*> [#uses=1]
> - at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00",
> section "llvm.metadata" ; <[23 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5555) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at .str3 = internal constant [2 x i8] c"x\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
> - i32 393252,
> - { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*),
> - i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0),
> - { }* null,
> - i32 0,
> - i64 32,
> - i64 32,
> - i64 0,
> - i32 0,
> - i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at .str4 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
>
> Removed: llvm/trunk/test/DebugInfo/forwardDecl.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/forwardDecl.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/forwardDecl.ll (original)
> +++ llvm/trunk/test/DebugInfo/forwardDecl.ll (removed)
> @@ -1,49 +0,0 @@
> -; RUN: llvm-as < %s | llc -O0 | %prcontext ST 1 | grep 0x1 | count 1
> -
> -target triple = "i386-apple-darwin9.6"
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
> - %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, { }*, { }* }
> - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, { }* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - %struct.ST = type opaque
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 393262, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr
> ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 3, { }* null, i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8*
> getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([36 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <
> %llvm.dbg.compile_unit.type*> [#uses=1]
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 393216, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [4 x i8] c"t.c\00", section
> "llvm.metadata" ; <[20 x i8]*> [#uses=1]
> - at .str1 = internal constant [36 x i8] c"/Users/echeng/LLVM/radars/
> r6395152/\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5628) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 393473, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str4,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at .str4 = internal constant [2 x i8] c"x\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.derivedtype = internal constant
> %llvm.dbg.derivedtype.type { i32 393231, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32
> 0, { }* bitcast (%llvm.dbg.compositetype.type*
> @llvm.dbg.compositetype to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.compositetype = internal constant
> %llvm.dbg.compositetype.type { i32 393235, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([3 x i8]* @.str5, i32 0, i32 0), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 1, i64 0, i64 8, i64 0, i32 4, { }* null, { }* bitcast ([0 x { }*]*
> @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.compositetype.type*> [#uses=1]
> - at .str5 = internal constant [3 x i8] c"ST\00", section
> "llvm.metadata" ; <[3 x i8]*> [#uses=1]
> - at llvm.dbg.array = internal constant [0 x { }*] zeroinitializer,
> section "llvm.metadata" ; <[0 x { }*]*> [#uses=1]
> -
> -define void @foo(%struct.ST* %x1) nounwind {
> -entry:
> - %x_addr = alloca %struct.ST* ; <%struct.ST**> [#uses=2]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - %x = bitcast %struct.ST** %x_addr to { }* ; <{ }*> [#uses=1]
> - call void @llvm.dbg.declare({ }* %x, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))
> - store %struct.ST* %x1, %struct.ST** %x_addr
> - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - br label %return
> -
> -return: ; preds = %entry
> - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - ret void
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/printdbginfo.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/printdbginfo.ll (original)
> +++ llvm/trunk/test/DebugInfo/printdbginfo.ll (removed)
> @@ -1,136 +0,0 @@
> -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output > %t1
> -; RUN: %prcontext {function name: Bar::bar return type: int at line
> 12} 1 < %t1 | grep {(tst.cpp:14)}
> -; RUN: %prcontext {%%tmp1} 1 < %t1 | grep -E {variable tmp.+at
> tst.cpp:23}
> -; RUN: %prcontext {; tst.cpp:24} 2 < %t1 | grep {%%6}
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
> - %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, { }*, { }* }
> - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32,
> i64, i64, i64, i32, { }* }
> - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*,
> { }*, i32, { }*, i1, i1 }
> - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
> - %struct.Bar = type { %struct.Foo, i32 }
> - %struct.Foo = type { i32 }
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, { }* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr
> ([9 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([14 x i8]*
> @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false,
> i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*>
> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 45872, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8*
> getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([13 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <
> %llvm.dbg.compile_unit.type*> [#uses=1]
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 45872, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [8 x i8] c"tst.cpp\00", section
> "llvm.metadata" ; <[8 x i8]*> [#uses=1]
> - at .str1 = internal constant [13 x i8] c"/home/edwin/\00", section
> "llvm.metadata" ; <[13 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5623) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"bar\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at .str4 = internal constant [9 x i8] c"Bar::bar\00", section
> "llvm.metadata" ; <[9 x i8]*> [#uses=1]
> - at .str5 = internal constant [14 x i8] c"_ZN3Bar3barEv\00", section
> "llvm.metadata" ; <[14 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]*
> @.str6, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32
> 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at .str6 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([5 x i8]* @.str7,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0]
> - at .str7 = internal constant [5 x i8] c"this\00", section
> "llvm.metadata" ; <[5 x i8]*> [#uses=1]
> - at llvm.dbg.derivedtype = internal constant
> %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.compositetype = internal constant
> %llvm.dbg.compositetype.type { i32 458771, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str8, i32 0, i32 0), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 5, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([5 x { }*]
> * @llvm.dbg.array36 to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.compositetype.type*> [#uses=1]
> - at .str8 = internal constant [4 x i8] c"Bar\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.derivedtype9 = internal constant
> %llvm.dbg.derivedtype.type { i32 458780, { }* null, i8* null, { }*
> null, i32 0, i64 0, i64 0, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.compositetype10 = internal constant
> %llvm.dbg.compositetype.type { i32 458771, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str11, i32 0, i32 0), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 1, i64 32, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]
> * @llvm.dbg.array22 to { }*) }, section "llvm.metadata" ; <
> %llvm.dbg.compositetype.type*> [#uses=1]
> - at .str11 = internal constant [4 x i8] c"Foo\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.derivedtype12 = internal constant
> %llvm.dbg.derivedtype.type { i32 458765, { }* null, i8*
> getelementptr ([7 x i8]* @.str13, i32 0, i32 0), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 2, i64 32, i64 32, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at .str13 = internal constant [7 x i8] c"FooVar\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram14 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str11, i32 0, i32 0), i8* getelementptr
> ([9 x i8]* @.str15, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 12, { }* bitcast (%llvm.dbg.compositetype.type*
> @llvm.dbg.compositetype16 to { }*), i1 false, i1 false }, section
> "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
> - at .str15 = internal constant [9 x i8] c"Foo::Foo\00", section
> "llvm.metadata" ; <[9 x i8]*> [#uses=1]
> - at llvm.dbg.compositetype16 = internal constant
> %llvm.dbg.compositetype.type { i32 458773, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }*
> bitcast ([3 x { }*]* @llvm.dbg.array to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
> - at llvm.dbg.derivedtype17 = internal constant
> %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.derivedtype18 = internal constant
> %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.array = internal constant [3 x { }*] [ { }* null, { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype17 to { }
> *), { }* bitcast (%llvm.dbg.derivedtype.type*
> @llvm.dbg.derivedtype18 to { }*) ], section "llvm.metadata" ; <[3 x
> { }*]*> [#uses=1]
> - at llvm.dbg.subprogram19 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str11, i32 0, i32 0), i8* getelementptr
> ([9 x i8]* @.str15, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 12, { }* bitcast (%llvm.dbg.compositetype.type*
> @llvm.dbg.compositetype20 to { }*), i1 false, i1 false }, section
> "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.compositetype20 = internal constant
> %llvm.dbg.compositetype.type { i32 458773, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }*
> bitcast ([2 x { }*]* @llvm.dbg.array21 to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
> - at llvm.dbg.array21 = internal constant [2 x { }*] [ { }* null, { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype17 to { }
> *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
> - at llvm.dbg.array22 = internal constant [3 x { }*] [ { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { }*), { }*
> bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*),
> { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram19 to
> { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1]
> - at llvm.dbg.derivedtype23 = internal constant
> %llvm.dbg.derivedtype.type { i32 458765, { }* null, i8*
> getelementptr ([7 x i8]* @.str24, i32 0, i32 0), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 6, i64 32, i64 32, i64 32, i32 1, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at .str24 = internal constant [7 x i8] c"BarVar\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram25 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr
> ([9 x i8]* @.str26, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 12, { }* bitcast (%llvm.dbg.compositetype.type*
> @llvm.dbg.compositetype27 to { }*), i1 false, i1 false }, section
> "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
> - at .str26 = internal constant [9 x i8] c"Bar::Bar\00", section
> "llvm.metadata" ; <[9 x i8]*> [#uses=1]
> - at llvm.dbg.compositetype27 = internal constant
> %llvm.dbg.compositetype.type { i32 458773, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }*
> bitcast ([3 x { }*]* @llvm.dbg.array29 to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
> - at llvm.dbg.derivedtype28 = internal constant
> %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast
> (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.array29 = internal constant [3 x { }*] [ { }* null, { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*),
> { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype28 to
> { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1]
> - at llvm.dbg.subprogram30 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr
> ([9 x i8]* @.str26, i32 0, i32 0), i8* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 12, { }* bitcast (%llvm.dbg.compositetype.type*
> @llvm.dbg.compositetype31 to { }*), i1 false, i1 false }, section
> "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.compositetype31 = internal constant
> %llvm.dbg.compositetype.type { i32 458773, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }*
> bitcast ([2 x { }*]* @llvm.dbg.array32 to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
> - at llvm.dbg.array32 = internal constant [2 x { }*] [ { }* null, { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }
> *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
> - at llvm.dbg.subprogram33 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr
> ([9 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([14 x i8]*
> @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast
> (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype34 to { }*),
> i1 false, i1 false }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at llvm.dbg.compositetype34 = internal constant
> %llvm.dbg.compositetype.type { i32 458773, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }*
> bitcast ([2 x { }*]* @llvm.dbg.array35 to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
> - at llvm.dbg.array35 = internal constant [2 x { }*] [ { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }
> *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
> - at llvm.dbg.array36 = internal constant [5 x { }*] [ { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype9 to { }*), { }*
> bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype23 to { }
> *), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram25
> to { }*), { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram30 to { }*), { }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram33 to { }*) ],
> section "llvm.metadata" ; <[5 x { }*]*> [#uses=1]
> - at llvm.dbg.variable37 = internal constant %llvm.dbg.variable.type
> { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to { }*), i8* getelementptr ([4 x i8]* @.str38,
> i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 15, { }* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0]
> - at .str38 = internal constant [4 x i8] c"tmp\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram39 = internal constant
> %llvm.dbg.subprogram.type { i32 458798, { }* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8*
> getelementptr ([7 x i8]* @.str40, i32 0, i32 0), i8* getelementptr
> ([7 x i8]* @.str40, i32 0, i32 0), i8* getelementptr ([11 x i8]*
> @.str41, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 21, { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), i1
> false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at .str40 = internal constant [7 x i8] c"foobar\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at .str41 = internal constant [11 x i8] c"_Z6foobarv\00", section
> "llvm.metadata" ; <[11 x i8]*> [#uses=1]
> - at llvm.dbg.variable42 = internal constant %llvm.dbg.variable.type
> { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram39 to { }*), i8* getelementptr ([4 x i8]*
> @.str38, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to { }*), i32 23, { }* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0]
> -
> -define i32 @_ZN3Bar3barEv(%struct.Bar* %this1) nounwind {
> -entry:
> - tail call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - tail call void @llvm.dbg.stoppoint(i32 14, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %0 = getelementptr %struct.Bar* %this1, i64 0, i32 0, i32 0 ;
> <i32*> [#uses=1]
> - %1 = load i32* %0, align 4 ; <i32> [#uses=1]
> - %2 = icmp sgt i32 %1, 0 ; <i1> [#uses=1]
> - br i1 %2, label %bb, label %bb3
> -
> -bb: ; preds = %entry
> - %3 = getelementptr %struct.Bar* %this1, i64 0, i32 1 ; <i32*>
> [#uses=1]
> - %4 = load i32* %3, align 4 ; <i32> [#uses=1]
> - %5 = shl i32 %4, 1 ; <i32> [#uses=1]
> - tail call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - br label %bb4
> -
> -bb3: ; preds = %entry
> - tail call void @llvm.dbg.stoppoint(i32 18, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - br label %bb4
> -
> -bb4: ; preds = %bb3, %bb
> - %.0 = phi i32 [ 0, %bb3 ], [ %5, %bb ] ; <i32> [#uses=1]
> - tail call void @llvm.dbg.stoppoint(i32 18, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - tail call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
> - ret i32 %.0
> -}
> -
> -declare void @llvm.dbg.func.start({ }*) nounwind
> -
> -declare void @llvm.dbg.declare({ }*, { }*) nounwind
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
> -
> -declare void @llvm.dbg.region.end({ }*) nounwind
> -
> -define %struct.Bar* @_Z6foobarv() {
> -entry:
> - %retval = alloca %struct.Bar* ; <%struct.Bar**> [#uses=2]
> - %tmp = alloca %struct.Bar* ; <%struct.Bar**> [#uses=3]
> - %0 = alloca %struct.Bar* ; <%struct.Bar**> [#uses=2]
> - %1 = alloca %struct.Bar* ; <%struct.Bar**> [#uses=3]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*))
> - %tmp1 = bitcast %struct.Bar** %tmp to { }* ; <{ }*> [#uses=1]
> - call void @llvm.dbg.declare({ }* %tmp1, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable42 to { }*))
> - call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %2 = call i8* @_Znwm(i64 8) ; <i8*> [#uses=1]
> - %3 = bitcast i8* %2 to %struct.Bar* ; <%struct.Bar*> [#uses=1]
> - store %struct.Bar* %3, %struct.Bar** %1, align 8
> - %4 = load %struct.Bar** %1, align 8 ; <%struct.Bar*> [#uses=1]
> - call void @_ZN3BarC1Ev(%struct.Bar* %4) nounwind
> - %5 = load %struct.Bar** %1, align 8 ; <%struct.Bar*> [#uses=1]
> - store %struct.Bar* %5, %struct.Bar** %tmp, align 8
> - call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - %6 = load %struct.Bar** %tmp, align 8 ; <%struct.Bar*> [#uses=1]
> - store %struct.Bar* %6, %struct.Bar** %0, align 8
> - %7 = load %struct.Bar** %0, align 8 ; <%struct.Bar*> [#uses=1]
> - store %struct.Bar* %7, %struct.Bar** %retval, align 8
> - br label %return
> -
> -return: ; preds = %entry
> - %retval2 = load %struct.Bar** %retval ; <%struct.Bar*> [#uses=1]
> - call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> - call void @llvm.dbg.region.end({ }* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*))
> - ret %struct.Bar* %retval2
> -}
> -
> -declare i8* @_Znwm(i64)
> -
> -declare void @_ZN3BarC1Ev(%struct.Bar*) nounwind
>
> Removed: llvm/trunk/test/DebugInfo/printdbginfo2.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo2.ll?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/DebugInfo/printdbginfo2.ll (original)
> +++ llvm/trunk/test/DebugInfo/printdbginfo2.ll (removed)
> @@ -1,74 +0,0 @@
> -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output > %t1
> -; RUN: grep {%b is variable b of type x declared at x.c:7} %t1
> -; RUN: grep {%2 is variable b of type x declared at x.c:7} %t1
> -; RUN: grep {@c.1442 is variable c of type int declared at x.c:4} %t1
> - type { } ; type %0
> - %llvm.dbg.anchor.type = type { i32, i32 }
> - %llvm.dbg.basictype.type = type { i32, %0*, i8*, %0*, i32, i64,
> i64, i64, i32, i32 }
> - %llvm.dbg.compile_unit.type = type { i32, %0*, i32, i8*, i8*, i8*,
> i1, i1, i8*, i32 }
> - %llvm.dbg.composite.type = type { i32, %0*, i8*, %0*, i32, i64,
> i64, i64, i32, %0*, %0*, i32 }
> - %llvm.dbg.derivedtype.type = type { i32, %0*, i8*, %0*, i32, i64,
> i64, i64, i32, %0* }
> - %llvm.dbg.global_variable.type = type { i32, %0*, %0*, i8*, i8*,
> i8*, %0*, i32, %0*, i1, i1, %0* }
> - %llvm.dbg.subprogram.type = type { i32, %0*, %0*, i8*, i8*, i8*,
> %0*, i32, %0*, i1, i1 }
> - %llvm.dbg.subrange.type = type { i32, i64, i64 }
> - %llvm.dbg.variable.type = type { i32, %0*, i8*, %0*, i32, %0* }
> - %struct..0x = type { i32 }
> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 17 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str = internal constant [4 x i8] c"x.c\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at .str1 = internal constant [27 x i8] c"/home/edwin/llvm-svn/llvm/
> \00", section "llvm.metadata" ; <[27 x i8]*> [#uses=1]
> - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc.
> build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]
> *> [#uses=1]
> - at llvm.dbg.compile_unit = internal constant
> %llvm.dbg.compile_unit.type { i32 458769, %0* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %0*), i32 1, i8*
> getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr
> ([27 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]*
> @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section
> "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
> - at .str3 = internal constant [4 x i8] c"int\00", section
> "llvm.metadata" ; <[4 x i8]*> [#uses=1]
> - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type
> { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i8* getelementptr ([4 x i8]* @.str3,
> i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0,
> i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*>
> [#uses=1]
> - at llvm.dbg.array = internal constant [1 x %0*] [%0* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*)], section
> "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
> - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type
> { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0,
> i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]*
> @llvm.dbg.array to %0*), i32 0 }, section "llvm.metadata" ; <
> %llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type
> { i32 458752, i32 46 }, section "llvm.metadata" ; <
> %llvm.dbg.anchor.type*> [#uses=1]
> - at .str4 = internal constant [5 x i8] c"main\00", section
> "llvm.metadata" ; <[5 x i8]*> [#uses=1]
> - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type
> { i32 458798, %0* bitcast (%llvm.dbg.anchor.type*
> @llvm.dbg.subprograms to %0*), %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8*
> getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* getelementptr
> ([5 x i8]* @.str4, i32 0, i32 0), i8* null, %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 2,
> %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to %0*),
> i1 false, i1 true }, section "llvm.metadata" ; <
> %llvm.dbg.subprogram.type*> [#uses=1]
> - at .str5 = internal constant [2 x i8] c"x\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at .str7 = internal constant [2 x i8] c"a\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.derivedtype = internal constant
> %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*), i8*
> getelementptr ([2 x i8]* @.str7, i32 0, i32 0), %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 6,
> i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.basictype.type*
> @llvm.dbg.basictype to %0*) }, section "llvm.metadata" ; <
> %llvm.dbg.derivedtype.type*> [#uses=1]
> - at llvm.dbg.array8 = internal constant [1 x %0*] [%0* bitcast
> (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %0*)], section
> "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
> - at llvm.dbg.composite9 = internal constant %llvm.dbg.composite.type
> { i32 458771, %0* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str5,
> i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i32 5, i64 32, i64 32, i64 0, i32 0,
> %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array8 to %0*), i32 0 },
> section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
> - at .str10 = internal constant [2 x i8] c"b\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type
> { i32 459008, %0* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str10,
> i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i32 7, %0* bitcast
> (%llvm.dbg.composite.type* @llvm.dbg.composite9 to %0*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type
> { i32 458785, i64 0, i64 3 }, section "llvm.metadata" ; <
> %llvm.dbg.subrange.type*> [#uses=1]
> - at llvm.dbg.array11 = internal constant [1 x %0*] [%0* bitcast
> (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %0*)], section
> "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
> - at llvm.dbg.composite12 = internal constant %llvm.dbg.composite.type
> { i32 458753, %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0,
> i64 128, i64 32, i64 0, i32 0, %0* bitcast
> (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*), %0* bitcast
> ([1 x %0*]* @llvm.dbg.array11 to %0*), i32 0 }, section
> "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
> - at llvm.dbg.variable13 = internal constant %llvm.dbg.variable.type
> { i32 459008, %0* bitcast (%llvm.dbg.subprogram.type*
> @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str7,
> i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type*
> @llvm.dbg.compile_unit to %0*), i32 3, %0* bitcast
> (%llvm.dbg.composite.type* @llvm.dbg.composite12 to %0*) }, section
> "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
> - at c.1442 = internal global i32 5 ; <i32*> [#uses=2]
> - at llvm.dbg.global_variables = linkonce constant
> %llvm.dbg.anchor.type { i32 458752, i32 52 }, section
> "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
> - at .str14 = internal constant [7 x i8] c"c.1442\00", section
> "llvm.metadata" ; <[7 x i8]*> [#uses=1]
> - at .str15 = internal constant [2 x i8] c"c\00", section
> "llvm.metadata" ; <[2 x i8]*> [#uses=1]
> - at llvm.dbg.global_variable = internal constant
> %llvm.dbg.global_variable.type { i32 458804, %0* bitcast
> (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %0*), %0*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to
> %0*), i8* getelementptr ([7 x i8]* @.str14, i32 0, i32 0), i8*
> getelementptr ([2 x i8]* @.str15, i32 0, i32 0), i8* null, %0*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to
> %0*), i32 4, %0* bitcast (%llvm.dbg.basictype.type*
> @llvm.dbg.basictype to %0*), i1 true, i1 true, %0* bitcast (i32* @c.
> 1442 to %0*) }, section "llvm.metadata" ; <
> %llvm.dbg.global_variable.type*> [#uses=0]
> -
> -define i32 @main() nounwind {
> -entry:
> - %b = alloca %struct..0x ; <%struct..0x*> [#uses=2]
> - %a = alloca [4 x i32] ; <[4 x i32]*> [#uses=1]
> - %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
> - call void @llvm.dbg.func.start(%0* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*))
> - %0 = bitcast %struct..0x* %b to %0* ; <%0*> [#uses=1]
> - call void @llvm.dbg.declare(%0* %0, %0* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable to %0*))
> - %1 = bitcast [4 x i32]* %a to %0* ; <%0*> [#uses=1]
> - call void @llvm.dbg.declare(%0* %1, %0* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable13 to %0*))
> - call void @llvm.dbg.stoppoint(i32 8, i32 0, %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
> - %2 = getelementptr %struct..0x* %b, i32 0, i32 0 ; <i32*> [#uses=1]
> - store i32 5, i32* %2, align 4
> - call void @llvm.dbg.stoppoint(i32 9, i32 0, %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
> - %3 = load i32* @c.1442, align 4 ; <i32> [#uses=1]
> - br label %return
> -
> -return: ; preds = %entry
> - call void @llvm.dbg.stoppoint(i32 9, i32 0, %0* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
> - call void @llvm.dbg.region.end(%0* bitcast
> (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*))
> - ret i32 %3
> -}
> -
> -declare void @llvm.dbg.func.start(%0*) nounwind readnone
> -
> -declare void @llvm.dbg.declare(%0*, %0*) nounwind readnone
> -
> -declare void @llvm.dbg.stoppoint(i32, i32, %0*) nounwind readnone
> -
> -declare void @llvm.dbg.region.end(%0*) nounwind readnone
>
> Removed: llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-02-16-AnonTypedef-Dbg.cpp?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp
> (original)
> +++ llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp
> (removed)
> @@ -1,5 +0,0 @@
> -// Test on debug info to make sure that anon typedef info is emitted.
> -// RUN: %llvmgcc -S --emit-llvm -x c++ -g %s -o - | grep composite
> -typedef struct { int a; long b; } foo;
> -foo x;
> -
>
> Removed: llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m?rev=79976&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m
> (original)
> +++ llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m (removed)
> @@ -1,13 +0,0 @@
> -// RUN: %llvmgcc -x objective-c -S %s -g --emit-llvm -o - | grep
> "dbg.compile_unit =" | grep "null, i32"
> -// Last parameter represent i32 runtime version id. The previous
> paramenter
> -// encodes command line flags when certain env. variables are set.
> In this
> -// example it is the only compile_unit parameter that is null. This
> test case
> -// tests existence of new additional compile_unit parameter to encode
> -// Objective-C runtime version number.
> -
> - at interface foo
> - at end
> - at implementation foo
> - at end
> -
> -void fn(foo *f) {}
>
> Modified: llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll?rev=79977&r1=79976&r2=79977&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll (original)
> +++ llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll Tue Aug 25
> 00:24:07 2009
> @@ -1,5 +1,3 @@
> -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep region |
> count 2
> -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep func.start
> | count 2
> ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep "br
> label"
>
> %llvm.dbg.anchor.type = type { i32, i32 }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list