llvm.org GIT mirror llvm / 5420de3
DebugInfo: New metadata representation for global variables. This patch reverses the edge from DIGlobalVariable to GlobalVariable. This will allow us to more easily preserve debug info metadata when manipulating global variables. Fixes PR30362. A program for upgrading test cases is attached to that bug. Differential Revision: http://reviews.llvm.org/D20147 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281284 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 4 years ago
159 changed file(s) with 922 addition(s) and 796 deletion(s). Raw diff Collapse all Expand all
453453 /// \param Ty Variable Type.
454454 /// \param isLocalToUnit Boolean flag indicate whether this variable is
455455 /// externally visible or not.
456 /// \param Val llvm::Value of the variable.
456 /// \param Expr The location of the global relative to the attached
457 /// GlobalVariable.
457458 /// \param Decl Reference to the corresponding declaration.
458459 DIGlobalVariable *createGlobalVariable(DIScope *Context, StringRef Name,
459460 StringRef LinkageName, DIFile *File,
460461 unsigned LineNo, DIType *Ty,
461462 bool isLocalToUnit,
462 llvm::Constant *Val,
463 DIExpression *Expr = nullptr,
463464 MDNode *Decl = nullptr);
464465
465466 /// Identical to createGlobalVariable
466467 /// except that the resulting DbgNode is temporary and meant to be RAUWed.
467468 DIGlobalVariable *createTempGlobalVariableFwdDecl(
468469 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
469 unsigned LineNo, DIType *Ty, bool isLocalToUnit, llvm::Constant *Val,
470 unsigned LineNo, DIType *Ty, bool isLocalToUnit, DIExpression *Expr,
470471 MDNode *Decl = nullptr);
471472
472473 /// Create a new descriptor for an auto variable. This is a local variable
512513 /// \param SizeInBits Size of the piece in bits.
513514 DIExpression *createBitPieceExpression(unsigned OffsetInBits,
514515 unsigned SizeInBits);
516
517 /// Create an expression for a variable that does not have an address, but
518 /// does have a constant value.
519 DIExpression *createConstantValueExpression(uint64_t Val) {
520 return DIExpression::get(
521 VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
522 }
515523
516524 /// Create a new descriptor for the specified subprogram.
517525 /// See comments in DISubprogram* for descriptions of these fields.
18611861 }
18621862 };
18631863
1864 /// \brief DWARF expression.
1865 ///
1866 /// This is (almost) a DWARF expression that modifies the location of a
1867 /// variable, or the location of a single piece of a variable, or (when using
1868 /// DW_OP_stack_value) is the constant variable value.
1869 ///
1870 /// FIXME: Instead of DW_OP_plus taking an argument, this should use DW_OP_const
1871 /// and have DW_OP_plus consume the topmost elements on the stack.
1872 ///
1873 /// TODO: Co-allocate the expression elements.
1874 /// TODO: Separate from MDNode, or otherwise drop Distinct and Temporary
1875 /// storage types.
1876 class DIExpression : public MDNode {
1877 friend class LLVMContextImpl;
1878 friend class MDNode;
1879
1880 std::vector Elements;
1881
1882 DIExpression(LLVMContext &C, StorageType Storage, ArrayRef Elements)
1883 : MDNode(C, DIExpressionKind, Storage, None),
1884 Elements(Elements.begin(), Elements.end()) {}
1885 ~DIExpression() = default;
1886
1887 static DIExpression *getImpl(LLVMContext &Context,
1888 ArrayRef Elements, StorageType Storage,
1889 bool ShouldCreate = true);
1890
1891 TempDIExpression cloneImpl() const {
1892 return getTemporary(getContext(), getElements());
1893 }
1894
1895 public:
1896 DEFINE_MDNODE_GET(DIExpression, (ArrayRef Elements), (Elements))
1897
1898 TempDIExpression clone() const { return cloneImpl(); }
1899
1900 ArrayRef getElements() const { return Elements; }
1901
1902 unsigned getNumElements() const { return Elements.size(); }
1903 uint64_t getElement(unsigned I) const {
1904 assert(I < Elements.size() && "Index out of range");
1905 return Elements[I];
1906 }
1907
1908 /// Return whether this is a piece of an aggregate variable.
1909 bool isBitPiece() const;
1910
1911 /// Return the offset of this piece in bits.
1912 uint64_t getBitPieceOffset() const;
1913
1914 /// Return the size of this piece in bits.
1915 uint64_t getBitPieceSize() const;
1916
1917 typedef ArrayRef::iterator element_iterator;
1918 element_iterator elements_begin() const { return getElements().begin(); }
1919 element_iterator elements_end() const { return getElements().end(); }
1920
1921 /// A lightweight wrapper around an expression operand.
1922 ///
1923 /// TODO: Store arguments directly and change \a DIExpression to store a
1924 /// range of these.
1925 class ExprOperand {
1926 const uint64_t *Op;
1927
1928 public:
1929 explicit ExprOperand(const uint64_t *Op) : Op(Op) {}
1930
1931 const uint64_t *get() const { return Op; }
1932
1933 /// Get the operand code.
1934 uint64_t getOp() const { return *Op; }
1935
1936 /// Get an argument to the operand.
1937 ///
1938 /// Never returns the operand itself.
1939 uint64_t getArg(unsigned I) const { return Op[I + 1]; }
1940
1941 unsigned getNumArgs() const { return getSize() - 1; }
1942
1943 /// Return the size of the operand.
1944 ///
1945 /// Return the number of elements in the operand (1 + args).
1946 unsigned getSize() const;
1947 };
1948
1949 /// An iterator for expression operands.
1950 class expr_op_iterator
1951 : public std::iterator {
1952 ExprOperand Op;
1953
1954 public:
1955 explicit expr_op_iterator(element_iterator I) : Op(I) {}
1956
1957 element_iterator getBase() const { return Op.get(); }
1958 const ExprOperand &operator*() const { return Op; }
1959 const ExprOperand *operator->() const { return &Op; }
1960
1961 expr_op_iterator &operator++() {
1962 increment();
1963 return *this;
1964 }
1965 expr_op_iterator operator++(int) {
1966 expr_op_iterator T(*this);
1967 increment();
1968 return T;
1969 }
1970
1971 /// Get the next iterator.
1972 ///
1973 /// \a std::next() doesn't work because this is technically an
1974 /// input_iterator, but it's a perfectly valid operation. This is an
1975 /// accessor to provide the same functionality.
1976 expr_op_iterator getNext() const { return ++expr_op_iterator(*this); }
1977
1978 bool operator==(const expr_op_iterator &X) const {
1979 return getBase() == X.getBase();
1980 }
1981 bool operator!=(const expr_op_iterator &X) const {
1982 return getBase() != X.getBase();
1983 }
1984
1985 private:
1986 void increment() { Op = ExprOperand(getBase() + Op.getSize()); }
1987 };
1988
1989 /// Visit the elements via ExprOperand wrappers.
1990 ///
1991 /// These range iterators visit elements through \a ExprOperand wrappers.
1992 /// This is not guaranteed to be a valid range unless \a isValid() gives \c
1993 /// true.
1994 ///
1995 /// \pre \a isValid() gives \c true.
1996 /// @{
1997 expr_op_iterator expr_op_begin() const {
1998 return expr_op_iterator(elements_begin());
1999 }
2000 expr_op_iterator expr_op_end() const {
2001 return expr_op_iterator(elements_end());
2002 }
2003 /// @}
2004
2005 bool isValid() const;
2006
2007 static bool classof(const Metadata *MD) {
2008 return MD->getMetadataID() == DIExpressionKind;
2009 }
2010
2011 /// Is the first element a DW_OP_deref?.
2012 bool startsWithDeref() const {
2013 return getNumElements() > 0 && getElement(0) == dwarf::DW_OP_deref;
2014 }
2015 };
2016
18642017 /// \brief Global variables.
18652018 ///
18662019 /// TODO: Remove DisplayName. It's always equal to Name.
18812034 static DIGlobalVariable *
18822035 getImpl(LLVMContext &Context, DIScope *Scope, StringRef Name,
18832036 StringRef LinkageName, DIFile *File, unsigned Line, DITypeRef Type,
1884 bool IsLocalToUnit, bool IsDefinition, Constant *Variable,
2037 bool IsLocalToUnit, bool IsDefinition, DIExpression *Expr,
18852038 DIDerivedType *StaticDataMemberDeclaration, StorageType Storage,
18862039 bool ShouldCreate = true) {
18872040 return getImpl(Context, Scope, getCanonicalMDString(Context, Name),
18882041 getCanonicalMDString(Context, LinkageName), File, Line, Type,
1889 IsLocalToUnit, IsDefinition,
1890 Variable ? ConstantAsMetadata::get(Variable) : nullptr,
2042 IsLocalToUnit, IsDefinition, Expr,
18912043 StaticDataMemberDeclaration, Storage, ShouldCreate);
18922044 }
18932045 static DIGlobalVariable *
18942046 getImpl(LLVMContext &Context, Metadata *Scope, MDString *Name,
18952047 MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type,
1896 bool IsLocalToUnit, bool IsDefinition, Metadata *Variable,
2048 bool IsLocalToUnit, bool IsDefinition, Metadata *Expr,
18972049 Metadata *StaticDataMemberDeclaration, StorageType Storage,
18982050 bool ShouldCreate = true);
18992051
19002052 TempDIGlobalVariable cloneImpl() const {
19012053 return getTemporary(getContext(), getScope(), getName(), getLinkageName(),
19022054 getFile(), getLine(), getType(), isLocalToUnit(),
1903 isDefinition(), getVariable(),
2055 isDefinition(), getExpr(),
19042056 getStaticDataMemberDeclaration());
19052057 }
19062058
19082060 DEFINE_MDNODE_GET(DIGlobalVariable,
19092061 (DIScope * Scope, StringRef Name, StringRef LinkageName,
19102062 DIFile *File, unsigned Line, DITypeRef Type,
1911 bool IsLocalToUnit, bool IsDefinition, Constant *Variable,
2063 bool IsLocalToUnit, bool IsDefinition, DIExpression *Expr,
19122064 DIDerivedType *StaticDataMemberDeclaration),
19132065 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,
1914 IsDefinition, Variable, StaticDataMemberDeclaration))
2066 IsDefinition, Expr, StaticDataMemberDeclaration))
19152067 DEFINE_MDNODE_GET(DIGlobalVariable,
19162068 (Metadata * Scope, MDString *Name, MDString *LinkageName,
19172069 Metadata *File, unsigned Line, Metadata *Type,
1918 bool IsLocalToUnit, bool IsDefinition, Metadata *Variable,
2070 bool IsLocalToUnit, bool IsDefinition, Metadata *Expr,
19192071 Metadata *StaticDataMemberDeclaration),
19202072 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,
1921 IsDefinition, Variable, StaticDataMemberDeclaration))
2073 IsDefinition, Expr, StaticDataMemberDeclaration))
19222074
19232075 TempDIGlobalVariable clone() const { return cloneImpl(); }
19242076
19262078 bool isDefinition() const { return IsDefinition; }
19272079 StringRef getDisplayName() const { return getStringOperand(4); }
19282080 StringRef getLinkageName() const { return getStringOperand(5); }
1929 Constant *getVariable() const {
1930 if (auto *C = cast_or_null(getRawVariable()))
1931 return dyn_cast(C->getValue());
1932 return nullptr;
2081 DIExpression *getExpr() const {
2082 return cast_or_null(getRawExpr());
2083 }
2084 void replaceExpr(DIExpression *E) {
2085 replaceOperandWith(6, E);
19332086 }
19342087 DIDerivedType *getStaticDataMemberDeclaration() const {
19352088 return cast_or_null(getRawStaticDataMemberDeclaration());
19362089 }
19372090
19382091 MDString *getRawLinkageName() const { return getOperandAs(5); }
1939 Metadata *getRawVariable() const { return getOperand(6); }
2092 Metadata *getRawExpr() const { return getOperand(6); }
19402093 Metadata *getRawStaticDataMemberDeclaration() const { return getOperand(7); }
19412094
19422095 static bool classof(const Metadata *MD) {
20202173
20212174 static bool classof(const Metadata *MD) {
20222175 return MD->getMetadataID() == DILocalVariableKind;
2023 }
2024 };
2025
2026 /// \brief DWARF expression.
2027 ///
2028 /// This is (almost) a DWARF expression that modifies the location of a
2029 /// variable or (or the location of a single piece of a variable).
2030 ///
2031 /// FIXME: Instead of DW_OP_plus taking an argument, this should use DW_OP_const
2032 /// and have DW_OP_plus consume the topmost elements on the stack.
2033 ///
2034 /// TODO: Co-allocate the expression elements.
2035 /// TODO: Separate from MDNode, or otherwise drop Distinct and Temporary
2036 /// storage types.
2037 class DIExpression : public MDNode {
2038 friend class LLVMContextImpl;
2039 friend class MDNode;
2040
2041 std::vector Elements;
2042
2043 DIExpression(LLVMContext &C, StorageType Storage, ArrayRef Elements)
2044 : MDNode(C, DIExpressionKind, Storage, None),
2045 Elements(Elements.begin(), Elements.end()) {}
2046 ~DIExpression() = default;
2047
2048 static DIExpression *getImpl(LLVMContext &Context,
2049 ArrayRef Elements, StorageType Storage,
2050 bool ShouldCreate = true);
2051
2052 TempDIExpression cloneImpl() const {
2053 return getTemporary(getContext(), getElements());
2054 }
2055
2056 public:
2057 DEFINE_MDNODE_GET(DIExpression, (ArrayRef Elements), (Elements))
2058
2059 TempDIExpression clone() const { return cloneImpl(); }
2060
2061 ArrayRef getElements() const { return Elements; }
2062
2063 unsigned getNumElements() const { return Elements.size(); }
2064 uint64_t getElement(unsigned I) const {
2065 assert(I < Elements.size() && "Index out of range");
2066 return Elements[I];
2067 }
2068
2069 /// \brief Return whether this is a piece of an aggregate variable.
2070 bool isBitPiece() const;
2071
2072 /// \brief Return the offset of this piece in bits.
2073 uint64_t getBitPieceOffset() const;
2074
2075 /// \brief Return the size of this piece in bits.
2076 uint64_t getBitPieceSize() const;
2077
2078 typedef ArrayRef::iterator element_iterator;
2079 element_iterator elements_begin() const { return getElements().begin(); }
2080 element_iterator elements_end() const { return getElements().end(); }
2081
2082 /// \brief A lightweight wrapper around an expression operand.
2083 ///
2084 /// TODO: Store arguments directly and change \a DIExpression to store a
2085 /// range of these.
2086 class ExprOperand {
2087 const uint64_t *Op;
2088
2089 public:
2090 explicit ExprOperand(const uint64_t *Op) : Op(Op) {}
2091
2092 const uint64_t *get() const { return Op; }
2093
2094 /// \brief Get the operand code.
2095 uint64_t getOp() const { return *Op; }
2096
2097 /// \brief Get an argument to the operand.
2098 ///
2099 /// Never returns the operand itself.
2100 uint64_t getArg(unsigned I) const { return Op[I + 1]; }
2101
2102 unsigned getNumArgs() const { return getSize() - 1; }
2103
2104 /// \brief Return the size of the operand.
2105 ///
2106 /// Return the number of elements in the operand (1 + args).
2107 unsigned getSize() const;
2108 };
2109
2110 /// \brief An iterator for expression operands.
2111 class expr_op_iterator
2112 : public std::iterator {
2113 ExprOperand Op;
2114
2115 public:
2116 explicit expr_op_iterator(element_iterator I) : Op(I) {}
2117
2118 element_iterator getBase() const { return Op.get(); }
2119 const ExprOperand &operator*() const { return Op; }
2120 const ExprOperand *operator->() const { return &Op; }
2121
2122 expr_op_iterator &operator++() {
2123 increment();
2124 return *this;
2125 }
2126 expr_op_iterator operator++(int) {
2127 expr_op_iterator T(*this);
2128 increment();
2129 return T;
2130 }
2131
2132 /// \brief Get the next iterator.
2133 ///
2134 /// \a std::next() doesn't work because this is technically an
2135 /// input_iterator, but it's a perfectly valid operation. This is an
2136 /// accessor to provide the same functionality.
2137 expr_op_iterator getNext() const { return ++expr_op_iterator(*this); }
2138
2139 bool operator==(const expr_op_iterator &X) const {
2140 return getBase() == X.getBase();
2141 }
2142 bool operator!=(const expr_op_iterator &X) const {
2143 return getBase() != X.getBase();
2144 }
2145
2146 private:
2147 void increment() { Op = ExprOperand(getBase() + Op.getSize()); }
2148 };
2149
2150 /// \brief Visit the elements via ExprOperand wrappers.
2151 ///
2152 /// These range iterators visit elements through \a ExprOperand wrappers.
2153 /// This is not guaranteed to be a valid range unless \a isValid() gives \c
2154 /// true.
2155 ///
2156 /// \pre \a isValid() gives \c true.
2157 /// @{
2158 expr_op_iterator expr_op_begin() const {
2159 return expr_op_iterator(elements_begin());
2160 }
2161 expr_op_iterator expr_op_end() const {
2162 return expr_op_iterator(elements_end());
2163 }
2164 /// @}
2165
2166 bool isValid() const;
2167
2168 static bool classof(const Metadata *MD) {
2169 return MD->getMetadataID() == DIExpressionKind;
2170 }
2171
2172 /// \brief Is the first element a DW_OP_deref?.
2173 bool startsWithDeref() const {
2174 return getNumElements() > 0 && getElement(0) == dwarf::DW_OP_deref;
21752176 }
21762177 };
21772178
2626
2727 namespace llvm {
2828
29 class Constant;
30 class DIGlobalVariable;
2931 class Module;
30 class Constant;
3132 template class SymbolTableListTraits;
3233
3334 class GlobalVariable : public GlobalObject, public ilist_node {
164165 /// drops not only the reference to the initializer but also to any metadata.
165166 void dropAllReferences();
166167
168 void addDebugInfo(DIGlobalVariable *GV);
169 void getDebugInfo(SmallVectorImpl &GVs) const;
170
167171 // Methods for support type inquiry through isa, cast, and dyn_cast:
168172 static inline bool classof(const Value *V) {
169173 return V->getValueID() == Value::GlobalVariableVal;
42004200 OPTIONAL(type, MDField, ); \
42014201 OPTIONAL(isLocal, MDBoolField, ); \
42024202 OPTIONAL(isDefinition, MDBoolField, (true)); \
4203 OPTIONAL(variable, MDConstant, ); \
4203 OPTIONAL(expr, MDField, ); \
42044204 OPTIONAL(declaration, MDField, );
42054205 PARSE_MD_FIELDS();
42064206 #undef VISIT_MD_FIELDS
42084208 Result = GET_OR_DISTINCT(DIGlobalVariable,
42094209 (Context, scope.Val, name.Val, linkageName.Val,
42104210 file.Val, line.Val, type.Val, isLocal.Val,
4211 isDefinition.Val, variable.Val, declaration.Val));
4211 isDefinition.Val, expr.Val, declaration.Val));
42124212 return false;
42134213 }
42144214
26782678 return error("Invalid record");
26792679
26802680 IsDistinct = Record[0];
2681 MetadataList.assignValue(
2682 GET_OR_DISTINCT(DIGlobalVariable,
2683 (Context, getMDOrNull(Record[1]),
2684 getMDString(Record[2]), getMDString(Record[3]),
2685 getMDOrNull(Record[4]), Record[5],
2686 getDITypeRefOrNull(Record[6]), Record[7], Record[8],
2687 getMDOrNull(Record[9]), getMDOrNull(Record[10]))),
2688 NextMetadataNo++);
2681
2682 // Upgrade old metadata, which stored a global variable reference or a
2683 // ConstantInt here.
2684 Metadata *Expr = getMDOrNull(Record[9]);
2685 GlobalVariable *Attach = nullptr;
2686 if (auto *CMD = dyn_cast_or_null(Expr)) {
2687 if (auto *GV = dyn_cast(CMD->getValue())) {
2688 Attach = GV;
2689 Expr = nullptr;
2690 } else if (auto *CI = dyn_cast(CMD->getValue())) {
2691 Expr = DIExpression::get(Context,
2692 {dwarf::DW_OP_constu, CI->getZExtValue(),
2693 dwarf::DW_OP_stack_value});
2694 } else {
2695 Expr = nullptr;
2696 }
2697 }
2698
2699 DIGlobalVariable *DGV = GET_OR_DISTINCT(
2700 DIGlobalVariable,
2701 (Context, getMDOrNull(Record[1]), getMDString(Record[2]),
2702 getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
2703 getDITypeRefOrNull(Record[6]), Record[7], Record[8], Expr,
2704 getMDOrNull(Record[10])));
2705 MetadataList.assignValue(DGV, NextMetadataNo++);
2706
2707 if (Attach)
2708 Attach->addDebugInfo(DGV);
2709
26892710 break;
26902711 }
26912712 case bitc::METADATA_LOCAL_VAR: {
17091709 Record.push_back(VE.getMetadataOrNullID(N->getType()));
17101710 Record.push_back(N->isLocalToUnit());
17111711 Record.push_back(N->isDefinition());
1712 Record.push_back(VE.getMetadataOrNullID(N->getRawVariable()));
1712 Record.push_back(VE.getMetadataOrNullID(N->getRawExpr()));
17131713 Record.push_back(VE.getMetadataOrNullID(N->getStaticDataMemberDeclaration()));
17141714
17151715 Stream.EmitRecord(bitc::METADATA_GLOBAL_VAR, Record, Abbrev);
20002000 }
20012001
20022002 void CodeViewDebug::emitDebugInfoForGlobals() {
2003 DenseMap GlobalMap;
2004 for (const GlobalVariable &GV : MMI->getModule()->globals()) {
2005 SmallVector MDs;
2006 GV.getMetadata(LLVMContext::MD_dbg, MDs);
2007 for (MDNode *MD : MDs)
2008 GlobalMap[cast(MD)] = &GV;
2009 }
2010
20032011 NamedMDNode *CUs = MMI->getModule()->getNamedMetadata("llvm.dbg.cu");
20042012 for (const MDNode *Node : CUs->operands()) {
20052013 const auto *CU = cast(Node);
20102018 switchToDebugSectionForSymbol(nullptr);
20112019 MCSymbol *EndLabel = nullptr;
20122020 for (const DIGlobalVariable *G : CU->getGlobalVariables()) {
2013 if (const auto *GV = dyn_cast_or_null(G->getVariable())) {
2021 if (const auto *GV = GlobalMap.lookup(G))
20142022 if (!GV->hasComdat() && !GV->isDeclarationForLinker()) {
20152023 if (!EndLabel) {
20162024 OS.AddComment("Symbol subsection for globals");
20172025 EndLabel = beginCVSubsection(ModuleSubstreamKind::Symbols);
20182026 }
2019 emitDebugInfoForGlobal(G, Asm->getSymbol(GV));
2027 emitDebugInfoForGlobal(G, GV, Asm->getSymbol(GV));
20202028 }
2021 }
20222029 }
20232030 if (EndLabel)
20242031 endCVSubsection(EndLabel);
20262033 // Second, emit each global that is in a comdat into its own .debug$S
20272034 // section along with its own symbol substream.
20282035 for (const DIGlobalVariable *G : CU->getGlobalVariables()) {
2029 if (const auto *GV = dyn_cast_or_null(G->getVariable())) {
2036 if (const auto *GV = GlobalMap.lookup(G)) {
20302037 if (GV->hasComdat()) {
20312038 MCSymbol *GVSym = Asm->getSymbol(GV);
20322039 OS.AddComment("Symbol subsection for " +
20332040 Twine(GlobalValue::getRealLinkageName(GV->getName())));
20342041 switchToDebugSectionForSymbol(GVSym);
20352042 EndLabel = beginCVSubsection(ModuleSubstreamKind::Symbols);
2036 emitDebugInfoForGlobal(G, GVSym);
2043 emitDebugInfoForGlobal(G, GV, GVSym);
20372044 endCVSubsection(EndLabel);
20382045 }
20392046 }
20542061 }
20552062
20562063 void CodeViewDebug::emitDebugInfoForGlobal(const DIGlobalVariable *DIGV,
2064 const GlobalVariable *GV,
20572065 MCSymbol *GVSym) {
20582066 // DataSym record, see SymbolRecord.h for more info.
20592067 // FIXME: Thread local data, etc
20622070 OS.AddComment("Record length");
20632071 OS.emitAbsoluteSymbolDiff(DataEnd, DataBegin, 2);
20642072 OS.EmitLabel(DataBegin);
2065 const auto *GV = cast(DIGV->getVariable());
20662073 if (DIGV->isLocalToUnit()) {
20672074 if (GV->isThreadLocal()) {
20682075 OS.AddComment("Record kind: S_LTHREAD32");
201201 void emitDebugInfoForUDTs(
202202 ArrayRef> UDTs);
203203
204 void emitDebugInfoForGlobal(const DIGlobalVariable *DIGV, MCSymbol *GVSym);
204 void emitDebugInfoForGlobal(const DIGlobalVariable *DIGV,
205 const GlobalVariable *GV, MCSymbol *GVSym);
205206
206207 /// Opens a subsection of the given kind in a .debug$S codeview section.
207208 /// Returns an end label for use with endCVSubsection when the subsection is
7272 Asm->OutStreamer->hasRawTextSupport() ? 0 : getUniqueID());
7373 }
7474
75 // Return const expression if value is a GEP to access merged global
76 // constant. e.g.
77 // i8* getelementptr ({ i8, i8, i8, i8 }* @_MergedGlobals, i32 0, i32 0)
78 static const ConstantExpr *getMergedGlobalExpr(const Value *V) {
79 const ConstantExpr *CE = dyn_cast_or_null(V);
80 if (!CE || CE->getNumOperands() != 3 ||
81 CE->getOpcode() != Instruction::GetElementPtr)
82 return nullptr;
83
84 // First operand points to a global struct.
85 Value *Ptr = CE->getOperand(0);
86 GlobalValue *GV = dyn_cast(Ptr);
87 if (!GV || !isa(GV->getValueType()))
88 return nullptr;
89
90 // Second operand is zero.
91 const ConstantInt *CI = dyn_cast_or_null(CE->getOperand(1));
92 if (!CI || !CI->isZero())
93 return nullptr;
94
95 // Third operand is offset.
96 if (!isa(CE->getOperand(2)))
97 return nullptr;
98
99 return CE;
100 }
101
10275 /// getOrCreateGlobalVariableDIE - get or create global variable DIE.
10376 DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(
104 const DIGlobalVariable *GV) {
77 const DIGlobalVariable *GV, const GlobalVariable *Global) {
10578 // Check for pre-existence.
10679 if (DIE *Die = getDIE(GV))
10780 return Die;
146119
147120 // Add location.
148121 bool addToAccelTable = false;
149 if (auto *Global = dyn_cast_or_null(GV->getVariable())) {
122
123 DIExpression *Expr = GV->getExpr();
124
125 // For compatibility with DWARF 3 and earlier,
126 // DW_AT_location(DW_OP_constu, X, DW_OP_stack_value) becomes
127 // DW_AT_const_value(X).
128 if (Expr && Expr->getNumElements() == 3 &&
129 Expr->getElement(0) == dwarf::DW_OP_constu &&
130 Expr->getElement(2) == dwarf::DW_OP_stack_value) {
131 addConstantValue(*VariableDIE, /*Unsigned=*/true, Expr->getElement(1));
150132 // We cannot describe the location of dllimport'd variables: the computation
151133 // of their address requires loads from the IAT.
152 if (!Global->hasDLLImportStorageClass()) {
134 } else if (!Global || !Global->hasDLLImportStorageClass()) {
135 DIELoc *Loc = new (DIEValueAllocator) DIELoc;
136 if (Global) {
153137 addToAccelTable = true;
154 DIELoc *Loc = new (DIEValueAllocator) DIELoc;
155138 const MCSymbol *Sym = Asm->getSymbol(Global);
156139 if (Global->isThreadLocal()) {
157140 if (Asm->TM.Options.EmulatedTLS) {
186169 addOpAddress(*Loc, Sym);
187170 }
188171
189 addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
190 if (DD->useAllLinkageNames())
191 addLinkageName(*VariableDIE, GV->getLinkageName());
172 if (Expr) {
173 DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
174 DwarfExpr.AddExpression(Expr->expr_op_begin(), Expr->expr_op_end());
175 }
192176 }
193 } else if (const ConstantInt *CI =
194 dyn_cast_or_null(GV->getVariable())) {
195 addConstantValue(*VariableDIE, CI, GTy);
196 } else if (const ConstantExpr *CE = getMergedGlobalExpr(GV->getVariable())) {
197 auto *Ptr = cast(CE->getOperand(0));
198 if (!Ptr->hasDLLImportStorageClass()) {
199 addToAccelTable = true;
200 // GV is a merged global.
201 DIELoc *Loc = new (DIEValueAllocator) DIELoc;
202 MCSymbol *Sym = Asm->getSymbol(Ptr);
203 DD->addArangeLabel(SymbolCU(this, Sym));
204 addOpAddress(*Loc, Sym);
205 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_constu);
206 SmallVector Idx(CE->op_begin() + 1, CE->op_end());
207 addUInt(*Loc, dwarf::DW_FORM_udata,
208 Asm->getDataLayout().getIndexedOffsetInType(Ptr->getValueType(),
209 Idx));
210 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus);
211 addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
212 }
177
178 addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
179
180 if (DD->useAllLinkageNames())
181 addLinkageName(*VariableDIE, GV->getLinkageName());
213182 }
214183
215184 if (addToAccelTable) {
673642 else if (auto *T = dyn_cast(Entity))
674643 EntityDie = getOrCreateTypeDIE(T);
675644 else if (auto *GV = dyn_cast(Entity))
676 EntityDie = getOrCreateGlobalVariableDIE(GV);
645 EntityDie = getOrCreateGlobalVariableDIE(GV, nullptr);
677646 else
678647 EntityDie = getDIE(Entity);
679648 assert(EntityDie);
9696 void applyStmtList(DIE &D);
9797
9898 /// getOrCreateGlobalVariableDIE - get or create global variable DIE.
99 DIE *getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV);
99 DIE *getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV,
100 const GlobalVariable *Global);
100101
101102 /// addLabelAddress - Add a dwarf label attribute data and value using
102103 /// either DW_FORM_addr or DW_FORM_GNU_addr_index.
476476 MMI->setDebugInfoAvailability(NumDebugCUs > 0);
477477 SingleCU = NumDebugCUs == 1;
478478
479 DenseMap GVMap;
480 for (const GlobalVariable &Global : M->globals()) {
481 SmallVector GVs;
482 Global.getDebugInfo(GVs);
483 for (auto &GV : GVs)
484 GVMap[GV] = &Global;
485 }
486
479487 for (DICompileUnit *CUNode : M->debug_compile_units()) {
480488 DwarfCompileUnit &CU = constructDwarfCompileUnit(CUNode);
481489 for (auto *IE : CUNode->getImportedEntities())
482490 CU.addImportedEntity(IE);
483491 for (auto *GV : CUNode->getGlobalVariables())
484 CU.getOrCreateGlobalVariableDIE(GV);
492 CU.getOrCreateGlobalVariableDIE(GV, GVMap.lookup(GV));
485493 for (auto *Ty : CUNode->getEnumTypes()) {
486494 // The enum types array by design contains pointers to
487495 // MDNodes rather than DIRefs. Unique them here.
277277 case dwarf::DW_OP_deref:
278278 EmitOp(dwarf::DW_OP_deref);
279279 break;
280 case dwarf::DW_OP_constu:
281 EmitOp(dwarf::DW_OP_constu);
282 EmitUnsigned(I->getArg(0));
283 break;
284 case dwarf::DW_OP_stack_value:
285 AddStackValue();
286 break;
280287 default:
281288 llvm_unreachable("unhandled opcode found in expression");
282289 }
450450 M, MergedTy, isConst, GlobalValue::PrivateLinkage, MergedInit,
451451 "_MergedGlobals", nullptr, GlobalVariable::NotThreadLocal, AddrSpace);
452452
453 const StructLayout *MergedLayout = DL.getStructLayout(MergedTy);
454
453455 for (ssize_t k = i, idx = 0; k != j; k = GlobalSet.find_next(k), ++idx) {
454456 GlobalValue::LinkageTypes Linkage = Globals[k]->getLinkage();
455457 std::string Name = Globals[k]->getName();
458
459 // Copy metadata while adjusting any debug info metadata by the original
460 // global's offset within the merged global.
461 MergedGV->copyMetadata(Globals[k], MergedLayout->getElementOffset(idx));
456462
457463 Constant *Idx[2] = {
458464 ConstantInt::get(Int32Ty, 0),
18151815 Printer.printMetadata("type", N->getRawType());
18161816 Printer.printBool("isLocal", N->isLocalToUnit());
18171817 Printer.printBool("isDefinition", N->isDefinition());
1818 Printer.printMetadata("variable", N->getRawVariable());
1818 Printer.printMetadata("expr", N->getExpr());
18191819 Printer.printMetadata("declaration", N->getRawStaticDataMemberDeclaration());
18201820 Out << ")";
18211821 }
534534
535535 DIGlobalVariable *DIBuilder::createGlobalVariable(
536536 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *F,
537 unsigned LineNumber, DIType *Ty, bool isLocalToUnit, Constant *Val,
537 unsigned LineNumber, DIType *Ty, bool isLocalToUnit, DIExpression *Expr,
538538 MDNode *Decl) {
539539 checkGlobalVariableScope(Context);
540540
541541 auto *N = DIGlobalVariable::getDistinct(
542542 VMContext, cast_or_null(Context), Name, LinkageName, F,
543 LineNumber, Ty, isLocalToUnit, true, Val,
543 LineNumber, Ty, isLocalToUnit, true, Expr,
544544 cast_or_null(Decl));
545545 AllGVs.push_back(N);
546546 return N;
548548
549549 DIGlobalVariable *DIBuilder::createTempGlobalVariableFwdDecl(
550550 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *F,
551 unsigned LineNumber, DIType *Ty, bool isLocalToUnit, Constant *Val,
551 unsigned LineNumber, DIType *Ty, bool isLocalToUnit, DIExpression *Expr,
552552 MDNode *Decl) {
553553 checkGlobalVariableScope(Context);
554554
555555 return DIGlobalVariable::getTemporary(
556556 VMContext, cast_or_null(Context), Name, LinkageName, F,
557 LineNumber, Ty, isLocalToUnit, false, Val,
557 LineNumber, Ty, isLocalToUnit, false, Expr,
558558 cast_or_null(Decl))
559559 .release();
560560 }
550550 switch (getOp()) {
551551 case dwarf::DW_OP_bit_piece:
552552 return 3;
553 case dwarf::DW_OP_constu:
553554 case dwarf::DW_OP_plus:
554555 case dwarf::DW_OP_minus:
555556 return 2;
569570 default:
570571 return false;
571572 case dwarf::DW_OP_bit_piece:
572 // Piece expressions must be at the end.
573 case dwarf::DW_OP_stack_value:
574 // We only support bit piece and stack value expressions which appear at
575 // the end.
573576 return I->get() + I->getSize() == E->get();
577 case dwarf::DW_OP_constu:
574578 case dwarf::DW_OP_plus:
575579 case dwarf::DW_OP_minus:
576580 case dwarf::DW_OP_deref:
757757 Metadata *Type;
758758 bool IsLocalToUnit;
759759 bool IsDefinition;
760 Metadata *Variable;
760 Metadata *Expr;
761761 Metadata *StaticDataMemberDeclaration;
762762
763763 MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName,
764764 Metadata *File, unsigned Line, Metadata *Type,
765 bool IsLocalToUnit, bool IsDefinition, Metadata *Variable,
765 bool IsLocalToUnit, bool IsDefinition, Metadata *Expr,
766766 Metadata *StaticDataMemberDeclaration)
767767 : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
768768 Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit),
769 IsDefinition(IsDefinition), Variable(Variable),
769 IsDefinition(IsDefinition), Expr(Expr),
770770 StaticDataMemberDeclaration(StaticDataMemberDeclaration) {}
771771 MDNodeKeyImpl(const DIGlobalVariable *N)
772772 : Scope(N->getRawScope()), Name(N->getRawName()),
773773 LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
774774 Line(N->getLine()), Type(N->getRawType()),
775775 IsLocalToUnit(N->isLocalToUnit()), IsDefinition(N->isDefinition()),
776 Variable(N->getRawVariable()),
776 Expr(N->getRawExpr()),
777777 StaticDataMemberDeclaration(N->getRawStaticDataMemberDeclaration()) {}
778778
779779 bool isKeyOf(const DIGlobalVariable *RHS) const {
782782 File == RHS->getRawFile() && Line == RHS->getLine() &&
783783 Type == RHS->getRawType() && IsLocalToUnit == RHS->isLocalToUnit() &&
784784 IsDefinition == RHS->isDefinition() &&
785 Variable == RHS->getRawVariable() &&
785 Expr == RHS->getRawExpr() &&
786786 StaticDataMemberDeclaration ==
787787 RHS->getRawStaticDataMemberDeclaration();
788788 }
789789 unsigned getHashValue() const {
790790 return hash_combine(Scope, Name, LinkageName, File, Line, Type,
791 IsLocalToUnit, IsDefinition, Variable,
791 IsLocalToUnit, IsDefinition, Expr,
792792 StaticDataMemberDeclaration);
793793 }
794794 };
14231423 *MDNode::get(getContext(), {NewOffsetMD, TypeId}));
14241424 continue;
14251425 }
1426 // If an offset adjustment was specified we need to modify the DIExpression
1427 // to prepend the adjustment:
1428 // !DIExpression(DW_OP_plus, Offset, [original expr])
1429 if (Offset != 0 && MD.first == LLVMContext::MD_dbg) {
1430 DIGlobalVariable *GV = cast(MD.second);
1431 DIExpression *E = GV->getExpr();
1432 ArrayRef OrigElements;
1433 if (E)
1434 OrigElements = E->getElements();
1435 std::vector Elements(OrigElements.size() + 2);
1436 Elements[0] = dwarf::DW_OP_plus;
1437 Elements[1] = Offset;
1438 std::copy(OrigElements.begin(), OrigElements.end(), Elements.begin() + 2);
1439 GV->replaceExpr(DIExpression::get(getContext(), Elements));
1440 }
14261441 addMetadata(MD.first, *MD.second);
14271442 }
14281443 }
14431458 DISubprogram *Function::getSubprogram() const {
14441459 return cast_or_null(getMetadata(LLVMContext::MD_dbg));
14451460 }
1461
1462 void GlobalVariable::addDebugInfo(DIGlobalVariable *GV) {
1463 addMetadata(LLVMContext::MD_dbg, *GV);
1464 }
1465
1466 void GlobalVariable::getDebugInfo(
1467 SmallVectorImpl &GVs) const {
1468 SmallVector MDs;
1469 getMetadata(LLVMContext::MD_dbg, MDs);
1470 for (MDNode *MD : MDs)
1471 GVs.push_back(cast(MD));
1472 }
11111111
11121112 AssertDI(N.getTag() == dwarf::DW_TAG_variable, "invalid tag", &N);
11131113 AssertDI(!N.getName().empty(), "missing global variable name", &N);
1114 if (auto *V = N.getRawVariable()) {
1115 AssertDI(isa(V) &&
1116 !isa(cast(V)->getValue()),
1117 "invalid global variable ref", &N, V);
1118 visitConstantExprsRecursively(cast(V)->getValue());
1119 }
1114 if (auto *V = N.getRawExpr())
1115 AssertDI(isa(V), "invalid expression location", &N, V);
11201116 if (auto *Member = N.getRawStaticDataMemberDeclaration()) {
11211117 AssertDI(isa(Member),
11221118 "invalid static data member declaration", &N, Member);
464464
465465 Error linkModuleFlagsMetadata();
466466
467 void linkGlobalInit(GlobalVariable &Dst, GlobalVariable &Src);
467 void linkGlobalVariable(GlobalVariable &Dst, GlobalVariable &Src);
468468 Error linkFunctionBody(Function &Dst, Function &Src);
469469 void linkAliasBody(GlobalAlias &Dst, GlobalAlias &Src);
470470 Error linkGlobalValueBody(GlobalValue &Dst, GlobalValue &Src);
941941
942942 /// Update the initializers in the Dest module now that all globals that may be
943943 /// referenced are in Dest.
944 void IRLinker::linkGlobalInit(GlobalVariable &Dst, GlobalVariable &Src) {
944 void IRLinker::linkGlobalVariable(GlobalVariable &Dst, GlobalVariable &Src) {
945 Dst.copyMetadata(&Src, 0);
946
945947 // Figure out what the initializer looks like in the dest module.
946948 Mapper.scheduleMapGlobalInitializer(Dst, *Src.getInitializer());
947949 }
984986 if (auto *F = dyn_cast(&Src))
985987 return linkFunctionBody(cast(Dst), *F);
986988 if (auto *GVar = dyn_cast(&Src)) {
987 linkGlobalInit(cast(Dst), *GVar);
989 linkGlobalVariable(cast(Dst), *GVar);
988990 return Error::success();
989991 }
990992 linkAliasBody(cast(Dst), cast(Src));
311311 // replace the current list of potentially dead global variables/functions
312312 // with the live list.
313313 SmallVector LiveGlobalVariables;
314 SmallVector LiveSubprograms;
315314 DenseSet VisitedSet;
316315
317 std::set LiveSPs;
318 for (Function &F : M) {
319 if (DISubprogram *SP = F.getSubprogram())
320 LiveSPs.insert(SP);
316 std::set LiveGVs;
317 for (GlobalVariable &GV : M.globals()) {
318 SmallVector DIs;
319 GV.getDebugInfo(DIs);
320 for (DIGlobalVariable *DI : DIs)
321 LiveGVs.insert(DI);
321322 }
322323
323324 for (DICompileUnit *DIC : F.compile_units()) {
328329 if (!VisitedSet.insert(DIG).second)
329330 continue;
330331
331 // If the global variable referenced by DIG is not null, the global
332 // variable is live.
333 if (DIG->getVariable())
332 // If a global variable references DIG, the global variable is live.
333 if (LiveGVs.count(DIG))
334334 LiveGlobalVariables.push_back(DIG);
335335 else
336336 GlobalVariableChange = true;
344344 }
345345
346346 // Reset lists for the next iteration.
347 LiveSubprograms.clear();
348347 LiveGlobalVariables.clear();
349348 }
350349
22
33 @foo = global i32 0
44
5 ; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
5 ; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !8, !9, !10}
66 !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
77
88 !0 = !DIFile(filename: "scope.h", directory: "/path/to/dir")
1111 !3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1212 !4 = distinct !{}
1313
14 ; CHECK: !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, variable: i32* @foo)
14 ; CHECK: !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false)
1515 !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0,
1616 file: !2, line: 7, type: !3, isLocal: true,
17 isDefinition: false, variable: i32* @foo)
17 isDefinition: false)
1818
19 ; CHECK: !6 = !DIGlobalVariable(name: "foo", scope: !0, isLocal: false, isDefinition: true)
20 !6 = !DIGlobalVariable(name: "foo", scope: !0)
19 ; CHECK: !6 = !DIGlobalVariable(name: "foo", scope: !0, isLocal: false, isDefinition: true, expr: !7)
20 ; CHECK: !7 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
21 !6 = !DIGlobalVariable(name: "foo", scope: !0, expr: !DIExpression(DW_OP_constu, 42, DW_OP_stack_value))
2122
2223 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 8, align: 8)
2324 !8 = !DIDerivedType(tag: DW_TAG_member, name: "mem", flags: DIFlagStaticMember, scope: !7, baseType: !3)
2425
25 ; CHECK: !9 = !DIGlobalVariable(name: "mem", scope: !0, isLocal: false, isDefinition: true, declaration: !8)
26 ; CHECK: !10 = !DIGlobalVariable(name: "mem", scope: !0, isLocal: false, isDefinition: true, declaration: !9)
2627 !9 = !DIGlobalVariable(name: "mem", scope: !0, declaration: !8)
0 ; RUN: llvm-dis -o - %s.bc | FileCheck %s
1
2 ; CHECK: !0 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, expr: !1)
3 ; CHECK: !1 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
4
5 !named = !{!0}
6
7 !0 = distinct !DIGlobalVariable(name: "a", variable: i32 42)
33 ; Establish a stable order.
44 !named = !{!0, !1, !2, !3, !4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16}
55
6 ; CHECK: !0 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
6 ; CHECK: @G1 = global i32 0, !dbg !0
7
8 ; CHECK: !0 = !DIGlobalVariable(name: "G",{{.*}} type: !1,
79 ; CHECK-NEXT: !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "T1"{{.*}}, identifier: "T1")
8 ; CHECK-NEXT: !2 = !DICompositeType(tag: DW_TAG_structure_type, name: "T2", scope: !1{{.*}}, baseType: !1, vtableHolder: !1, identifier: "T2")
9 ; CHECK-NEXT: !3 = !DIDerivedType(tag: DW_TAG_member, name: "M1", scope: !1{{.*}}, baseType: !2)
10 ; CHECK-NEXT: !4 = !DISubroutineType(types: !5)
11 ; CHECK-NEXT: !5 = !{!1, !2}
12 ; CHECK-NEXT: !6 = !DISubprogram(scope: !1,{{.*}} containingType: !1{{[,)]}}
13 ; CHECK-NEXT: !7 = !DILocalVariable(name: "V1", scope: !6, type: !2)
14 ; CHECK-NEXT: !8 = !DIObjCProperty(name: "P1", type: !1)
15 ; CHECK-NEXT: !9 = !DITemplateTypeParameter(type: !1)
16 ; CHECK-NEXT: !10 = !DIGlobalVariable(name: "G",{{.*}} type: !1,{{.*}} variable: i32* @G1)
10 ; CHECK-NEXT: !2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
11 ; CHECK-NEXT: !3 = !DICompositeType(tag: DW_TAG_structure_type, name: "T2", scope: !1{{.*}}, baseType: !1, vtableHolder: !1, identifier: "T2")
12 ; CHECK-NEXT: !4 = !DIDerivedType(tag: DW_TAG_member, name: "M1", scope: !1{{.*}}, baseType: !3)
13 ; CHECK-NEXT: !5 = !DISubroutineType(types: !6)
14 ; CHECK-NEXT: !6 = !{!1, !3}
15 ; CHECK-NEXT: !7 = !DISubprogram(scope: !1,{{.*}} containingType: !1{{[,)]}}
16 ; CHECK-NEXT: !8 = !DILocalVariable(name: "V1", scope: !7, type: !3)
17 ; CHECK-NEXT: !9 = !DIObjCProperty(name: "P1", type: !1)
18 ; CHECK-NEXT: !10 = !DITemplateTypeParameter(type: !1)
1719 ; CHECK-NEXT: !11 = !DITemplateValueParameter(type: !1, value: i32* @G1)
18 ; CHECK-NEXT: !12 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "T2", scope: !0, entity: !1)
19 ; CHECK-NEXT: !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "T3", file: !0, elements: !14, identifier: "T3")
20 ; CHECK-NEXT: !12 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "T2", scope: !2, entity: !1)
21 ; CHECK-NEXT: !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "T3", file: !2, elements: !14, identifier: "T3")
2022 ; CHECK-NEXT: !14 = !{!15}
2123 ; CHECK-NEXT: !15 = !DISubprogram(scope: !13,
2224 ; CHECK-NEXT: !16 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type,{{.*}} extraData: !13)
22 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
33 target triple = "thumbv7-apple-darwin3.0.0-iphoneos"
44
5 @length = common global i32 0, align 4 ; [#uses=1]
5 @length = common global i32 0, align 4, !dbg !14 ; [#uses=1]
66
77 define void @x0(i8* nocapture %buf, i32 %nbytes) nounwind optsize {
88 entry:
5959 !11 = distinct !DILexicalBlock(line: 5, column: 1, file: !26, scope: !1)
6060 !12 = !DILocalVariable(name: "c", line: 7, scope: !11, file: !2, type: !13)
6161 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
62 !14 = !DIGlobalVariable(name: "length", linkageName: "length", line: 1, isLocal: false, isDefinition: true, scope: !2, file: !2, type: !13, variable: i32* @length)
62 !14 = !DIGlobalVariable(name: "length", linkageName: "length", line: 1, isLocal: false, isDefinition: true, scope: !2, file: !2, type: !13)
6363 !15 = !DILocation(line: 4, column: 24, scope: !1)
6464 !16 = !DILocation(line: 4, column: 43, scope: !1)
6565 !17 = !DILocation(line: 9, column: 2, scope: !11)
22 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32"
33 target triple = "thumbv7-apple-darwin10"
44
5 @x1 = internal global i8 1, align 1
6 @x2 = internal global i8 1, align 1
7 @x3 = internal global i8 1, align 1
8 @x4 = internal global i8 1, align 1
9 @x5 = global i8 1, align 1
5 @x1 = internal global i8 1, align 1, !dbg !13
6 @x2 = internal global i8 1, align 1, !dbg !14
7 @x3 = internal global i8 1, align 1, !dbg !15
8 @x4 = internal global i8 1, align 1, !dbg !16
9 @x5 = global i8 1, align 1, !dbg !17
1010
1111 ; Check debug info output for merged global.
1212 ; DW_AT_location
2020 ; CHECK-NOT: DW_TAG
2121 ; CHECK: DW_AT_name {{.*}} "x1"
2222 ; CHECK-NOT: {{DW_TAG|NULL}}
23 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR:.. .. .. ..]] 10 00 22 )
23 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x5> 03 [[ADDR:.. .. .. ..]] )
2424 ; CHECK: DW_TAG_variable
2525 ; CHECK-NOT: DW_TAG
2626 ; CHECK: DW_AT_name {{.*}} "x2"
2727 ; CHECK-NOT: {{DW_TAG|NULL}}
28 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR]] 10 01 22 )
28 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x7> 03 [[ADDR]] 23 01 )
2929
3030 define zeroext i8 @get1(i8 zeroext %a) nounwind optsize !dbg !0 {
3131 entry:
9090 !10 = !DILocalVariable(name: "a", line: 4, arg: 1, scope: !0, file: !1, type: !5)
9191 !11 = !DILocalVariable(name: "b", line: 4, scope: !12, file: !1, type: !5)
9292 !12 = distinct !DILexicalBlock(line: 4, column: 0, file: !47, scope: !0)
93 !13 = !DIGlobalVariable(name: "x1", line: 3, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5, variable: i8* @x1)
94 !14 = !DIGlobalVariable(name: "x2", line: 6, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5, variable: i8* @x2)
95 !15 = !DIGlobalVariable(name: "x3", line: 9, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5, variable: i8* @x3)
96 !16 = !DIGlobalVariable(name: "x4", line: 12, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5, variable: i8* @x4)
97 !17 = !DIGlobalVariable(name: "x5", line: 15, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i8* @x5)
93 !13 = !DIGlobalVariable(name: "x1", line: 3, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5)
94 !14 = !DIGlobalVariable(name: "x2", line: 6, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5)
95 !15 = !DIGlobalVariable(name: "x3", line: 9, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5)
96 !16 = !DIGlobalVariable(name: "x4", line: 12, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5)
97 !17 = !DIGlobalVariable(name: "x5", line: 15, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5)
9898 !18 = !DILocalVariable(name: "a", line: 7, arg: 1, scope: !6, file: !1, type: !5)
9999 !19 = !DILocalVariable(name: "b", line: 7, scope: !20, file: !1, type: !5)
100100 !20 = distinct !DILexicalBlock(line: 7, column: 0, file: !47, scope: !6)
1111 ; CHECK-NOT: DW_TAG
1212 ; CHECK: DW_AT_name {{.*}} "x1"
1313 ; CHECK-NOT: {{DW_TAG|NULL}}
14 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR:.. .. .. ..]] 10 00 22 )
14 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x5> 03 [[ADDR:.. .. .. ..]] )
1515 ; CHECK: DW_TAG_variable
1616 ; CHECK-NOT: DW_TAG
1717 ; CHECK: DW_AT_name {{.*}} "x2"
1818 ; CHECK-NOT: {{DW_TAG|NULL}}
19 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR]] 10 04 22 )
19 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x7> 03 [[ADDR]] 23 04 )
2020
2121 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32"
2222 target triple = "thumbv7-apple-macosx10.7.0"
2323
24 @x1 = internal unnamed_addr global i32 1, align 4
25 @x2 = internal unnamed_addr global i32 2, align 4
24 @x1 = internal unnamed_addr global i32 1, align 4, !dbg !25
25 @x2 = internal unnamed_addr global i32 2, align 4, !dbg !26
2626 @x3 = internal unnamed_addr global i32 3, align 4
2727 @x4 = internal unnamed_addr global i32 4, align 4
2828 @x5 = global i32 0, align 4
9494 !19 = !DILocalVariable(name: "a", line: 14, arg: 1, scope: !8, file: !2, type: !5)
9595 !20 = !DILocalVariable(name: "b", line: 14, scope: !21, file: !2, type: !5)
9696 !21 = distinct !DILexicalBlock(line: 14, column: 19, file: !47, scope: !8)
97 !25 = !DIGlobalVariable(name: "x1", line: 4, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5, variable: i32* @x1)
98 !26 = !DIGlobalVariable(name: "x2", line: 7, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5, variable: i32* @x2)
97 !25 = !DIGlobalVariable(name: "x1", line: 4, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5)
98 !26 = !DIGlobalVariable(name: "x2", line: 7, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5)
9999 !27 = !DILocalVariable(name: "a", line: 17, arg: 1, scope: !9, file: !2, type: !5)
100100 !28 = !DILocalVariable(name: "b", line: 17, scope: !29, file: !2, type: !5)
101101 !29 = distinct !DILexicalBlock(line: 17, column: 19, file: !47, scope: !9)
88 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
99 target triple = "thumbv7-apple-ios3.0.0"
1010
11 @c = common global i32 0, align 4
12 @b = common global i32 0, align 4
13 @a = common global i64 0, align 8
14 @d = common global i32 0, align 4
11 @c = common global i32 0, align 4, !dbg !19
12 @b = common global i32 0, align 4, !dbg !18
13 @a = common global i64 0, align 8, !dbg !16
14 @d = common global i32 0, align 4, !dbg !20
1515
1616 ; Function Attrs: nounwind ssp
1717 define i32 @pr16110() #0 !dbg !4 {
9393 !13 = distinct !DILexicalBlock(line: 12, column: 0, file: !1, scope: !4)
9494 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !8)
9595 !15 = !{!16, !18, !19, !20}
96 !16 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !17, variable: i64* @a)
96 !16 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !17)
9797 !17 = !DIBasicType(tag: DW_TAG_base_type, name: "long long int", size: 64, align: 32, encoding: DW_ATE_signed)
98 !18 = !DIGlobalVariable(name: "b", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @b)
99 !19 = !DIGlobalVariable(name: "c", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @c)
100 !20 = !DIGlobalVariable(name: "d", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @d)
98 !18 = !DIGlobalVariable(name: "b", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8)
99 !19 = !DIGlobalVariable(name: "c", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8)
100 !20 = !DIGlobalVariable(name: "d", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8)
101101 !21 = !DILocation(line: 10, scope: !22)
102102 !22 = distinct !DILexicalBlock(line: 10, column: 0, file: !1, scope: !4)
103103 !26 = !DILocation(line: 12, scope: !13)
66
77 ; Generic space variables should be converted to global space AKA addrspace(1).
88 ; CHECK-DAG: @static_var = {{.*}}addrspace(1)
9 @static_var = externally_initialized global i8 0, align 1
9 @static_var = externally_initialized global i8 0, align 1, !dbg !4
1010 ; CHECK-DAG: @.str = {{.*}}addrspace(1)
1111 @.str = private unnamed_addr constant [4 x i8] c"XXX\00", align 1
1212
4242 ; Find list of global variables and make sure it's the one used by DICompileUnit
4343 ; CHECK: [[GLOBALSNODE]] = !{[[GVNODE:![0-9]+]]}
4444 !4 = distinct !DIGlobalVariable(name: "static_var", scope: !0, file: !1, line: 2, type: !5, isLocal: false,
45 isDefinition: true, variable: i8* @static_var)
45 isDefinition: true)
4646 ; Debug info must also be updated to reflect new address space.
4747 ; CHECK: [[GVNODE]] = distinct !DIGlobalVariable(name: "static_var"
4848 ; CHECK-SAME: scope: [[CUNODE]]
4949 ; CHECK-SAME: type: [[TYPENODE:![0-9]+]]
50 ; CHECK-SAME: variable: i8* addrspacecast (i8 addrspace(1)* @static_var to i8*)
5150 !5 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
5251 ; CHECK: [[TYPENODE]] = !DIBasicType(name: "char"
5352 !6 = !{i32 2, !"Dwarf Version", i32 4}
55 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
66 target triple = "powerpc64-unknown-linux-gnu"
77
8 @grid_points = external global [3 x i32], align 4
8 @grid_points = external global [3 x i32], align 4, !dbg !299
99
1010 ; Function Attrs: nounwind
1111 define fastcc void @compute_rhs() #0 !dbg !114 {
351351 !296 = !DILocalVariable(name: "j", line: 907, scope: !293, file: !5, type: !8)
352352 !297 = !DILocalVariable(name: "k", line: 907, scope: !293, file: !5, type: !8)
353353 !298 = !{!299, !304, !305, !309, !310, !311, !312, !313, !314, !315, !316, !317, !318, !319, !320, !321, !322, !323, !324, !325, !326, !327, !328, !329, !330, !331, !332, !333, !334, !335, !336, !337, !338, !339, !340, !341, !342, !343, !347, !350, !351, !352, !353, !354, !355, !356, !360, !361, !362, !363, !364, !365, !366, !367, !368, !369, !370, !371, !372, !373, !374, !375, !376, !377, !378, !379, !380, !381, !382, !383, !384, !385, !386, !387, !388, !389, !390, !391, !392, !393, !394, !395, !396, !397, !398, !399, !400, !401, !402, !403, !404, !405, !406, !407, !408, !409, !410, !411, !412, !413, !414, !415, !416, !417, !418, !419, !422, !426, !427, !430, !431, !434, !435, !436, !437}
354 !299 = !DIGlobalVariable(name: "grid_points", line: 28, isLocal: true, isDefinition: true, scope: null, file: !300, type: !302, variable: [3 x i32]* @grid_points)
354 !299 = !DIGlobalVariable(name: "grid_points", line: 28, isLocal: true, isDefinition: true, scope: null, file: !300, type: !302)
355355 !300 = !DIFile(filename: "./header.h", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
356356 !301 = !{!"./header.h", !"/home/hfinkel/src/NPB2.3-omp-C/BT"}
357357 !302 = !DICompositeType(tag: DW_TAG_array_type, size: 96, align: 32, baseType: !8, elements: !303)
22 ; Verify that we no longer crash in VSX swap removal when debug values
33 ; are in the code stream.
44
5 @php_intpow10.powers = external unnamed_addr constant [23 x double], align 8
5 @php_intpow10.powers = external unnamed_addr constant [23 x double], align 8, !dbg !24
66
77 ; Function Attrs: nounwind
88 define double @_php_math_round(double %value, i32 signext %places, i32 signext %mode) #0 !dbg !6 {
7878 !21 = !{!22}
7979 !22 = !DILocalVariable(name: "power", arg: 1, scope: !18, file: !1, line: 1, type: !9)
8080 !23 = !{!24}
81 !24 = !DIGlobalVariable(name: "powers", scope: !18, file: !1, line: 3, type: !25, isLocal: true, isDefinition: true, variable: [23 x double]* @php_intpow10.powers)
81 !24 = !DIGlobalVariable(name: "powers", scope: !18, file: !1, line: 3, type: !25, isLocal: true, isDefinition: true)
8282 !25 = !DICompositeType(tag: DW_TAG_array_type, baseType: !26, size: 1472, align: 64, elements: !27)
8383 !26 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4)
8484 !27 = !{!28}
0 ; RUN: llc < %s -mcpu=generic -mtriple=i386-apple-darwin -no-integrated-as
11
2 @g1 = global double 0.000000e+00, align 8
3 @g2 = global i32 0, align 4
2 @g1 = global double 0.000000e+00, align 8, !dbg !22
3 @g2 = global i32 0, align 4, !dbg !23
44
55 define void @_Z16fpuop_arithmeticjj(i32, i32) !dbg !4 {
66 entry:
6363 !19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
6464 !20 = !DILocalVariable(name: "value", line: 16, scope: !4, file: !6, type: !14)
6565 !21 = !{!22, !23}
66 !22 = !DIGlobalVariable(name: "g1", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14, variable: double* @g1)
67 !23 = !DIGlobalVariable(name: "g2", line: 6, isLocal: false, isDefinition: true, scope: null, file: !6, type: !19, variable: i32* @g2)
66 !22 = !DIGlobalVariable(name: "g1", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14)
67 !23 = !DIGlobalVariable(name: "g2", line: 6, isLocal: false, isDefinition: true, scope: null, file: !6, type: !19)
6868 !24 = !{i32 2, !"Dwarf Version", i32 2}
6969 !25 = !{i32 2, !"Debug Info Version", i32 3}
2121
2222 %class.C = type { i8 }
2323
24 @argc = global i8 0, align 1
24 @argc = global i8 0, align 1, !dbg !21
2525
2626 declare i32 @test_function(%class.C*, i8 signext, i8 signext, i8 signext, ...)
2727
8181 !18 = !DILocalVariable(name: "c", line: 7, scope: !13, file: !14, type: !4)
8282 !19 = !DILocalVariable(name: "lc", line: 8, scope: !13, file: !14, type: !11)
8383 !20 = !{!21}
84 !21 = !DIGlobalVariable(name: "argc", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !11, variable: i8* @argc)
84 !21 = !DIGlobalVariable(name: "argc", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !11)
8585 !22 = !{i32 2, !"Dwarf Version", i32 4}
8686 !23 = !{i32 2, !"Debug Info Version", i32 3}
8787 !25 = !DILocation(line: 8, column: 3, scope: !13)
22 target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
33 target triple = "aarch64_be--none-eabi"
44
5 @a = common global i32 0, align 4
5 @a = common global i32 0, align 4, !dbg !4
66
77 !llvm.dbg.cu = !{!0}
88 !llvm.module.flags = !{!8, !9}
1212 !1 = !DIFile(filename: "-", directory: "/work/validation")
1313 !2 = !{}
1414 !3 = !{!4}
15 !4 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !7, variable: i32* @a)
15 !4 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !7)
1616 !5 = !DIFile(filename: "", directory: "/work/validation")
1717 !6 = !{!"", !"/work/validation"}
1818 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4747
4848 %struct.bitfield = type <{ i8, [3 x i8], i64 }>
4949
50 @b = common global %struct.bitfield zeroinitializer, align 4
50 @b = common global %struct.bitfield zeroinitializer, align 4, !dbg !4
5151
5252 !llvm.dbg.cu = !{!0}
5353 !llvm.module.flags = !{!13, !14, !15}
5757 !1 = !DIFile(filename: "bitfields.c", directory: "/")
5858 !2 = !{}
5959 !3 = !{!4}
60 !4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true, variable: %struct.bitfield* @b)
60 !4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true)
6161 !5 = !DIFile(filename: "bitfields.c", directory: "/")
6262 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, align: 32, elements: !7)
6363 !7 = !{!8, !10, !11, !12}
3838 %struct.A = type { i8, i8*, i8 }
3939 %struct.B = type { i8 }
4040
41 @a = global i64 0, align 8
42 @b = global i32* null, align 8
41 @a = global i64 0, align 8, !dbg !41
42 @b = global i32* null, align 8, !dbg !42
4343
4444 define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 !dbg !25 {
4545 entry:
199199 !38 = !DILocalVariable(name: "c", line: 19, scope: !34, file: !26, type: !4)
200200 !39 = !DILocalVariable(name: "d", line: 20, scope: !34, file: !26, type: !14)
201201 !40 = !{!41, !42}
202 !41 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !26, type: !20, variable: i64* @a)
203 !42 = !DIGlobalVariable(name: "b", line: 7, isLocal: false, isDefinition: true, scope: null, file: !26, type: !12, variable: i32** @b)
202 !41 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !26, type: !20)
203 !42 = !DIGlobalVariable(name: "b", line: 7, isLocal: false, isDefinition: true, scope: null, file: !26, type: !12)
204204 !43 = !{i32 2, !"Dwarf Version", i32 2}
205205 !44 = !{i32 2, !"Debug Info Version", i32 3}
206206 !45 = !{!"clang version 3.7.0 "}
1111
1212 %struct.S = type { i24 }
1313
14 @s = common global %struct.S zeroinitializer, align 4
14 @s = common global %struct.S zeroinitializer, align 4, !dbg !4
1515
1616 !llvm.dbg.cu = !{!0}
1717 !llvm.module.flags = !{!12, !13, !14}
2121 !1 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm")
2222 !2 = !{}
2323 !3 = !{!4}
24 !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, variable: %struct.S* @s)
24 !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true)
2525 !5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 1, size: 32, align: 32, elements: !6)
2626 !6 = !{!7, !9, !10, !11}
2727 ; CHECK: DW_TAG_member
1919
2020 %struct.anon = type { i8, [5 x i8] }
2121
22 @a = common global %struct.anon zeroinitializer, align 1
22 @a = common global %struct.anon zeroinitializer, align 1, !dbg !4
2323
2424 !llvm.dbg.cu = !{!0}
2525 !llvm.module.flags = !{!11, !12, !13, !14, !15}
2929 !1 = !DIFile(filename: "test.i", directory: "/")
3030 !2 = !{}
3131 !3 = !{!4}
32 !4 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, variable: %struct.anon* @a)
32 !4 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true)
3333 !5 = !DICompositeType(tag: DW_TAG_structure_type, file: !1, line: 1, size: 48, align: 8, elements: !6)
3434 !6 = !{!7, !9}
3535 !7 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !1, line: 2, baseType: !8, size: 8, align: 8)
1414 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
1515 target triple = "armv7--linux-gnueabihf"
1616
17 @ch = common global i8 0, align 1
18 @b = common global i32 0, align 4
17 @ch = common global i8 0, align 1, !dbg !8
18 @b = common global i32 0, align 4, !dbg !10
1919
2020 ; Function Attrs: nounwind
2121 define void @proc() #0 !dbg !4 {
3838 !5 = !DISubroutineType(types: !6)
3939 !6 = !{null}
4040 !7 = !{!8, !10}
41 !8 = !DIGlobalVariable(name: "ch", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, variable: i8* @ch)
41 !8 = !DIGlobalVariable(name: "ch", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true)
4242 !9 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
43 !10 = !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 2, type: !11, isLocal: false, isDefinition: true, variable: i32* @b)
43 !10 = !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 2, type: !11, isLocal: false, isDefinition: true)
4444 !11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4545 !12 = !{i32 2, !"Dwarf Version", i32 4}
4646 !13 = !{i32 2, !"Debug Info Version", i32 3}
55 ; Generated with clang with source
66 ; __thread int x;
77
8 @x = thread_local global i32 0, align 4
8 @x = thread_local global i32 0, align 4, !dbg !4
99
1010 !llvm.dbg.cu = !{!0}
1111 !llvm.module.flags = !{!7, !8}
2525 !1 = !DIFile(filename: "tls.c", directory: "/tmp")
2626 !2 = !{}
2727 !3 = !{!4}
28 !4 = !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: i32* @x)
28 !4 = !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
2929 !5 = !DIFile(filename: "tls.c", directory: "/tmp")
3030 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3131 !7 = !{i32 2, !"Dwarf Version", i32 4}
3535 %struct.S = type { i32, %struct.anon }
3636 %struct.anon = type { i32 }
3737
38 @s = common global %struct.S zeroinitializer, align 4
38 @s = common global %struct.S zeroinitializer, align 4, !dbg !4
3939
4040 !llvm.dbg.cu = !{!0}
4141 !llvm.module.flags = !{!14, !15}
4545 !1 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
4646 !2 = !{}
4747 !3 = !{!4}
48 !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !5, line: 5, type: !6, isLocal: false, isDefinition: true, variable: %struct.S* @s)
48 !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !5, line: 5, type: !6, isLocal: false, isDefinition: true)
4949 !5 = !DIFile(filename: "", directory: "/usr/local/google/home/majnemer/llvm/src")
5050 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !5, line: 2, size: 64, align: 32, elements: !7)
5151 !7 = !{!8, !10}
5656 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
5757 target triple = "x86_64-pc-windows-msvc19.0.23918"
5858
59 @"\01?x@@3W4BigThing@@A" = global i32 0, align 4
59 @"\01?x@@3W4BigThing@@A" = global i32 0, align 4, !dbg !5703
6060
6161 !llvm.dbg.cu = !{!0}
6262 !llvm.module.flags = !{!5704, !5705, !5706}
57655765 !5700 = !DIEnumerator(name: "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE5695", value: 5694)
57665766 !5701 = !DIEnumerator(name: "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE5696", value: 5695)
57675767 !5702 = !{!5703}
5768 !5703 = distinct !DIGlobalVariable(name: "x", linkageName: "\01?x@@3W4BigThing@@A", scope: !0, file: !1, line: 5698, type: !3, isLocal: false, isDefinition: true, variable: i32* @"\01?x@@3W4BigThing@@A")
5768 !5703 = distinct !DIGlobalVariable(name: "x", linkageName: "\01?x@@3W4BigThing@@A", scope: !0, file: !1, line: 5698, type: !3, isLocal: false, isDefinition: true)
57695769 !5704 = !{i32 2, !"CodeView", i32 1}
57705770 !5705 = !{i32 2, !"Debug Info Version", i32 3}
57715771 !5706 = !{i32 1, !"PIC Level", i32 2}
180180 %struct.anon = type <{ i8, i16 }>
181181 %struct.S2 = type { i32 }
182182
183 @s0 = common global %struct.S0 zeroinitializer, align 1
184 @s1 = common global %struct.S1 zeroinitializer, align 1
185 @s2 = common global %struct.S2 zeroinitializer, align 1
183 @s0 = common global %struct.S0 zeroinitializer, align 1, !dbg !4
184 @s1 = common global %struct.S1 zeroinitializer, align 1, !dbg !10
185 @s2 = common global %struct.S2 zeroinitializer, align 1, !dbg !29
186186
187187 !llvm.dbg.cu = !{!0}
188188 !llvm.module.flags = !{!33, !34, !35}
192192 !1 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
193193 !2 = !{}
194194 !3 = !{!4, !10, !29}
195 !4 = distinct !DIGlobalVariable(name: "s0", scope: !0, file: !5, line: 7, type: !6, isLocal: false, isDefinition: true, variable: %struct.S0* @s0)
195 !4 = distinct !DIGlobalVariable(name: "s0", scope: !0, file: !5, line: 7, type: !6, isLocal: false, isDefinition: true)
196196 !5 = !DIFile(filename: "", directory: "/usr/local/google/home/majnemer/llvm/src")
197197 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !5, line: 3, size: 24, align: 8, elements: !7)
198198 !7 = !{!8}
199199 !8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !5, line: 6, baseType: !9, size: 8, align: 16, offset: 16, flags: DIFlagBitField, extraData: i64 8)
200200 !9 = !DIBasicType(name: "short", size: 16, align: 16, encoding: DW_ATE_signed)
201 !10 = distinct !DIGlobalVariable(name: "s1", scope: !0, file: !5, line: 18, type: !11, isLocal: false, isDefinition: true, variable: %struct.S1* @s1)
201 !10 = distinct !DIGlobalVariable(name: "s1", scope: !0, file: !5, line: 18, type: !11, isLocal: false, isDefinition: true)
202202 !11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S1", file: !5, line: 10, size: 128, align: 8, elements: !12)
203203 !12 = !{!13, !18, !19, !21, !22, !23, !28}
204204 !13 = !DIDerivedType(tag: DW_TAG_member, name: "x1", scope: !11, file: !5, line: 11, baseType: !14, size: 16, align: 8)
217217 !26 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !24, file: !5, line: 16, baseType: !15, size: 8, align: 8)
218218 !27 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !24, file: !5, line: 16, baseType: !9, size: 16, align: 16, offset: 8)
219219 !28 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !11, file: !5, line: 17, baseType: !9, size: 3, align: 16, offset: 112, flags: DIFlagBitField, extraData: i64 112)
220 !29 = distinct !DIGlobalVariable(name: "s2", scope: !0, file: !5, line: 24, type: !30, isLocal: false, isDefinition: true, variable: %struct.S2* @s2)
220 !29 = distinct !DIGlobalVariable(name: "s2", scope: !0, file: !5, line: 24, type: !30, isLocal: false, isDefinition: true)
221221 !30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S2", file: !5, line: 21, size: 32, align: 8, elements: !31)
222222 !31 = !{!32}
223223 !32 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !30, file: !5, line: 23, baseType: !20, size: 1, align: 32, flags: DIFlagBitField, extraData: i64 0)
2626 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
2727 target triple = "i686-pc-windows-msvc18.0.0"
2828
29 @"\01?e@@3W4E@@A" = global i32 0, align 4
29 @"\01?e@@3W4E@@A" = global i32 0, align 4, !dbg !9
3030
3131 !llvm.dbg.cu = !{!0}
3232 !llvm.module.flags = !{!10, !11}
4141 !6 = !{!7}
4242 !7 = !DIEnumerator(name: "BLAH", value: 0)
4343 !8 = !{!9}
44 !9 = distinct !DIGlobalVariable(name: "e", linkageName: "\01?e@@3W4E@@A", scope: !0, file: !4, line: 2, type: !3, isLocal: false, isDefinition: true, variable: i32* @"\01?e@@3W4E@@A")
44 !9 = distinct !DIGlobalVariable(name: "e", linkageName: "\01?e@@3W4E@@A", scope: !0, file: !4, line: 2, type: !3, isLocal: false, isDefinition: true)
4545 !10 = !{i32 2, !"CodeView", i32 1}
4646 !11 = !{i32 2, !"Debug Info Version", i32 3}
4747 !12 = !{!"clang version 3.9.0 (trunk 272790) (llvm/trunk 272813)"}
44 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
55 target triple = "i686-pc-windows-msvc"
66
7 @"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4
7 @"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4, !dbg !4
88
99 !llvm.dbg.cu = !{!0}
1010 !llvm.module.flags = !{!13, !14}
1414 !1 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/", directory: "/usr/local/google/home/majnemer/llvm/src")
1515 !2 = !{}
1616 !3 = !{!4}
17 !4 = distinct !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, variable: i32* @"\01?id@?$numpunct@D@@0HA", declaration: !7)
17 !4 = distinct !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, declaration: !7)
1818 !5 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/t.ii", directory: "/usr/local/google/home/majnemer/llvm/src")
1919 !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
2020 !7 = !DIDerivedType(tag: DW_TAG_member, name: "id", scope: !8, file: !5, line: 2, baseType: !6, flags: DIFlagStaticMember)
1414 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
1515 target triple = "x86_64-pc-windows-msvc19.0.0"
1616
17 @x = global i32 42
17 @x = global i32 42, !dbg !6
1818
1919 !llvm.dbg.cu = !{!0}
2020 !llvm.module.flags = !{!35, !36, !37}
2626 !3 = !{!4, !6}
2727 !4 = distinct !DIGlobalVariable(name: "_OptionsStorage", scope: !0, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true)
2828 !5 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
29 !6 = distinct !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 4, type: !5, isLocal: true, isDefinition: true, variable: i32* @x)
29 !6 = distinct !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 4, type: !5, isLocal: true, isDefinition: true)
3030
3131 !35 = !{i32 2, !"CodeView", i32 1}
3232 !36 = !{i32 2, !"Debug Info Version", i32 3}
116116
117117 $"\01?comdat@?$A@X@@2HB" = comdat any
118118
119 @"\01?first@@3HA" = internal global i32 0, align 4
120 @"\01?comdat@?$A@X@@2HB" = linkonce_odr constant i32 3, comdat, align 4
121 @"\01?middle@@3PEBHEB" = thread_local global i32* @"\01?comdat@?$A@X@@2HB", align 8
122 @"\01?last@@3HA" = global i32 0, align 4
119 @"\01?first@@3HA" = internal global i32 0, align 4, !dbg !4
120 @"\01?comdat@?$A@X@@2HB" = linkonce_odr constant i32 3, comdat, align 4, !dbg !6
121 @"\01?middle@@3PEBHEB" = thread_local global i32* @"\01?comdat@?$A@X@@2HB", align 8, !dbg !13
122 @"\01?last@@3HA" = global i32 0, align 4, !dbg !15
123123
124124 !llvm.dbg.cu = !{!0}
125125 !llvm.module.flags = !{!16, !17, !18}
129129 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
130130 !2 = !{}
131131 !3 = !{!4, !6, !13, !15}
132 !4 = distinct !DIGlobalVariable(name: "first", linkageName: "\01?first@@3HA", scope: !0, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true, variable: i32* @"\01?first@@3HA")
132 !4 = distinct !DIGlobalVariable(name: "first", linkageName: "\01?first@@3HA", scope: !0, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true)
133133 !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
134 !6 = distinct !DIGlobalVariable(name: "comdat", linkageName: "\01?comdat@?$A@X@@2HB", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @"\01?comdat@?$A@X@@2HB", declaration: !8)
134 !6 = distinct !DIGlobalVariable(name: "comdat", linkageName: "\01?comdat@?$A@X@@2HB", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, declaration: !8)
135135 !7 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5)
136136 !8 = !DIDerivedType(tag: DW_TAG_member, name: "comdat", scope: !9, file: !1, line: 2, baseType: !7, flags: DIFlagStaticMember, extraData: i32 3)
137137 !9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 2, size: 8, align: 8, elements: !10, templateParams: !11)
138138 !10 = !{!8}
139139 !11 = !{!12}
140140 !12 = !DITemplateTypeParameter(name: "T", type: null)
141 !13 = distinct !DIGlobalVariable(name: "middle", linkageName: "\01?middle@@3PEBHEB", scope: !0, file: !1, line: 3, type: !14, isLocal: false, isDefinition: true, variable: i32** @"\01?middle@@3PEBHEB")
141 !13 = distinct !DIGlobalVariable(name: "middle", linkageName: "\01?middle@@3PEBHEB", scope: !0, file: !1, line: 3, type: !14, isLocal: false, isDefinition: true)
142142 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
143 !15 = distinct !DIGlobalVariable(name: "last", linkageName: "\01?last@@3HA", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, variable: i32* @"\01?last@@3HA")
143 !15 = distinct !DIGlobalVariable(name: "last", linkageName: "\01?last@@3HA", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true)
144144 !16 = !{i32 2, !"CodeView", i32 1}
145145 !17 = !{i32 2, !"Debug Info Version", i32 3}
146146 !18 = !{i32 1, !"PIC Level", i32 2}
8282
8383 $"\01??_8C@@7B@" = comdat any
8484
85 @"\01?d@@3UD@@A" = global %struct.D zeroinitializer, align 8
85 @"\01?d@@3UD@@A" = global %struct.D zeroinitializer, align 8, !dbg !4
8686 @"\01??_8D@@7BB@@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 40], comdat
8787 @"\01??_8D@@7BC@@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 24], comdat
8888 @"\01??_7D@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void (%struct.D*)* @"\01?f@D@@UEAAXXZ" to i8*)], comdat
229229 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
230230 !2 = !{}
231231 !3 = !{!4}
232 !4 = distinct !DIGlobalVariable(name: "d", linkageName: "\01?d@@3UD@@A", scope: !0, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true, variable: %struct.D* @"\01?d@@3UD@@A")
232 !4 = distinct !DIGlobalVariable(name: "d", linkageName: "\01?d@@3UD@@A", scope: !0, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true)
233233 !5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !1, line: 4, size: 448, align: 64, elements: !6, vtableHolder: !5, identifier: ".?AUD@@")
234234 !6 = !{!7, !21, !27, !28, !29}
235235 !7 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !5, baseType: !8, offset: 64)
4343 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
4444 target triple = "x86_64-pc-windows-msvc18.0.0"
4545
46 @x = common global i32 0, align 4
46 @x = common global i32 0, align 4, !dbg !9
4747
4848 ; Function Attrs: norecurse nounwind uwtable
4949 define void @f() #0 !dbg !4 {
8383 !6 = !{null}
8484 !7 = distinct !DISubprogram(name: "file_change", scope: !1, file: !1, line: 2, type: !5, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
8585 !8 = !{!9}
86 !9 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !10, isLocal: false, isDefinition: true, variable: i32* @x)
86 !9 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !10, isLocal: false, isDefinition: true)
8787 !10 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !11)
8888 !11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
8989 !12 = !{i32 2, !"CodeView", i32 1}
105105 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
106106 target triple = "x86_64-pc-windows-msvc19.0.24210"
107107
108 @"\01?x@@3HC" = global i32 0, align 4
108 @"\01?x@@3HC" = global i32 0, align 4, !dbg !4
109109
110110 ; Function Attrs: norecurse nounwind uwtable
111111 define i32 @main() local_unnamed_addr #0 !dbg !11 {
139139 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
140140 !2 = !{}
141141 !3 = !{!4}
142 !4 = distinct !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @"\01?x@@3HC")
142 !4 = distinct !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true)
143143 !5 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !6)
144144 !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
145145 !7 = !{i32 2, !"CodeView", i32 1}
4040 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
4141 target triple = "x86_64-pc-windows-msvc18.0.0"
4242
43 @"\01?x@@3HC" = global i32 0, align 4
43 @"\01?x@@3HC" = global i32 0, align 4, !dbg !14
4444
4545 ; Function Attrs: norecurse nounwind uwtable
4646 define i32 @main() #0 !dbg !4 {
7070 !11 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXXZ", scope: !1, file: !1, line: 6, type: !9, isLocal: true, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
7171 !12 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 2, type: !9, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
7272 !13 = !{!14}
73 !14 = !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !0, file: !1, line: 1, type: !15, isLocal: false, isDefinition: true, variable: i32* @"\01?x@@3HC")
73 !14 = !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !0, file: !1, line: 1, type: !15, isLocal: false, isDefinition: true)
7474 !15 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
7575 !16 = !{i32 2, !"CodeView", i32 1}
7676 !17 = !{i32 2, !"Debug Info Version", i32 3}
191191 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
192192 target triple = "x86_64-pc-windows-msvc18.0.0"
193193
194 @x = internal global i32 0, align 4
194 @x = internal global i32 0, align 4, !dbg !23
195195
196196 ; Function Attrs: nounwind uwtable
197197 define void @f(i32 %p) #0 !dbg !4 {
260260 !20 = !DILocalVariable(name: "a", arg: 1, scope: !16, file: !1, line: 4, type: !7)
261261 !21 = !DILocalVariable(name: "b", scope: !16, file: !1, line: 5, type: !7)
262262 !22 = !{!23}
263 !23 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !24, isLocal: false, isDefinition: true, variable: i32* @x)
263 !23 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !24, isLocal: false, isDefinition: true)
264264 !24 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
265265 !25 = !{i32 2, !"CodeView", i32 1}
266266 !26 = !{i32 2, !"Debug Info Version", i32 3}
7878 %"struct.foo::bar::GlobalRecord" = type { i32 }
7979 %struct.LocalRecord = type { i32 }
8080
81 @"\01?g@bar@foo@@3UGlobalRecord@12@A" = global %"struct.foo::bar::GlobalRecord" zeroinitializer, align 4
81 @"\01?g@bar@foo@@3UGlobalRecord@12@A" = global %"struct.foo::bar::GlobalRecord" zeroinitializer, align 4, !dbg !4
8282
8383 ; Function Attrs: nounwind uwtable
8484 define void @"\01?baz@bar@foo@@YAXXZ"() #0 !dbg !19 {
112112 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
113113 !2 = !{}
114114 !3 = !{!4}
115 !4 = distinct !DIGlobalVariable(name: "g", linkageName: "\01?g@bar@foo@@3UGlobalRecord@12@A", scope: !5, file: !1, line: 12, type: !7, isLocal: false, isDefinition: true, variable: %"struct.foo::bar::GlobalRecord"* @"\01?g@bar@foo@@3UGlobalRecord@12@A")
115 !4 = distinct !DIGlobalVariable(name: "g", linkageName: "\01?g@bar@foo@@3UGlobalRecord@12@A", scope: !5, file: !1, line: 12, type: !7, isLocal: false, isDefinition: true)
116116 !5 = !DINamespace(name: "bar", scope: !6, file: !1, line: 2)
117117 !6 = !DINamespace(name: "foo", scope: null, file: !1, line: 1)
118118 !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GlobalRecord", scope: !5, file: !1, line: 9, size: 32, align: 32, elements: !8, identifier: ".?AUGlobalRecord@bar@foo@@")
126126
127127 %struct.incomplete_struct = type { i32 }
128128
129 @"\01?multi_dim_arr@@3PAY146DA" = global [2 x [5 x [7 x i8]]] zeroinitializer, align 1
130 @"\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A" = global [3 x i8]* null, align 4
131 @"\01?incomplete_struct_arr@@3PAUincomplete_struct@@A" = global [3 x %struct.incomplete_struct] zeroinitializer, align 4
132 @"\01?typedef_arr@@3SDHD" = constant [4 x i32] zeroinitializer, align 4
129 @"\01?multi_dim_arr@@3PAY146DA" = global [2 x [5 x [7 x i8]]] zeroinitializer, align 1, !dbg !4
130 @"\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A" = global [3 x i8]* null, align 4, !dbg !11
131 @"\01?incomplete_struct_arr@@3PAUincomplete_struct@@A" = global [3 x %struct.incomplete_struct] zeroinitializer, align 4, !dbg !20
132 @"\01?typedef_arr@@3SDHD" = constant [4 x i32] zeroinitializer, align 4, !dbg !21
133133
134134 ; Function Attrs: nounwind
135135 define void @"\01?foo@@YAXH@Z"(i32 %x) #0 !dbg !31 {
171171 !1 = !DIFile(filename: "t.cpp", directory: "/")
172172 !2 = !{}
173173 !3 = !{!4, !11, !20, !21}
174 !4 = distinct !DIGlobalVariable(name: "multi_dim_arr", linkageName: "\01?multi_dim_arr@@3PAY146DA", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: [2 x [5 x [7 x i8]]]* @"\01?multi_dim_arr@@3PAY146DA")
174 !4 = distinct !DIGlobalVariable(name: "multi_dim_arr", linkageName: "\01?multi_dim_arr@@3PAY146DA", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true)
175175 !5 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 560, align: 8, elements: !7)
176176 !6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
177177 !7 = !{!8, !9, !10}
178178 !8 = !DISubrange(count: 2)
179179 !9 = !DISubrange(count: 5)
180180 !10 = !DISubrange(count: 7)
181 !11 = distinct !DIGlobalVariable(name: "p_incomplete_struct_arr", linkageName: "\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A", scope: !0, file: !1, line: 3, type: !12, isLocal: false, isDefinition: true, variable: [3 x i8]** @"\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A")
181 !11 = distinct !DIGlobalVariable(name: "p_incomplete_struct_arr", linkageName: "\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A", scope: !0, file: !1, line: 3, type: !12, isLocal: false, isDefinition: true)
182182 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 32, align: 32)
183183 !13 = !DICompositeType(tag: DW_TAG_array_type, baseType: !14, elements: !18)
184184 !14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "incomplete_struct", file: !1, line: 4, size: 32, align: 32, elements: !15, identifier: ".?AUincomplete_struct@@")
187187 !17 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
188188 !18 = !{!19}
189189 !19 = !DISubrange(count: 3)
190 !20 = distinct !DIGlobalVariable(name: "incomplete_struct_arr", linkageName: "\01?incomplete_struct_arr@@3PAUincomplete_struct@@A", scope: !0, file: !1, line: 6, type: !13, isLocal: false, isDefinition: true, variable: [3 x %struct.incomplete_struct]* @"\01?incomplete_struct_arr@@3PAUincomplete_struct@@A")
191 !21 = distinct !DIGlobalVariable(name: "typedef_arr", linkageName: "\01?typedef_arr@@3SDHD", scope: !0, file: !1, line: 14, type: !22, isLocal: false, isDefinition: true, variable: [4 x i32]* @"\01?typedef_arr@@3SDHD")
190 !20 = distinct !DIGlobalVariable(name: "incomplete_struct_arr", linkageName: "\01?incomplete_struct_arr@@3PAUincomplete_struct@@A", scope: !0, file: !1, line: 6, type: !13, isLocal: false, isDefinition: true)
191 !21 = distinct !DIGlobalVariable(name: "typedef_arr", linkageName: "\01?typedef_arr@@3SDHD", scope: !0, file: !1, line: 14, type: !22, isLocal: false, isDefinition: true)
192192 !22 = !DICompositeType(tag: DW_TAG_array_type, baseType: !23, size: 128, align: 32, elements: !26)
193193 !23 = !DIDerivedType(tag: DW_TAG_typedef, name: "T_INT", file: !1, line: 13, baseType: !24)
194194 !24 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !25)
7878
7979 %struct.A = type { i8 }
8080
81 @"\01?a@@3UA@@A" = global %struct.A zeroinitializer, align 1
81 @"\01?a@@3UA@@A" = global %struct.A zeroinitializer, align 1, !dbg !4
8282
8383 !llvm.dbg.cu = !{!0}
8484 !llvm.module.flags = !{!8, !9}
8888 !1 = !DIFile(filename: "hello.cpp", directory: "D:\5Csrc\5Chello")
8989 !2 = !{}
9090 !3 = !{!4}
91 !4 = distinct !DIGlobalVariable(name: "a", linkageName: "\01?a@@3UA@@A", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, variable: %struct.A* @"\01?a@@3UA@@A")
91 !4 = distinct !DIGlobalVariable(name: "a", linkageName: "\01?a@@3UA@@A", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true)
9292 !5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !6, identifier: ".?AUA@@")
9393 !6 = !{!7}
9494 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", scope: !5, file: !1, line: 2, size: 8, align: 8, flags: DIFlagFwdDecl, identifier: ".?AUNested@A@@")
183183 %0 = type opaque
184184 %1 = type opaque
185185
186 @"\01?pmd_a@@3PEQA@@HEQ1@" = global i32 -1, align 8
187 @"\01?pmd_b@@3PEQC@@HEQ1@" = global i32 -1, align 8
188 @"\01?pmd_c@@3PEQD@@HEQ1@" = global { i32, i32 } { i32 0, i32 -1 }, align 8
189 @"\01?pmd_d@@3PEQE@@HEQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 8
190 @"\01?pmf_a@@3P8A@@EAAXXZEQ1@" = global i8* null, align 8
191 @"\01?pmf_b@@3P8C@@EAAXXZEQ1@" = global { i8*, i32 } zeroinitializer, align 8
192 @"\01?pmf_c@@3P8D@@EAAXXZEQ1@" = global { i8*, i32, i32 } zeroinitializer, align 8
193 @"\01?pmf_d@@3P8E@@EAAXXZEQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 8
194 @"\01?ppmd@@3PEAPEQIncomplete@@HEA" = global %0* null, align 8
195 @"\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA" = global %1* null, align 8
186 @"\01?pmd_a@@3PEQA@@HEQ1@" = global i32 -1, align 8, !dbg !4
187 @"\01?pmd_b@@3PEQC@@HEQ1@" = global i32 -1, align 8, !dbg !10
188 @"\01?pmd_c@@3PEQD@@HEQ1@" = global { i32, i32 } { i32 0, i32 -1 }, align 8, !dbg !20
189 @"\01?pmd_d@@3PEQE@@HEQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 8, !dbg !23
190 @"\01?pmf_a@@3P8A@@EAAXXZEQ1@" = global i8* null, align 8, !dbg !26
191 @"\01?pmf_b@@3P8C@@EAAXXZEQ1@" = global { i8*, i32 } zeroinitializer, align 8, !dbg !31
192 @"\01?pmf_c@@3P8D@@EAAXXZEQ1@" = global { i8*, i32, i32 } zeroinitializer, align 8, !dbg !36
193 @"\01?pmf_d@@3P8E@@EAAXXZEQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 8, !dbg !41
194 @"\01?ppmd@@3PEAPEQIncomplete@@HEA" = global %0* null, align 8, !dbg !46
195 @"\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA" = global %1* null, align 8, !dbg !50
196196
197197 !llvm.dbg.cu = !{!0}
198198 !llvm.module.flags = !{!56, !57, !58}
202202 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
203203 !2 = !{}
204204 !3 = !{!4, !10, !20, !23, !26, !31, !36, !41, !46, !50}
205 !4 = distinct !DIGlobalVariable(name: "pmd_a", linkageName: "\01?pmd_a@@3PEQA@@HEQ1@", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, variable: i32* @"\01?pmd_a@@3PEQA@@HEQ1@")
205 !4 = distinct !DIGlobalVariable(name: "pmd_a", linkageName: "\01?pmd_a@@3PEQA@@HEQ1@", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true)
206206 !5 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 32, flags: DIFlagSingleInheritance, extraData: !7)
207207 !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
208208 !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 32, align: 32, elements: !8, identifier: ".?AUA@@")
209209 !8 = !{!9}
210210 !9 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !7, file: !1, line: 1, baseType: !6, size: 32, align: 32)
211 !10 = distinct !DIGlobalVariable(name: "pmd_b", linkageName: "\01?pmd_b@@3PEQC@@HEQ1@", scope: !0, file: !1, line: 7, type: !11, isLocal: false, isDefinition: true, variable: i32* @"\01?pmd_b@@3PEQC@@HEQ1@")
211 !10 = distinct !DIGlobalVariable(name: "pmd_b", linkageName: "\01?pmd_b@@3PEQC@@HEQ1@", scope: !0, file: !1, line: 7, type: !11, isLocal: false, isDefinition: true)
212212 !11 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 32, flags: DIFlagMultipleInheritance, extraData: !12)
213213 !12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !1, line: 3, size: 96, align: 32, elements: !13, identifier: ".?AUC@@")
214214 !13 = !{!14, !15, !19}
218218 !17 = !{!18}
219219 !18 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !16, file: !1, line: 2, baseType: !6, size: 32, align: 32)
220220 !19 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !12, file: !1, line: 3, baseType: !6, size: 32, align: 32, offset: 64)
221 !20 = distinct !DIGlobalVariable(name: "pmd_c", linkageName: "\01?pmd_c@@3PEQD@@HEQ1@", scope: !0, file: !1, line: 8, type: !21, isLocal: false, isDefinition: true, variable: { i32, i32 }* @"\01?pmd_c@@3PEQD@@HEQ1@")
221 !20 = distinct !DIGlobalVariable(name: "pmd_c", linkageName: "\01?pmd_c@@3PEQD@@HEQ1@", scope: !0, file: !1, line: 8, type: !21, isLocal: false, isDefinition: true)
222222 !21 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 64, flags: DIFlagVirtualInheritance, extraData: !22)
223223 !22 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !1, line: 4, size: 256, align: 64, flags: DIFlagFwdDecl, identifier: ".?AUD@@")
224 !23 = distinct !DIGlobalVariable(name: "pmd_d", linkageName: "\01?pmd_d@@3PEQE@@HEQ1@", scope: !0, file: !1, line: 9, type: !24, isLocal: false, isDefinition: true, variable: { i32, i32, i32 }* @"\01?pmd_d@@3PEQE@@HEQ1@")
224 !23 = distinct !DIGlobalVariable(name: "pmd_d", linkageName: "\01?pmd_d@@3PEQE@@HEQ1@", scope: !0, file: !1, line: 9, type: !24, isLocal: false, isDefinition: true)
225225 !24 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 96, extraData: !25)
226226 !25 = !DICompositeType(tag: DW_TAG_structure_type, name: "E", file: !1, line: 5, flags: DIFlagFwdDecl, identifier: ".?AUE@@")
227 !26 = distinct !DIGlobalVariable(name: "pmf_a", linkageName: "\01?pmf_a@@3P8A@@EAAXXZEQ1@", scope: !0, file: !1, line: 10, type: !27, isLocal: false, isDefinition: true, variable: i8** @"\01?pmf_a@@3P8A@@EAAXXZEQ1@")
227 !26 = distinct !DIGlobalVariable(name: "pmf_a", linkageName: "\01?pmf_a@@3P8A@@EAAXXZEQ1@", scope: !0, file: !1, line: 10, type: !27, isLocal: false, isDefinition: true)
228228 !27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, size: 64, flags: DIFlagSingleInheritance, extraData: !7)
229229 !28 = !DISubroutineType(types: !29)
230230 !29 = !{null, !30}
231231 !30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
232 !31 = distinct !DIGlobalVariable(name: "pmf_b", linkageName: "\01?pmf_b@@3P8C@@EAAXXZEQ1@", scope: !0, file: !1, line: 11, type: !32, isLocal: false, isDefinition: true, variable: { i8*, i32 }* @"\01?pmf_b@@3P8C@@EAAXXZEQ1@")
232 !31 = distinct !DIGlobalVariable(name: "pmf_b", linkageName: "\01?pmf_b@@3P8C@@EAAXXZEQ1@", scope: !0, file: !1, line: 11, type: !32, isLocal: false, isDefinition: true)
233233 !32 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !33, size: 128, flags: DIFlagMultipleInheritance, extraData: !12)
234234 !33 = !DISubroutineType(types: !34)
235235 !34 = !{null, !35}
236236 !35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
237 !36 = distinct !DIGlobalVariable(name: "pmf_c", linkageName: "\01?pmf_c@@3P8D@@EAAXXZEQ1@", scope: !0, file: !1, line: 12, type: !37, isLocal: false, isDefinition: true, variable: { i8*, i32, i32 }* @"\01?pmf_c@@3P8D@@EAAXXZEQ1@")
237 !36 = distinct !DIGlobalVariable(name: "pmf_c", linkageName: "\01?pmf_c@@3P8D@@EAAXXZEQ1@", scope: !0, file: !1, line: 12, type: !37, isLocal: false, isDefinition: true)
238238 !37 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !38, size: 128, flags: DIFlagVirtualInheritance, extraData: !22)
239239 !38 = !DISubroutineType(types: !39)
240240 !39 = !{null, !40}
241241 !40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !22, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
242 !41 = distinct !DIGlobalVariable(name: "pmf_d", linkageName: "\01?pmf_d@@3P8E@@EAAXXZEQ1@", scope: !0, file: !1, line: 13, type: !42, isLocal: false, isDefinition: true, variable: { i8*, i32, i32, i32 }* @"\01?pmf_d@@3P8E@@EAAXXZEQ1@")
242 !41 = distinct !DIGlobalVariable(name: "pmf_d", linkageName: "\01?pmf_d@@3P8E@@EAAXXZEQ1@", scope: !0, file: !1, line: 13, type: !42, isLocal: false, isDefinition: true)
243243 !42 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !43, size: 192, extraData: !25)
244244 !43 = !DISubroutineType(types: !44)
245245 !44 = !{null, !45}
246246 !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !25, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
247 !46 = distinct !DIGlobalVariable(name: "ppmd", linkageName: "\01?ppmd@@3PEAPEQIncomplete@@HEA", scope: !0, file: !1, line: 15, type: !47, isLocal: false, isDefinition: true, variable: %0** @"\01?ppmd@@3PEAPEQIncomplete@@HEA")
247 !46 = distinct !DIGlobalVariable(name: "ppmd", linkageName: "\01?ppmd@@3PEAPEQIncomplete@@HEA", scope: !0, file: !1, line: 15, type: !47, isLocal: false, isDefinition: true)
248248 !47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !48, size: 64, align: 64)
249249 !48 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, extraData: !49)
250250 !49 = !DICompositeType(tag: DW_TAG_structure_type, name: "Incomplete", file: !1, line: 14, flags: DIFlagFwdDecl, identifier: ".?AUIncomplete@@")
251 !50 = distinct !DIGlobalVariable(name: "ppmf", linkageName: "\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA", scope: !0, file: !1, line: 16, type: !51, isLocal: false, isDefinition: true, variable: %1** @"\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA")
251 !50 = distinct !DIGlobalVariable(name: "ppmf", linkageName: "\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA", scope: !0, file: !1, line: 16, type: !51, isLocal: false, isDefinition: true)
252252 !51 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !52, size: 64, align: 64)
253253 !52 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !53, extraData: !49)
254254 !53 = !DISubroutineType(types: !54)
5454 %struct.S = type { i32 }
5555 %union.pun = type { i32 }
5656
57 @"\01?u@@3UU@@A" = global %struct.U zeroinitializer, align 4
57 @"\01?u@@3UU@@A" = global %struct.U zeroinitializer, align 4, !dbg !4
5858
5959 ; Function Attrs: nounwind uwtable
6060 define void @"\01?f@@YAXXZ"() #0 !dbg !14 {
9696 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
9797 !2 = !{}
9898 !3 = !{!4}
99 !4 = distinct !DIGlobalVariable(name: "u", linkageName: "\01?u@@3UU@@A", scope: !0, file: !1, line: 13, type: !5, isLocal: false, isDefinition: true, variable: %struct.U* @"\01?u@@3UU@@A")
99 !4 = distinct !DIGlobalVariable(name: "u", linkageName: "\01?u@@3UU@@A", scope: !0, file: !1, line: 13, type: !5, isLocal: false, isDefinition: true)
100100 !5 = !DIDerivedType(tag: DW_TAG_typedef, name: "U", file: !1, line: 12, baseType: !6)
101101 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !1, line: 12, size: 32, align: 32, elements: !7, identifier: ".?AUU@@")
102102 !7 = !{!8}
120120
121121 $"\01??_R4A@@6B@" = comdat any
122122
123 @"\01?p@@3PEAUC@@EA" = global %struct.C* null, align 8
123 @"\01?p@@3PEAUC@@EA" = global %struct.C* null, align 8, !dbg !4
124124 @0 = private unnamed_addr constant [3 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4C@@6B@" to i8*), i8* bitcast (void (%struct.C*)* @"\01?f@C@@UEAAXXZ" to i8*), i8* bitcast (void (%struct.C*)* @"\01?g@C@@UEAAXXZ" to i8*)], comdat($"\01??_7C@@6B@")
125125 @"\01??_R4C@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUC@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4C@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
126126 @"\01??_7type_info@@6B@" = external constant i8*
236236 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
237237 !2 = !{}
238238 !3 = !{!4}
239 !4 = distinct !DIGlobalVariable(name: "p", linkageName: "\01?p@@3PEAUC@@EA", scope: !0, file: !1, line: 13, type: !5, isLocal: false, isDefinition: true, variable: %struct.C** @"\01?p@@3PEAUC@@EA")
239 !4 = distinct !DIGlobalVariable(name: "p", linkageName: "\01?p@@3PEAUC@@EA", scope: !0, file: !1, line: 13, type: !5, isLocal: false, isDefinition: true)
240240 !5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
241241 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !1, line: 9, size: 64, align: 64, elements: !7, vtableHolder: !12, identifier: ".?AUC@@")
242242 !7 = !{!8, !30, !34}
3939
4040 $"\01??_DUseCompleteType@@QEAA@XZ" = comdat any
4141
42 @"\01?force_fwd_decl@@3UGetFwdDecl@@A" = global %struct.GetFwdDecl zeroinitializer, align 1
43 @"\01?require_complete@@3UUseCompleteType@@A" = global %struct.UseCompleteType zeroinitializer, align 8
42 @"\01?force_fwd_decl@@3UGetFwdDecl@@A" = global %struct.GetFwdDecl zeroinitializer, align 1, !dbg !4
43 @"\01?require_complete@@3UUseCompleteType@@A" = global %struct.UseCompleteType zeroinitializer, align 8, !dbg !10
4444 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_t.cpp, i8* null }]
4545
4646 ; Function Attrs: nounwind
9999 !1 = !DIFile(filename: "", directory: "C:\5Csrc\5Cllvm\5Cbuild")
100100 !2 = !{}
101101 !3 = !{!4, !10}
102 !4 = distinct !DIGlobalVariable(name: "force_fwd_decl", linkageName: "\01?force_fwd_decl@@3UGetFwdDecl@@A", scope: !0, file: !5, line: 5, type: !6, isLocal: false, isDefinition: true, variable: %struct.GetFwdDecl* @"\01?force_fwd_decl@@3UGetFwdDecl@@A")
102 !4 = distinct !DIGlobalVariable(name: "force_fwd_decl", linkageName: "\01?force_fwd_decl@@3UGetFwdDecl@@A", scope: !0, file: !5, line: 5, type: !6, isLocal: false, isDefinition: true)
103103 !5 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm\5Cbuild")
104104 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GetFwdDecl", file: !5, line: 2, size: 8, align: 8, elements: !7, identifier: ".?AUGetFwdDecl@@")
105105 !7 = !{!8}
106106 !8 = !DIDerivedType(tag: DW_TAG_member, name: "format", scope: !6, file: !5, line: 3, baseType: !9, flags: DIFlagStaticMember)
107107 !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "UnicodeString", file: !5, line: 1, flags: DIFlagFwdDecl, identifier: ".?AUUnicodeString@@")
108 !10 = distinct !DIGlobalVariable(name: "require_complete", linkageName: "\01?require_complete@@3UUseCompleteType@@A", scope: !0, file: !5, line: 15, type: !11, isLocal: false, isDefinition: true, variable: %struct.UseCompleteType* @"\01?require_complete@@3UUseCompleteType@@A")
108 !10 = distinct !DIGlobalVariable(name: "require_complete", linkageName: "\01?require_complete@@3UUseCompleteType@@A", scope: !0, file: !5, line: 15, type: !11, isLocal: false, isDefinition: true)
109109 !11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "UseCompleteType", file: !5, line: 10, size: 64, align: 64, elements: !12, identifier: ".?AUUseCompleteType@@")
110110 !12 = !{!13, !17, !21}
111111 !13 = !DIDerivedType(tag: DW_TAG_member, name: "currencySpcAfterSym", scope: !11, file: !5, line: 13, baseType: !14, size: 64, align: 64)
0 ; RUN: llc %s -o /dev/null
1 @0 = internal constant i32 1
1 @0 = internal constant i32 1, !dbg !5
22
33 !llvm.dbg.cu = !{!0}
44 !llvm.module.flags = !{!9}
66 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: FullDebug, file: !8, enums: !2, retainedTypes: !2, globals: !3)
77 !2 = !{}
88 !3 = !{!5}
9 !5 = !DIGlobalVariable(name: "a", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @0)
9 !5 = !DIGlobalVariable(name: "a", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
1010 !6 = !DIFile(filename: "g.c", directory: "/private/tmp")
1111 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1212 !8 = !DIFile(filename: "g.c", directory: "/private/tmp")
55 ; CHECK-NEXT: DW_AT_name
66
77
8 @i = common global i32 0 ; [#uses=2]
8 @i = common global i32 0, !dbg !16 ; [#uses=2]
99
1010 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
1111
4444 !13 = !{!14, !15}
4545 !14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
4646 !15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5)
4848 !17 = !DILocation(line: 15, scope: !18)
4949 !18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
5050 !19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
5151
5252
5353
54 @ForceTopDown = common global i32 0, align 4
55 @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_ = common global i32 0, align 4
56 @_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE = common global i32 0, align 4
57 @_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv = common global i32 0, align 4
58 @_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE = common global i32 0, align 4
59 @_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE = common global i32 0, align 4
60 @k1 = common global i32 0, align 4
61 @is = common global i32 0, align 4
62 @setStmt = common global i32 0, align 4
63 @_ZN4llvm5TwineC1Ei = common global i32 0, align 4
64 @_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE = common global i32 0, align 4
65 @_ZN4llvm22MachineModuleInfoMachOD2Ev = common global i32 0, align 4
54 @ForceTopDown = common global i32 0, align 4, !dbg !4
55 @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_ = common global i32 0, align 4, !dbg !6
56 @_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE = common global i32 0, align 4, !dbg !7
57 @_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv = common global i32 0, align 4, !dbg !8
58 @_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE = common global i32 0, align 4, !dbg !9
59 @_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE = common global i32 0, align 4, !dbg !10
60 @k1 = common global i32 0, align 4, !dbg !11
61 @is = common global i32 0, align 4, !dbg !12
62 @setStmt = common global i32 0, align 4, !dbg !13
63 @_ZN4llvm5TwineC1Ei = common global i32 0, align 4, !dbg !14
64 @_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE = common global i32 0, align 4, !dbg !15
65 @_ZN4llvm22MachineModuleInfoMachOD2Ev = common global i32 0, align 4, !dbg !16
6666
6767 !llvm.dbg.cu = !{!0}
6868 !llvm.module.flags = !{!17, !18, !19}
7272 !1 = !DIFile(filename: "hash-collisions.c", directory: "/tmp")
7373 !2 = !{}
7474 !3 = !{!4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16}
75 !4 = !DIGlobalVariable(name: "ForceTopDown", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @ForceTopDown)
75 !4 = !DIGlobalVariable(name: "ForceTopDown", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true)
7676 !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
77 !6 = !DIGlobalVariable(name: "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_)
78 !7 = !DIGlobalVariable(name: "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE)
79 !8 = !DIGlobalVariable(name: "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv)
80 !9 = !DIGlobalVariable(name: "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE)
81 !10 = !DIGlobalVariable(name: "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE)
82 !11 = !DIGlobalVariable(name: "k1", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, variable: i32* @k1)
83 !12 = !DIGlobalVariable(name: "is", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, variable: i32* @is)
84 !13 = !DIGlobalVariable(name: "setStmt", scope: !0, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true, variable: i32* @setStmt)
85 !14 = !DIGlobalVariable(name: "_ZN4llvm5TwineC1Ei", scope: !0, file: !1, line: 10, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm5TwineC1Ei)
86 !15 = !DIGlobalVariable(name: "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE", scope: !0, file: !1, line: 11, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE)
87 !16 = !DIGlobalVariable(name: "_ZN4llvm22MachineModuleInfoMachOD2Ev", scope: !0, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm22MachineModuleInfoMachOD2Ev)
77 !6 = !DIGlobalVariable(name: "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true)
78 !7 = !DIGlobalVariable(name: "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true)
79 !8 = !DIGlobalVariable(name: "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true)
80 !9 = !DIGlobalVariable(name: "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true)
81 !10 = !DIGlobalVariable(name: "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true)
82 !11 = !DIGlobalVariable(name: "k1", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true)
83 !12 = !DIGlobalVariable(name: "is", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true)
84 !13 = !DIGlobalVariable(name: "setStmt", scope: !0, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true)
85 !14 = !DIGlobalVariable(name: "_ZN4llvm5TwineC1Ei", scope: !0, file: !1, line: 10, type: !5, isLocal: false, isDefinition: true)
86 !15 = !DIGlobalVariable(name: "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE", scope: !0, file: !1, line: 11, type: !5, isLocal: false, isDefinition: true)
87 !16 = !DIGlobalVariable(name: "_ZN4llvm22MachineModuleInfoMachOD2Ev", scope: !0, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true)
8888 !17 = !{i32 2, !"Dwarf Version", i32 2}
8989 !18 = !{i32 2, !"Debug Info Version", i32 3}
9090 !19 = !{i32 1, !"PIC Level", i32 2}
3636 ; CHECK: DW_AT_name {{.*}}"a.cpp"
3737 ; CHECK: DW_AT_name {{.*}} "func"
3838
39 @x = global i32 (i32)* @_Z4funci, align 8
40 @y = global i32 (i32)* @_Z4funci, align 8
39 @x = global i32 (i32)* @_Z4funci, align 8, !dbg !10
40 @y = global i32 (i32)* @_Z4funci, align 8, !dbg !18
4141
4242 ; Function Attrs: inlinehint nounwind uwtable
4343 define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !4 {
6868 !7 = !{!8, !8}
6969 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
7070 !9 = !{!10}
71 !10 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !11, variable: i32 (i32)** @x)
71 !10 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !11)
7272 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6)
7373 !12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !13, enums: !2, retainedTypes: !2, globals: !17, imports: !2)
7474 !13 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
7575 !15 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !12, scopeLine: 1, file: !13, scope: !16, type: !6, variables: !2)
7676 !16 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
7777 !17 = !{!18}
78 !18 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !11, variable: i32 (i32)** @y)
78 !18 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !11)
7979 !19 = !{i32 2, !"Dwarf Version", i32 4}
8080 !20 = !{i32 1, !"Debug Info Version", i32 3}
8181 !21 = !{!"clang version 3.5.0 "}
2424 ; CHECK: DW_TAG_compile_unit
2525 ; CHECK-NOT: DW_TAG_subprogram
2626
27 @x = global i32 (i32)* @_Z4funci, align 8
28 @y = global i32 (i32)* @_Z4funci, align 8
27 @x = global i32 (i32)* @_Z4funci, align 8, !dbg !11
28 @y = global i32 (i32)* @_Z4funci, align 8, !dbg !16
2929
3030 ; Function Attrs: inlinehint nounwind uwtable
3131 define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !4 {
5757 !8 = !{!9, !9}
5858 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
5959 !10 = !{!11}
60 !11 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12, variable: i32 (i32)** @x)
60 !11 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12)
6161 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !7)
6262 !13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !14, enums: !2, retainedTypes: !2, globals: !15, imports: !2)
6363 !14 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
6464 !15 = !{!16}
65 !16 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12, variable: i32 (i32)** @y)
65 !16 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12)
6666 !17 = !{i32 2, !"Dwarf Version", i32 4}
6767 !18 = !{i32 1, !"Debug Info Version", i32 3}
6868 !19 = !{!"clang version 3.5.0 "}
22 ; Do not unnecessarily use AT_specification DIE.
33 ; CHECK-NOT: AT_specification
44
5 @a = common global [10 x i32] zeroinitializer, align 16
5 @a = common global [10 x i32] zeroinitializer, align 16, !dbg !5
66
77 !llvm.dbg.cu = !{!0}
88 !llvm.module.flags = !{!12}
1010 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 140253)", isOptimized: true, emissionKind: FullDebug, file: !11, enums: !2, retainedTypes: !2, globals: !3)
1111 !2 = !{}
1212 !3 = !{!5}
13 !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: [10 x i32]* @a)
13 !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
1414 !6 = !DIFile(filename: "x.c", directory: "/private/tmp")
1515 !7 = !DICompositeType(tag: DW_TAG_array_type, size: 320, align: 32, baseType: !8, elements: !9)
1616 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
2020 %struct.Y = type { %struct.X* }
2121 %struct.X = type opaque
2222
23 @y = common global %struct.Y zeroinitializer, align 8
23 @y = common global %struct.Y zeroinitializer, align 8, !dbg !4
2424
2525 !llvm.dbg.cu = !{!0}
2626 !llvm.module.flags = !{!10, !11}
3030 !1 = !DIFile(filename: "minimal.c", directory: "/tmp")
3131 !2 = !{}
3232 !3 = !{!4}
33 !4 = !DIGlobalVariable(name: "y", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, variable: %struct.Y* @y)
33 !4 = !DIGlobalVariable(name: "y", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true)
3434 !5 = !DICompositeType(tag: DW_TAG_structure_type, name: "Y", file: !1, line: 3, size: 64, align: 64, elements: !6)
3535 !6 = !{!7}
3636 !7 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !5, file: !1, line: 4, baseType: !8, size: 64, align: 64)
5050
5151 %struct.C = type { i8 }
5252
53 @_ZN1C22static_member_variableE = global i32 0, align 4
54 @global_variable = global %struct.C zeroinitializer, align 1
55 @_ZN2ns25global_namespace_variableE = global i32 1, align 4
53 @_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !25
54 @global_variable = global %struct.C zeroinitializer, align 1, !dbg !26
55 @_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !27
5656
5757 define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 !dbg !3 {
5858 entry:
113113 !22 = !DISubroutineType(types: !23)
114114 !23 = !{null}
115115 !24 = !{!25, !26, !27}
116 !25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, variable: i32* @_ZN1C22static_member_variableE, declaration: !10)
117 !26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8, variable: %struct.C* @global_variable)
118 !27 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11, variable: i32* @_ZN2ns25global_namespace_variableE)
116 !25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, declaration: !10)
117 !26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8)
118 !27 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11)
119119 !28 = !DILocalVariable(name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29)
120120 !29 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
121121 !30 = !DILocation(line: 9, scope: !3)
3232 ; CHECK: DW_TAG_enumerator
3333 ; CHECK-NEXT: DW_AT_name{{.*}} = "X"
3434
35 @a = global i64 0, align 8
35 @a = global i64 0, align 8, !dbg !18
3636
3737 ; Function Attrs: nounwind uwtable
3838 define void @_Z4funcv() #0 !dbg !13 {
6969 !15 = !DISubroutineType(types: !16)
7070 !16 = !{null}
7171 !17 = !{!18}
72 !18 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !3, variable: i64* @a)
72 !18 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !3)
7373 !19 = !{i32 2, !"Dwarf Version", i32 3}
7474 !20 = !DILocalVariable(name: "b", line: 4, scope: !13, file: !14, type: !21)
7575 !21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1515 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
1616 target triple = "arm64-apple-ios"
1717
18 @a = common global i32 0, align 4
19 @b = common global i32 0, align 4
18 @a = common global i32 0, align 4, !dbg !16
19 @b = common global i32 0, align 4, !dbg !17
2020
2121 ; Function Attrs: nounwind
2222 define void @f3() #0 !dbg !12 {
8080 !13 = !DISubroutineType(types: !14)
8181 !14 = !{null}
8282 !15 = !{!16, !17}
83 !16 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, variable: i32* @a)
84 !17 = !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, variable: i32* @b)
83 !16 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true)
84 !17 = !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true)
8585 !18 = !{i32 2, !"Dwarf Version", i32 2}
8686 !19 = !{i32 2, !"Debug Info Version", i32 3}
8787 !20 = !{!"clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)"}
1616 ; int S::*x = 0;
1717 ; void (S::*y)(int) = 0;
1818
19 @x = global i64 -1, align 8
20 @y = global { i64, i64 } zeroinitializer, align 8
19 @x = global i64 -1, align 8, !dbg !5
20 @y = global { i64, i64 } zeroinitializer, align 8, !dbg !10
2121
2222 !llvm.dbg.cu = !{!0}
2323 !llvm.module.flags = !{!16}
2525 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: FullDebug, file: !15, enums: !1, retainedTypes: !1, globals: !3, imports: !1)
2626 !1 = !{}
2727 !3 = !{!5, !10}
28 !5 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i64* @x)
28 !5 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
2929 !6 = !DIFile(filename: "simple.cpp", directory: "/home/blaikie/Development/scratch")
3030 !7 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !8, extraData: !9)
3131 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3232 !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 1, size: 8, align: 8, file: !15, elements: !1)
33 !10 = !DIGlobalVariable(name: "y", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !11, variable: { i64, i64 }* @y)
33 !10 = !DIGlobalVariable(name: "y", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !11)
3434 !11 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !12, extraData: !9)
3535 !12 = !DISubroutineType(types: !13)
3636 !13 = !{null, !14, !8}
199199 ; }
200200 ; void B::func_fwd() {}
201201
202 @_ZN1A1B1iE = global i32 0, align 4
203 @_ZN1A1B7var_fwdE = global i32 0, align 4
202 @_ZN1A1B1iE = global i32 0, align 4, !dbg !31
203 @_ZN1A1B7var_fwdE = global i32 0, align 4, !dbg !32
204204 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_debug_info_namespace.cpp, i8* null }]
205205
206206 ; Function Attrs: nounwind ssp uwtable
316316 !28 = !DIFile(filename: "debug-info-namespace.cpp", directory: "/tmp")
317317 !29 = !DISubroutineType(types: !2)
318318 !30 = !{!31, !32}
319 !31 = !DIGlobalVariable(name: "i", linkageName: "_ZN1A1B1iE", line: 20, isLocal: false, isDefinition: true, scope: !6, file: !18, type: !13, variable: i32* @_ZN1A1B1iE)
320 !32 = !DIGlobalVariable(name: "var_fwd", linkageName: "_ZN1A1B7var_fwdE", line: 44, isLocal: false, isDefinition: true, scope: !6, file: !18, type: !13, variable: i32* @_ZN1A1B7var_fwdE)
319 !31 = !DIGlobalVariable(name: "i", linkageName: "_ZN1A1B1iE", line: 20, isLocal: false, isDefinition: true, scope: !6, file: !18, type: !13)
320 !32 = !DIGlobalVariable(name: "var_fwd", linkageName: "_ZN1A1B7var_fwdE", line: 44, isLocal: false, isDefinition: true, scope: !6, file: !18, type: !13)
321321 !33 = !{!34, !35, !36, !37, !40, !41, !42, !43, !44, !45, !47, !48, !49, !51, !54, !55, !56}
322322 !34 = !DIImportedEntity(tag: DW_TAG_imported_module, line: 15, scope: !7, entity: !6)
323323 !35 = !DIImportedEntity(tag: DW_TAG_imported_module, line: 18, scope: !0, entity: !7)
8787
8888 %struct.C = type { i32 }
8989
90 @x = global %struct.C* null, align 8
90 @x = global %struct.C* null, align 8, !dbg !27
9191
9292 ; Function Attrs: nounwind
9393 define void @_Z3fn6v() #0 !dbg !14 {
224224 !24 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25)
225225 !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)
226226 !26 = !{!27}
227 !27 = !DIGlobalVariable(name: "x", line: 13, isLocal: false, isDefinition: true, scope: null, file: !15, type: !25, variable: %struct.C** @x)
227 !27 = !DIGlobalVariable(name: "x", line: 13, isLocal: false, isDefinition: true, scope: null, file: !15, type: !25)
228228 !28 = !{i32 2, !"Dwarf Version", i32 4}
229229 !29 = !{i32 2, !"Debug Info Version", i32 3}
230230 !30 = !{!"clang version 3.6.0 "}
1919
2020 %class.bar = type { i8 }
2121
22 @filters = global %class.bar zeroinitializer, align 1
22 @filters = global %class.bar zeroinitializer, align 1, !dbg !4
2323
2424 !llvm.dbg.cu = !{!0}
2525 !llvm.module.flags = !{!36, !37}
2828 !1 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
2929 !2 = !{}
3030 !3 = !{!4}
31 !4 = !DIGlobalVariable(name: "filters", line: 10, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: %class.bar* @filters)
31 !4 = !DIGlobalVariable(name: "filters", line: 10, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
3232 !5 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
3333 !6 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", line: 9, size: 8, align: 8, file: !1, elements: !7)
3434 !7 = !{!8, !31}
1010 ; };
1111 ; int Foo:*x = 0;
1212
13 @x = global i64 -1, align 8
13 @x = global i64 -1, align 8, !dbg !6
1414
1515 !llvm.dbg.cu = !{!0}
1616 !llvm.module.flags = !{!10, !11}
2121 !3 = !{!4}
2222 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", line: 1, flags: DIFlagFwdDecl, file: !1, identifier: "_ZTS3Foo")
2323 !5 = !{!6}
24 !6 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !7, type: !8, variable: i64* @x)
24 !6 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !7, type: !8)
2525 !7 = !DIFile(filename: "foo.cpp", directory: ".")
2626 !8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, extraData: !4)
2727 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1111 ; CHECK-NOT: DW_AT_type
1212 ; CHECK: {{DW_TAG|NULL}}
1313
14 @y = global i8* null, align 8
14 @y = global i8* null, align 8, !dbg !4
1515
1616 !llvm.dbg.cu = !{!0}
1717 !llvm.module.flags = !{!8, !9}
2121 !1 = !DIFile(filename: "typedef.cpp", directory: "/tmp/dbginfo")
2222 !2 = !{}
2323 !3 = !{!4}
24 !4 = !DIGlobalVariable(name: "y", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: i8** @y)
24 !4 = !DIGlobalVariable(name: "y", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
2525 !5 = !DIFile(filename: "typedef.cpp", directory: "/tmp/dbginfo")
2626 !6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !7)
2727 !7 = !DIDerivedType(tag: DW_TAG_typedef, name: "x", line: 1, file: !1, baseType: null)
4040 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4141 target triple = "x86_64-unknown-linux-gnu"
4242
43 @m = common global i32 0, align 4
43 @m = common global i32 0, align 4, !dbg !16
4444 @.str = private unnamed_addr constant [13 x i8] c"m(main): %d\0A\00", align 1
4545
4646 ; Function Attrs: nounwind uwtable
120120 !13 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 6, type: !8)
121121 !14 = !DILocalVariable(name: "n", scope: !4, file: !1, line: 7, type: !7)
122122 !15 = !{!16}
123 !16 = !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @m)
123 !16 = !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true)
124124 !17 = !{i32 2, !"Dwarf Version", i32 4}
125125 !18 = !{i32 2, !"Debug Info Version", i32 3}
126126 !19 = !{!"clang version 3.8.0 (trunk 253049)"}
55 ; CHECK-NEXT: info_string
66
77
8 @i = common global i32 0 ; [#uses=2]
8 @i = common global i32 0, !dbg !16 ; [#uses=2]
99
1010 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
1111
4444 !13 = !{!14, !15}
4545 !14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
4646 !15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5)
4848 !17 = !DILocation(line: 15, scope: !18)
4949 !18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
5050 !19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
1616 ; CHECK-NEXT: .Laddr_sec:
1717 ; CHECK-NEXT: .quad tls@DTPREL+32768
1818
19 @tls = thread_local global i32 0, align 4
19 @tls = thread_local global i32 0, align 4, !dbg !4
2020
2121 !llvm.dbg.cu = !{!0}
2222 !llvm.module.flags = !{!7, !8}
2525 !1 = !DIFile(filename: "tls.cpp", directory: "/tmp")
2626 !2 = !{}
2727 !3 = !{!4}
28 !4 = !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: i32* @tls)
28 !4 = !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
2929 !5 = !DIFile(filename: "tls.cpp", directory: "/tmp")
3030 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3131 !7 = !{i32 2, !"Dwarf Version", i32 3}
1111 ; DW_OP_GNU_push_tls_address
1212 ; CHECK: .byte 224
1313
14 @tls = thread_local global i32 7, align 4
14 @tls = thread_local global i32 7, align 4, !dbg !4
1515
1616 !llvm.dbg.cu = !{!0}
1717 !llvm.module.flags = !{!7, !8}
2020 !1 = !DIFile(filename: "tls.cpp", directory: "/tmp")
2121 !2 = !{}
2222 !3 = !{!4}
23 !4 = !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: i32* @tls)
23 !4 = !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
2424 !5 = !DIFile(filename: "tls.cpp", directory: "/tmp")
2525 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
2626 !7 = !{i32 2, !"Dwarf Version", i32 3}
22
33 ; ModuleID = 'test.c'
44
5 @GLB = common global i32 0, align 4
5 @GLB = common global i32 0, align 4, !dbg !14
66
77 define i32 @f() nounwind !dbg !5 {
88 %LOC = alloca i32, align 4
2626 !8 = !{!9}
2727 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
2828 !12 = !{!14}
29 !14 = !DIGlobalVariable(name: "GLB", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @GLB)
29 !14 = !DIGlobalVariable(name: "GLB", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9)
3030 !15 = !DILocalVariable(name: "LOC", line: 4, scope: !16, file: !6, type: !9)
3131 !16 = distinct !DILexicalBlock(line: 3, column: 9, file: !20, scope: !5)
3232 !17 = !DILocation(line: 4, column: 9, scope: !16)
1010
1111 %struct.s = type opaque
1212
13 @i = common global %struct.s* null, align 8
13 @i = common global %struct.s* null, align 8, !dbg !4
1414
1515 !llvm.dbg.cu = !{!0}
1616 !llvm.module.flags = !{!7, !8}
1919 !1 = !DIFile(filename: "test.c", directory: "/")
2020 !2 = !{}
2121 !3 = !{!4}
22 !4 = !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: %struct.s** @i)
22 !4 = !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true)
2323 !5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
2424 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", scope: !9, file: !1, line: 1, flags: DIFlagFwdDecl)
2525 !7 = !{i32 2, !"Dwarf Version", i32 2}
4141 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4242 target triple = "i386-pc-windows-msvc19.0.23918"
4343
44 @"\01?fptr@@3P6IHHH@ZA" = global i32 (i32, i32)* @"\01?f@@YIHHH@Z", align 4
44 @"\01?fptr@@3P6IHHH@ZA" = global i32 (i32, i32)* @"\01?f@@YIHHH@Z", align 4, !dbg !4
4545
4646 ; Function Attrs: nounwind readnone
4747 define x86_fastcallcc i32 @"\01?f@@YIHHH@Z"(i32 inreg %a, i32 inreg %b) #0 !dbg !12 {
6666 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
6767 !2 = !{}
6868 !3 = !{!4}
69 !4 = distinct !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32 (i32, i32)** @"\01?fptr@@3P6IHHH@ZA")
69 !4 = distinct !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true)
7070 !5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 32, align: 32)
7171 !6 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !7)
7272 !7 = !{!8, !8, !8}
99 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
1010
1111
12 @_ZZN3foo3barEvE1x = constant i32 0, align 4
12 @_ZZN3foo3barEvE1x = constant i32 0, align 4, !dbg !20
1313
1414 define void @_ZN3foo3barEv() !dbg !5 {
1515 entry:
3131 !12 = !DICompositeType(tag: DW_TAG_class_type, name: "foo", line: 1, size: 8, align: 8, file: !27, elements: !13)
3232 !13 = !{!11}
3333 !18 = !{!20}
34 !20 = !DIGlobalVariable(name: "x", line: 5, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !21, variable: i32* @_ZZN3foo3barEvE1x)
34 !20 = !DIGlobalVariable(name: "x", line: 5, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !21)
3535 !21 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !22)
3636 !22 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3737 !25 = !DILocation(line: 6, column: 1, scope: !26)
1111 %class.A = type { i32 }
1212 %class.B = type { i32 }
1313
14 @a = global %class.A zeroinitializer, align 4
15 @b = global %class.B zeroinitializer, align 4
14 @a = global %class.A zeroinitializer, align 4, !dbg !5
15 @b = global %class.B zeroinitializer, align 4, !dbg !17
1616
1717 !llvm.dbg.cu = !{!0}
1818 !llvm.module.flags = !{!29}
2020 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, emissionKind: FullDebug, file: !28, enums: !1, retainedTypes: !1, globals: !3, imports: !1)
2121 !1 = !{}
2222 !3 = !{!5, !17}
23 !5 = !DIGlobalVariable(name: "a", line: 10, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a)
23 !5 = !DIGlobalVariable(name: "a", line: 10, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
2424 !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
2525 !7 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !28, elements: !8)
2626 !8 = !{!9, !11}
3030 !12 = !DISubroutineType(types: !13)
3131 !13 = !{null, !14}
3232 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !7)
33 !17 = !DIGlobalVariable(name: "b", line: 11, isLocal: false, isDefinition: true, scope: null, file: !6, type: !18, variable: %class.B* @b)
33 !17 = !DIGlobalVariable(name: "b", line: 11, isLocal: false, isDefinition: true, scope: null, file: !6, type: !18)
3434 !18 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 5, size: 32, align: 32, file: !28, elements: !19)
3535 !19 = !{!20, !21, !27}
3636 !20 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 7, size: 32, align: 32, flags: DIFlagPrivate, file: !28, scope: !18, baseType: !10)
55 ; CHECK-NEXT: info_string
66
77
8 @i = common global i32 0 ; [#uses=2]
8 @i = common global i32 0, !dbg !16 ; [#uses=2]
99
1010 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
1111
4444 !13 = !{!14, !15}
4545 !14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
4646 !15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5)
4848 !17 = !DILocation(line: 15, scope: !18)
4949 !18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
5050 !19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
3030
3131 %struct.S0 = type { i16, i32 }
3232
33 @a = common global %struct.S0 zeroinitializer, align 4
33 @a = common global %struct.S0 zeroinitializer, align 4, !dbg !21
3434
3535 declare void @llvm.dbg.declare(metadata, metadata, metadata)
3636 declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
8383 !18 = !DISubroutineType(types: !19)
8484 !19 = !{!15}
8585 !20 = !{!21}
86 !21 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true, variable: %struct.S0* @a)
86 !21 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true)
8787 !22 = !{i32 2, !"Dwarf Version", i32 2}
8888 !23 = !{i32 2, !"Debug Info Version", i32 3}
8989 !24 = !{i32 1, !"PIC Level", i32 2}
99 target triple = "x86_64-linux-gnu"
1010
1111 @_ZTId = external constant i8*
12 @zed = global [1 x void ()*] [void ()* @bar]
12 @zed = global [1 x void ()*] [void ()* @bar], !dbg !11
1313
1414 define void @foo() !dbg !4 {
1515 ret void
4141 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4242 !9 = distinct !DISubprogram(name: "bar_d", linkageName: "bar", scope: !5, file: !5, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
4343 !10 = !{!11}
44 !11 = !DIGlobalVariable(name: "zed", scope: !0, file: !5, line: 6, type: !12, isLocal: false, isDefinition: true, variable: [1 x void ()*]* @zed)
44 !11 = !DIGlobalVariable(name: "zed", scope: !0, file: !5, line: 6, type: !12, isLocal: false, isDefinition: true)
4545 !12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 64, align: 64, elements: !15)
4646 !13 = !DIDerivedType(tag: DW_TAG_typedef, name: "vifunc", file: !5, line: 5, baseType: !14)
4747 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
2121
2222 %struct.foo = type { i8 }
2323
24 @f = global %struct.foo zeroinitializer, align 1
24 @f = global %struct.foo zeroinitializer, align 1, !dbg !10
2525 @i = external global i32
2626
2727 !llvm.dbg.cu = !{!0}
3838 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
3939 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4040 !9 = !{!10}
41 !10 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4, variable: %struct.foo* @f)
41 !10 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4)
4242 !11 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")
4343 !12 = !{i32 2, !"Dwarf Version", i32 4}
4444 !13 = !{i32 1, !"Debug Info Version", i32 3}
2020
2121 %struct.PackedBits = type <{ i8, i32 }>
2222
23 @s = common global %struct.PackedBits zeroinitializer, align 1
23 @s = common global %struct.PackedBits zeroinitializer, align 1, !dbg !4
2424
2525 !llvm.dbg.cu = !{!0}
2626 !llvm.module.flags = !{!14, !15, !16}
3030 !1 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm")
3131 !2 = !{}
3232 !3 = !{!4}
33 !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, variable: %struct.PackedBits* @s)
33 !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true)
3434 !5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !1, line: 3, size: 40, align: 8, elements: !6)
3535 !6 = !{!7, !9, !13}
3636
4747
4848 %struct.bitfield = type <{ i8, [3 x i8], i64 }>
4949
50 @b = common global %struct.bitfield zeroinitializer, align 4
50 @b = common global %struct.bitfield zeroinitializer, align 4, !dbg !4
5151
5252 !llvm.dbg.cu = !{!0}
5353 !llvm.module.flags = !{!13, !14, !15}
5757 !1 = !DIFile(filename: "bitfields.c", directory: "/")
5858 !2 = !{}
5959 !3 = !{!4}
60 !4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true, variable: %struct.bitfield* @b)
60 !4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true)
6161 !5 = !DIFile(filename: "bitfields.c", directory: "/")
6262 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, align: 32, elements: !7)
6363 !7 = !{!8, !10, !11, !12}
1010
1111 %struct.foo = type {}
1212
13 @f = common global %struct.foo zeroinitializer, align 1
13 @f = common global %struct.foo zeroinitializer, align 1, !dbg !4
1414
1515 !llvm.dbg.cu = !{!0}
1616 !llvm.module.flags = !{!7, !8}
2020 !1 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo")
2121 !2 = !{}
2222 !3 = !{!4}
23 !4 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: %struct.foo* @f)
23 !4 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
2424 !5 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo")
2525 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, align: 8, file: !1, elements: !2)
2626 !7 = !{i32 2, !"Dwarf Version", i32 4}
117117 !45 = !DILocalVariable(name: "this", line: 4, arg: 1, flags: DIFlagArtificial, scope: !31, file: !6, type: !34)
118118 !46 = !DILocalVariable(name: "aValue", line: 4, arg: 2, scope: !31, file: !6, type: !9)
119119 !47 = !{!49}
120 !49 = !DIGlobalVariable(name: "mRefCnt", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !37, variable: i32* null)
120 !49 = !DIGlobalVariable(name: "mRefCnt", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !37)
121121 !50 = !DILocation(line: 5, column: 5, scope: !51, inlinedAt: !52)
122122 !51 = distinct !DILexicalBlock(line: 4, column: 29, file: !6, scope: !31)
123123 !52 = !DILocation(line: 15, scope: !53)
1919
2020 %class.A = type { i32 }
2121
22 @a = global %class.A zeroinitializer, align 4
22 @a = global %class.A zeroinitializer, align 4, !dbg !22
2323 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
2424
2525 define internal void @__cxx_global_var_init() section ".text.startup" !dbg !14 {
8080 !19 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !15, type: !20, variables: !2)
8181 !20 = !DISubroutineType(types: !2)
8282 !21 = !{!22}
83 !22 = !DIGlobalVariable(name: "a", line: 8, isLocal: false, isDefinition: true, scope: null, file: !15, type: !4, variable: %class.A* @a)
83 !22 = !DIGlobalVariable(name: "a", line: 8, isLocal: false, isDefinition: true, scope: null, file: !15, type: !4)
8484 !23 = !{i32 2, !"Dwarf Version", i32 4}
8585 !24 = !{i32 1, !"Debug Info Version", i32 3}
8686 !25 = !{!"clang version 3.5 (trunk 199923) (llvm/trunk 199940)"}
2727
2828 %struct.foo = type { i8, i32 }
2929
30 @f = global %struct.foo zeroinitializer, align 4
30 @f = global %struct.foo zeroinitializer, align 4, !dbg !11
3131
3232 !llvm.dbg.cu = !{!0}
3333 !llvm.module.flags = !{!13, !15}
4444 !8 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 3, size: 32, align: 32, offset: 32, file: !1, scope: !4, baseType: !9)
4545 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4646 !10 = !{!11}
47 !11 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !12, type: !4, variable: %struct.foo* @f)
47 !11 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !12, type: !4)
4848 !12 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")
4949 !13 = !{i32 2, !"Dwarf Version", i32 4}
5050 !14 = !{!"clang version 3.4 "}
22 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
33 target triple = "x86_64-apple-macosx10.7.2"
44
5 @s = common global [4294967296 x i8] zeroinitializer, align 16
5 @s = common global [4294967296 x i8] zeroinitializer, align 16, !dbg !13
66 ; CHECK: .quad 4294967296 ## DW_AT_count
77
88 define void @bar() nounwind uwtable ssp !dbg !5 {
2121 !7 = !DISubroutineType(types: !8)
2222 !8 = !{null}
2323 !11 = !{!13}
24 !13 = !DIGlobalVariable(name: "s", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14, variable: [4294967296 x i8]* @s)
24 !13 = !DIGlobalVariable(name: "s", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14)
2525 !14 = !DICompositeType(tag: DW_TAG_array_type, size: 34359738368, align: 8, baseType: !15, elements: !16)
2626 !15 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
2727 !16 = !{!17}
4040
4141 %struct.S1 = type { float*, i32 }
4242
43 @p = common global %struct.S1 zeroinitializer, align 8
43 @p = common global %struct.S1 zeroinitializer, align 8, !dbg !19
4444
4545 define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) nounwind optsize ssp !dbg !0 {
4646 entry:
9292 !16 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
9393 !17 = !DIDerivedType(tag: DW_TAG_member, name: "nums", line: 3, size: 32, align: 32, offset: 64, file: !42, scope: !1, baseType: !5)
9494 !18 = !DILocalVariable(name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5)
95 !19 = !DIGlobalVariable(name: "p", line: 14, isLocal: false, isDefinition: true, scope: !2, file: !1, type: !11, variable: %struct.S1* @p)
95 !19 = !DIGlobalVariable(name: "p", line: 14, isLocal: false, isDefinition: true, scope: !2, file: !1, type: !11)
9696 !20 = !DILocation(line: 7, column: 13, scope: !0)
9797 !21 = !DILocation(line: 7, column: 21, scope: !0)
9898 !22 = !DILocation(line: 9, column: 3, scope: !23)
3535 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3636 target triple = "x86_64-pc-windows-msvc18.0.0"
3737
38 @x = common global i32 0, align 4
38 @x = common global i32 0, align 4, !dbg !15
3939
4040 ; Function Attrs: nounwind uwtable
4141 define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 !dbg !4 {
8888 !12 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 4, type: !8)
8989 !13 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 4, type: !7)
9090 !14 = !{!15}
91 !15 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !16, isLocal: false, isDefinition: true, variable: i32* @x)
91 !15 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !16, isLocal: false, isDefinition: true)
9292 !16 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
9393 !17 = !{i32 2, !"Dwarf Version", i32 4}
9494 !18 = !{i32 2, !"Debug Info Version", i32 3}
9090 %class.B = type { i8 }
9191 %union.U = type { i32 }
9292
93 @a = global %struct.A zeroinitializer, align 1
94 @b = global %class.B zeroinitializer, align 1
95 @u = global %union.U zeroinitializer, align 4
93 @a = global %struct.A zeroinitializer, align 1, !dbg !35
94 @b = global %class.B zeroinitializer, align 1, !dbg !36
95 @u = global %union.U zeroinitializer, align 4, !dbg !37
9696
9797 ; Function Attrs: nounwind ssp uwtable
9898 define void @_Z4freev() #0 !dbg !30 {
139139 !32 = !DISubroutineType(types: !33)
140140 !33 = !{null}
141141 !34 = !{!35, !36, !37}
142 !35 = !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !4, variable: %struct.A* @a)
143 !36 = !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !12, variable: %class.B* @b)
144 !37 = !DIGlobalVariable(name: "u", line: 39, isLocal: false, isDefinition: true, scope: null, file: !31, type: !22, variable: %union.U* @u)
142 !35 = !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !4)
143 !36 = !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !12)
144 !37 = !DIGlobalVariable(name: "u", line: 39, isLocal: false, isDefinition: true, scope: null, file: !31, type: !22)
145145 !38 = !{i32 2, !"Dwarf Version", i32 2}
146146 !39 = !{i32 2, !"Debug Info Version", i32 3}
147147 !40 = !{!"clang version 3.6.0 "}
138138 ; CHECK: DW_AT_bit_offset {{.*}} (0x1f)
139139 ; CHECK: DW_AT_data_member_location {{.*}}0c
140140
141 @l0 = common global %struct.layout0 zeroinitializer, align 8
142 @l1 = common global %struct.layout1 zeroinitializer, align 4
143 @l2 = common global %struct.layout2 zeroinitializer, align 1
144 @l3 = common global %struct.layout3 zeroinitializer, align 4
141 @l0 = common global %struct.layout0 zeroinitializer, align 8, !dbg !4
142 @l1 = common global %struct.layout1 zeroinitializer, align 4, !dbg !18
143 @l2 = common global %struct.layout2 zeroinitializer, align 1, !dbg !25
144 @l3 = common global %struct.layout3 zeroinitializer, align 4, !dbg !35
145145
146146 !llvm.dbg.cu = !{!0}
147147 !llvm.module.flags = !{!45, !46}
151151 !1 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/", directory: "/llvm/_build.ninja.release")
152152 !2 = !{}
153153 !3 = !{!4, !18, !25, !35}
154 !4 = !DIGlobalVariable(name: "l0", scope: !0, file: !5, line: 88, type: !6, isLocal: false, isDefinition: true, variable: %struct.layout0* @l0)
154 !4 = !DIGlobalVariable(name: "l0", scope: !0, file: !5, line: 88, type: !6, isLocal: false, isDefinition: true)
155155 !5 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/debug-info-packed-struct.c", directory: "/llvm/_build.ninja.release")
156156 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout0", file: !5, line: 15, size: 192, align: 64, elements: !7)
157157 !7 = !{!8, !10, !17}
165165 !15 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !11, file: !5, line: 13, baseType: !16, size: 60, offset: 4)
166166 !16 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed)
167167 !17 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs16", scope: !6, file: !5, line: 18, baseType: !14, size: 1, align: 32, offset: 128)
168 !18 = !DIGlobalVariable(name: "l1", scope: !0, file: !5, line: 89, type: !19, isLocal: false, isDefinition: true, variable: %struct.layout1* @l1)
168 !18 = !DIGlobalVariable(name: "l1", scope: !0, file: !5, line: 89, type: !19, isLocal: false, isDefinition: true)
169169 !19 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout1", file: !5, line: 34, size: 96, align: 32, elements: !20)
170170 !20 = !{!21, !22, !24}
171171 !21 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs0", scope: !19, file: !5, line: 35, baseType: !9, size: 8, align: 8)
172172 !22 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs1", scope: !19, file: !5, line: 36, baseType: !23, size: 64, align: 8, offset: 8)
173173 !23 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_anon", file: !5, line: 30, size: 64, align: 8, elements: !2)
174174 !24 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs9", scope: !19, file: !5, line: 37, baseType: !14, size: 1, align: 32, offset: 72)
175 !25 = !DIGlobalVariable(name: "l2", scope: !0, file: !5, line: 90, type: !26, isLocal: false, isDefinition: true, variable: %struct.layout2* @l2)
175 !25 = !DIGlobalVariable(name: "l2", scope: !0, file: !5, line: 90, type: !26, isLocal: false, isDefinition: true)
176176 !26 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout2", file: !5, line: 54, size: 80, align: 8, elements: !27)
177177 !27 = !{!28, !29, !34}
178178 !28 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs0", scope: !26, file: !5, line: 55, baseType: !9, size: 8, align: 8)
182182 !32 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !30, file: !5, line: 51, baseType: !14, size: 4, align: 32)
183183 !33 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !30, file: !5, line: 52, baseType: !16, size: 60, offset: 4)
184184 !34 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs9", scope: !26, file: !5, line: 57, baseType: !14, size: 1, align: 32, offset: 72)
185 !35 = !DIGlobalVariable(name: "l3", scope: !0, file: !5, line: 91, type: !36, isLocal: false, isDefinition: true, variable: %struct.layout3* @l3)
185 !35 = !DIGlobalVariable(name: "l3", scope: !0, file: !5, line: 91, type: !36, isLocal: false, isDefinition: true)
186186 !36 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout3", file: !5, line: 76, size: 128, align: 32, elements: !37)
187187 !37 = !{!38, !39, !44}
188188 !38 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs0", scope: !36, file: !5, line: 77, baseType: !9, size: 8, align: 8)
3737
3838 %class.C = type { i32 }
3939
40 @_ZN1C1aE = global i32 4, align 4
41 @_ZN1C1bE = global i32 2, align 4
42 @_ZN1C1cE = global i32 1, align 4
40 @_ZN1C1aE = global i32 4, align 4, !dbg !12
41 @_ZN1C1bE = global i32 2, align 4, !dbg !27
42 @_ZN1C1cE = global i32 1, align 4, !dbg !28
4343
4444 define i32 @main() nounwind uwtable !dbg !5 {
4545 entry:
6666 !8 = !{!9}
6767 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
6868 !10 = !{!12, !27, !28}
69 !12 = !DIGlobalVariable(name: "a", linkageName: "_ZN1C1aE", line: 14, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1aE, declaration: !15)
69 !12 = !DIGlobalVariable(name: "a", linkageName: "_ZN1C1aE", line: 14, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !15)
7070 !13 = !DICompositeType(tag: DW_TAG_class_type, name: "C", line: 1, size: 32, align: 32, file: !33, elements: !14)
7171 !14 = !{!15, !16, !19, !20, !23, !24, !26}
7272 !15 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 3, flags: DIFlagPrivate | DIFlagStaticMember, file: !33, scope: !13, baseType: !9)
8181 !24 = !DIDerivedType(tag: DW_TAG_member, name: "const_c", line: 10, flags: DIFlagPublic | DIFlagStaticMember, file: !33, scope: !13, baseType: !25, extraData: i32 18)
8282 !25 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
8383 !26 = !DIDerivedType(tag: DW_TAG_member, name: "d", line: 11, size: 32, align: 32, flags: DIFlagPublic, file: !33, scope: !13, baseType: !9)
84 !27 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1bE, declaration: !19)
85 !28 = !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", line: 16, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1cE, declaration: !23)
84 !27 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !19)
85 !28 = !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", line: 16, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !23)
8686 !29 = !DILocalVariable(name: "instance_C", line: 20, scope: !5, file: !6, type: !13)
8787 !30 = !DILocation(line: 20, scope: !5)
8888 !31 = !DILocation(line: 21, scope: !5)
4141 ; ModuleID = 'frame.c'
4242 source_filename = "frame.c"
4343
44 @data = global i32 17, align 4
45 @sum = local_unnamed_addr global i32 0, align 4
46 @zero = local_unnamed_addr global i32 0, align 4
47 @ptr = common local_unnamed_addr global i32* null, align 8
44 @data = global i32 17, align 4, !dbg !4
45 @sum = local_unnamed_addr global i32 0, align 4, !dbg !6
46 @zero = local_unnamed_addr global i32 0, align 4, !dbg !7
47 @ptr = common local_unnamed_addr global i32* null, align 8, !dbg !8
4848
4949 ; Function Attrs: nounwind uwtable
5050 define i32 @main() local_unnamed_addr !dbg !13 {
8282 !1 = !DIFile(filename: "frame.c", directory: "/home/user/test")
8383 !2 = !{}
8484 !3 = !{!4, !6, !7, !8}
85 !4 = distinct !DIGlobalVariable(name: "data", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @data)
85 !4 = distinct !DIGlobalVariable(name: "data", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true)
8686 !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
87 !6 = distinct !DIGlobalVariable(name: "sum", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32* @sum)
88 !7 = distinct !DIGlobalVariable(name: "zero", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, variable: i32* @zero)
89 !8 = distinct !DIGlobalVariable(name: "ptr", scope: !0, file: !1, line: 4, type: !9, isLocal: false, isDefinition: true, variable: i32** @ptr)
87 !6 = distinct !DIGlobalVariable(name: "sum", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true)
88 !7 = distinct !DIGlobalVariable(name: "zero", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true)
89 !8 = distinct !DIGlobalVariable(name: "ptr", scope: !0, file: !1, line: 4, type: !9, isLocal: false, isDefinition: true)
9090 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
9191 !10 = !{i32 2, !"Dwarf Version", i32 4}
9292 !11 = !{i32 2, !"Debug Info Version", i32 3}
2626 ; SCE-NOT: apple_names
2727
2828
29 @globalvar = global i32 0, align 4
29 @globalvar = global i32 0, align 4, !dbg !4
3030
3131 !llvm.dbg.cu = !{!0}
3232 !llvm.module.flags = !{!6, !7}
3636 !1 = !DIFile(filename: "debugger-tune.cpp", directory: "/home/probinson/projects/scratch")
3737 !2 = !{}
3838 !3 = !{!4}
39 !4 = !DIGlobalVariable(name: "globalvar", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @globalvar)
39 !4 = !DIGlobalVariable(name: "globalvar", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true)
4040 !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4141 !6 = !{i32 2, !"Dwarf Version", i32 4}
4242 !7 = !{i32 2, !"Debug Info Version", i32 3}
2727
2828 $_ZN4baseC2Ev = comdat any
2929
30 @f = global %struct.foo zeroinitializer, align 8
30 @f = global %struct.foo zeroinitializer, align 8, !dbg !29
3131 @__dso_handle = external global i8
3232 @_ZTV4base = external unnamed_addr constant [4 x i8*]
3333 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_decl_derived_member.cpp, i8* null }]
127127 !26 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, file: !1, scope: !11, type: !27, variables: !2)
128128 !27 = !DISubroutineType(types: !2)
129129 !28 = !{!29}
130 !29 = !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4, variable: %struct.foo* @f)
130 !29 = !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4)
131131 !30 = !{i32 2, !"Dwarf Version", i32 4}
132132 !31 = !{i32 2, !"Debug Info Version", i32 3}
133133 !32 = !{!"clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)"}
44 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
55 target triple = "i686-pc-windows-msvc"
66
7 @"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4
7 @"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4, !dbg !4
88
99 !llvm.dbg.cu = !{!0}
1010 !llvm.module.flags = !{!13, !14}
1313 !1 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/", directory: "/usr/local/google/home/majnemer/llvm/src")
1414 !2 = !{}
1515 !3 = !{!4}
16 !4 = distinct !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, variable: i32* @"\01?id@?$numpunct@D@@0HA", declaration: !7)
16 !4 = distinct !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, declaration: !7)
1717 !5 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/t.ii", directory: "/usr/local/google/home/majnemer/llvm/src")
1818 !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1919 !7 = !DIDerivedType(tag: DW_TAG_member, name: "id", scope: !8, file: !5, line: 2, baseType: !6, flags: DIFlagStaticMember)
2222 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
2323 target triple = "x86_64-unknown-linux-gnu"
2424
25 @global = global i32 2, align 4
25 @global = global i32 2, align 4, !dbg !18
2626
2727 ; Function Attrs: nounwind readnone uwtable
2828 define i32 @_Z3fooi(i32 %bar) #0 !dbg !4 {
7676 !15 = !DISubroutineType(types: !16)
7777 !16 = !{!8}
7878 !17 = !{!18}
79 !18 = !DIGlobalVariable(name: "global", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @global)
79 !18 = !DIGlobalVariable(name: "global", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8)
8080 !19 = !{i32 2, !"Dwarf Version", i32 4}
8181 !20 = !DILocation(line: 2, scope: !4)
8282 !21 = !DILocation(line: 3, scope: !11)
4343
4444 target triple = "x86_64-unknown-linux-gnu"
4545
46 @some_data = global i32 4, align 4
47 @some_other = global i32 5, section "strange+section", align 4
48 @some_bss = common global i32 0, align 4
46 @some_data = global i32 4, align 4, !dbg !9
47 @some_other = global i32 5, section "strange+section", align 4, !dbg !11
48 @some_bss = common global i32 0, align 4, !dbg !12
4949
5050 define void @some_code() !dbg !4 {
5151 entry:
6969 !6 = !DISubroutineType(types: !7)
7070 !7 = !{null}
7171 !8 = !{!9, !11, !12}
72 !9 = !DIGlobalVariable(name: "some_data", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @some_data)
72 !9 = !DIGlobalVariable(name: "some_data", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10)
7373 !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
74 !11 = !DIGlobalVariable(name: "some_other", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @some_other)
75 !12 = !DIGlobalVariable(name: "some_bss", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @some_bss)
74 !11 = !DIGlobalVariable(name: "some_other", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10)
75 !12 = !DIGlobalVariable(name: "some_bss", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10)
7676 !13 = !{i32 2, !"Dwarf Version", i32 4}
7777 !14 = !DILocation(line: 7, scope: !4)
7878 !15 = !DILocation(line: 8, scope: !4)
3737 ; NOLINKAGE-NOT: .asciz "_ZN4test10global_varE"
3838 ; NOLINKAGE-NOT: .asciz "_ZN4test3barEv"
3939
40 @_ZN4test10global_varE = global i32 0, align 4
40 @_ZN4test10global_varE = global i32 0, align 4, !dbg !10
4141
4242 ; Function Attrs: nounwind uwtable
4343 define i32 @_ZN4test3barEv() #0 !dbg !4 {
6161 !7 = !{!8}
6262 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
6363 !9 = !{!10}
64 !10 = !DIGlobalVariable(name: "global_var", linkageName: "_ZN4test10global_varE", scope: !5, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, variable: i32* @_ZN4test10global_varE)
64 !10 = !DIGlobalVariable(name: "global_var", linkageName: "_ZN4test10global_varE", scope: !5, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true)
6565 !11 = !{i32 2, !"Dwarf Version", i32 4}
6666 !12 = !{i32 2, !"Debug Info Version", i32 3}
6767 !13 = !{!"clang version 3.8.0 (trunk 244662)"}