llvm.org GIT mirror llvm / 5f220be
DI: Reverse direction of subprogram -> function edge. Previously, subprograms contained a metadata reference to the function they described. Because most clients need to get or set a subprogram for a given function rather than the other way around, this created unneeded inefficiency. For example, many passes needed to call the function llvm::makeSubprogramMap() to build a mapping from functions to subprograms, and the IR linker needed to fix up function references in a way that caused quadratic complexity in the IR linking phase of LTO. This change reverses the direction of the edge by storing the subprogram as function-level metadata and removing DISubprogram's function field. Since this is an IR change, a bitcode upgrade has been provided. Fixes PR23367. An upgrade script for textual IR for out-of-tree clients is attached to the PR. Differential Revision: http://reviews.llvm.org/D14265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252219 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 3 years ago
400 changed file(s) with 1387 addition(s) and 1538 deletion(s). Raw diff Collapse all Expand all
7373 LLVMDIBuilderRef Dref, LLVMMetadataRef Scope, const char *Name,
7474 const char *LinkageName, LLVMMetadataRef File, unsigned Line,
7575 LLVMMetadataRef CompositeType, int IsLocalToUnit, int IsDefinition,
76 unsigned ScopeLine, unsigned Flags, int IsOptimized, LLVMValueRef Func) {
76 unsigned ScopeLine, unsigned Flags, int IsOptimized) {
7777 DIBuilder *D = unwrap(Dref);
7878 return wrap(D->createFunction(unwrap(Scope), Name, LinkageName,
7979 File ? unwrap(File) : nullptr, Line,
8080 unwrap(CompositeType),
8181 IsLocalToUnit, IsDefinition, ScopeLine, Flags,
82 IsOptimized, unwrap(Func)));
82 IsOptimized));
8383 }
8484
8585 LLVMMetadataRef
5454 LLVMDIBuilderRef D, LLVMMetadataRef Scope, const char *Name,
5555 const char *LinkageName, LLVMMetadataRef File, unsigned Line,
5656 LLVMMetadataRef CompositeType, int IsLocalToUnit, int IsDefinition,
57 unsigned ScopeLine, unsigned Flags, int IsOptimized, LLVMValueRef Function);
57 unsigned ScopeLine, unsigned Flags, int IsOptimized);
5858
5959 LLVMMetadataRef
6060 LLVMDIBuilderCreateAutoVariable(LLVMDIBuilderRef D, LLVMMetadataRef Scope,
9797 DebugLoc::get(Line, Col, Scope ? unwrap(Scope) : nullptr,
9898 InlinedAt ? unwrap(InlinedAt) : nullptr));
9999 }
100
101 void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP) {
102 unwrap(Func)->setSubprogram(unwrap(SP));
103 }
5454 unsigned Col, LLVMMetadataRef Scope,
5555 LLVMMetadataRef InlinedAt);
5656
57 void LLVMSetSubprogram(LLVMValueRef Fn, LLVMMetadataRef SP);
58
5759 #ifdef __cplusplus
5860 }
5961
188188 ScopeLine int
189189 Flags int
190190 Optimized bool
191 Function Value
192191 }
193192
194193 // CreateCompileUnit creates function debug metadata.
210209 C.unsigned(f.ScopeLine),
211210 C.unsigned(f.Flags),
212211 boolToCInt(f.Optimized),
213 f.Function.C,
214212 )
215213 return Metadata{C: result}
216214 }
10561056 func (v Value) SetPersonality(p Value) {
10571057 C.LLVMSetPersonalityFn(v.C, p.C)
10581058 }
1059 func (v Value) SetSubprogram(sp Metadata) {
1060 C.LLVMSetSubprogram(v.C, sp.C)
1061 }
10591062
10601063 // Operations on parameters
10611064 func (v Value) ParamsCount() int { return int(C.LLVMCountParams(v.C)) }
514514 /// These flags are used to emit dwarf attributes.
515515 /// \param isOptimized True if optimization is ON.
516516 /// \param Fn llvm::Function pointer.
517 /// \param TParam Function template parameters.
518 DISubprogram *
519 createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName,
520 DIFile *File, unsigned LineNo, DISubroutineType *Ty,
521 bool isLocalToUnit, bool isDefinition, unsigned ScopeLine,
522 unsigned Flags = 0, bool isOptimized = false,
523 Function *Fn = nullptr, MDNode *TParam = nullptr,
524 MDNode *Decl = nullptr);
517 /// \param TParams Function template parameters.
518 DISubprogram *createFunction(DIScope *Scope, StringRef Name,
519 StringRef LinkageName, DIFile *File,
520 unsigned LineNo, DISubroutineType *Ty,
521 bool isLocalToUnit, bool isDefinition,
522 unsigned ScopeLine, unsigned Flags = 0,
523 bool isOptimized = false,
524 DITemplateParameterArray TParams = nullptr,
525 DISubprogram *Decl = nullptr);
525526
526527 /// Identical to createFunction,
527528 /// except that the resulting DbgNode is meant to be RAUWed.
529530 DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
530531 unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
531532 bool isDefinition, unsigned ScopeLine, unsigned Flags = 0,
532 bool isOptimized = false, Function *Fn = nullptr,
533 MDNode *TParam = nullptr, MDNode *Decl = nullptr);
533 bool isOptimized = false, DITemplateParameterArray TParams = nullptr,
534 DISubprogram *Decl = nullptr);
534535
535536 /// FIXME: this is added for dragonegg. Once we update dragonegg
536537 /// to call resolve function, this will be removed.
537 DISubprogram *
538 createFunction(DIScopeRef Scope, StringRef Name, StringRef LinkageName,
539 DIFile *File, unsigned LineNo, DISubroutineType *Ty,
540 bool isLocalToUnit, bool isDefinition, unsigned ScopeLine,
541 unsigned Flags = 0, bool isOptimized = false,
542 Function *Fn = nullptr, MDNode *TParam = nullptr,
543 MDNode *Decl = nullptr);
538 DISubprogram *createFunction(DIScopeRef Scope, StringRef Name,
539 StringRef LinkageName, DIFile *File,
540 unsigned LineNo, DISubroutineType *Ty,
541 bool isLocalToUnit, bool isDefinition,
542 unsigned ScopeLine, unsigned Flags = 0,
543 bool isOptimized = false,
544 DITemplateParameterArray TParams = nullptr,
545 DISubprogram *Decl = nullptr);
544546
545547 /// Create a new descriptor for the specified C++ method.
546548 /// See comments in \a DISubprogram* for descriptions of these fields.
560562 /// This flags are used to emit dwarf attributes.
561563 /// \param isOptimized True if optimization is ON.
562564 /// \param Fn llvm::Function pointer.
563 /// \param TParam Function template parameters.
565 /// \param TParams Function template parameters.
564566 DISubprogram *
565567 createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName,
566568 DIFile *File, unsigned LineNo, DISubroutineType *Ty,
567569 bool isLocalToUnit, bool isDefinition, unsigned Virtuality = 0,
568570 unsigned VTableIndex = 0, DIType *VTableHolder = nullptr,
569571 unsigned Flags = 0, bool isOptimized = false,
570 Function *Fn = nullptr, MDNode *TParam = nullptr);
572 DITemplateParameterArray TParams = nullptr);
571573
572574 /// This creates new descriptor for a namespace with the specified
573575 /// parent scope.
142142 bool TypeMapInitialized;
143143 };
144144
145 DenseMap makeSubprogramMap(const Module &M);
146
147145 } // end namespace llvm
148146
149147 #endif
12361236 DISubroutineType *Type, bool IsLocalToUnit, bool IsDefinition,
12371237 unsigned ScopeLine, DITypeRef ContainingType, unsigned Virtuality,
12381238 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
1239 Constant *Function, DITemplateParameterArray TemplateParams,
1240 DISubprogram *Declaration, DILocalVariableArray Variables,
1241 StorageType Storage, bool ShouldCreate = true) {
1239 DITemplateParameterArray TemplateParams, DISubprogram *Declaration,
1240 DILocalVariableArray Variables, StorageType Storage,
1241 bool ShouldCreate = true) {
12421242 return getImpl(Context, Scope, getCanonicalMDString(Context, Name),
12431243 getCanonicalMDString(Context, LinkageName), File, Line, Type,
12441244 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
12451245 Virtuality, VirtualIndex, Flags, IsOptimized,
1246 Function ? ConstantAsMetadata::get(Function) : nullptr,
12471246 TemplateParams.get(), Declaration, Variables.get(), Storage,
12481247 ShouldCreate);
12491248 }
12521251 MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type,
12531252 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
12541253 Metadata *ContainingType, unsigned Virtuality, unsigned VirtualIndex,
1255 unsigned Flags, bool IsOptimized, Metadata *Function,
1256 Metadata *TemplateParams, Metadata *Declaration, Metadata *Variables,
1257 StorageType Storage, bool ShouldCreate = true);
1254 unsigned Flags, bool IsOptimized, Metadata *TemplateParams,
1255 Metadata *Declaration, Metadata *Variables, StorageType Storage,
1256 bool ShouldCreate = true);
12581257
12591258 TempDISubprogram cloneImpl() const {
1260 return getTemporary(getContext(), getScope(), getName(), getLinkageName(),
1261 getFile(), getLine(), getType(), isLocalToUnit(),
1262 isDefinition(), getScopeLine(), getContainingType(),
1263 getVirtuality(), getVirtualIndex(), getFlags(),
1264 isOptimized(), getFunctionConstant(),
1265 getTemplateParams(), getDeclaration(), getVariables());
1259 return getTemporary(
1260 getContext(), getScope(), getName(), getLinkageName(), getFile(),
1261 getLine(), getType(), isLocalToUnit(), isDefinition(), getScopeLine(),
1262 getContainingType(), getVirtuality(), getVirtualIndex(), getFlags(),
1263 isOptimized(), getTemplateParams(), getDeclaration(), getVariables());
12661264 }
12671265
12681266 public:
12721270 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
12731271 DITypeRef ContainingType, unsigned Virtuality,
12741272 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
1275 Constant *Function = nullptr,
12761273 DITemplateParameterArray TemplateParams = nullptr,
12771274 DISubprogram *Declaration = nullptr,
12781275 DILocalVariableArray Variables = nullptr),
12791276 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,
12801277 IsDefinition, ScopeLine, ContainingType, Virtuality,
1281 VirtualIndex, Flags, IsOptimized, Function, TemplateParams,
1278 VirtualIndex, Flags, IsOptimized, TemplateParams,
12821279 Declaration, Variables))
12831280 DEFINE_MDNODE_GET(
12841281 DISubprogram,
12861283 unsigned Line, Metadata *Type, bool IsLocalToUnit, bool IsDefinition,
12871284 unsigned ScopeLine, Metadata *ContainingType, unsigned Virtuality,
12881285 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
1289 Metadata *Function = nullptr, Metadata *TemplateParams = nullptr,
1290 Metadata *Declaration = nullptr, Metadata *Variables = nullptr),
1286 Metadata *TemplateParams = nullptr, Metadata *Declaration = nullptr,
1287 Metadata *Variables = nullptr),
12911288 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit, IsDefinition,
12921289 ScopeLine, ContainingType, Virtuality, VirtualIndex, Flags, IsOptimized,
1293 Function, TemplateParams, Declaration, Variables))
1290 TemplateParams, Declaration, Variables))
12941291
12951292 TempDISubprogram clone() const { return cloneImpl(); }
12961293
13491346 return DITypeRef(getRawContainingType());
13501347 }
13511348
1352 Constant *getFunctionConstant() const {
1353 if (auto *C = cast_or_null(getRawFunction()))
1354 return C->getValue();
1355 return nullptr;
1356 }
13571349 DITemplateParameterArray getTemplateParams() const {
13581350 return cast_or_null(getRawTemplateParams());
13591351 }
13671359 Metadata *getRawScope() const { return getOperand(1); }
13681360 Metadata *getRawType() const { return getOperand(5); }
13691361 Metadata *getRawContainingType() const { return getOperand(6); }
1370 Metadata *getRawFunction() const { return getOperand(7); }
1371 Metadata *getRawTemplateParams() const { return getOperand(8); }
1372 Metadata *getRawDeclaration() const { return getOperand(9); }
1373 Metadata *getRawVariables() const { return getOperand(10); }
1374
1375 /// \brief Get a pointer to the function this subprogram describes.
1376 ///
1377 /// This dyn_casts \a getFunctionConstant() to \a Function.
1378 ///
1379 /// FIXME: Should this be looking through bitcasts?
1380 Function *getFunction() const;
1381
1382 /// \brief Replace the function.
1383 ///
1384 /// If \a isUniqued() and not \a isResolved(), this could node will be
1385 /// RAUW'ed and deleted out from under the caller. Use a \a TrackingMDRef if
1386 /// that's a problem.
1387 /// @{
1388 void replaceFunction(Function *F);
1389 void replaceFunction(ConstantAsMetadata *MD) { replaceOperandWith(7, MD); }
1390 void replaceFunction(std::nullptr_t) { replaceOperandWith(7, nullptr); }
1391 /// @}
1362 Metadata *getRawTemplateParams() const { return getOperand(7); }
1363 Metadata *getRawDeclaration() const { return getOperand(8); }
1364 Metadata *getRawVariables() const { return getOperand(9); }
13921365
13931366 /// \brief Check if this subprogram describes the given function.
13941367 ///
38063806 /// isDefinition: true, scopeLine: 8, containingType: !3,
38073807 /// virtuality: DW_VIRTUALTIY_pure_virtual,
38083808 /// virtualIndex: 10, flags: 11,
3809 /// isOptimized: false, function: void ()* @_Z3foov,
3810 /// templateParams: !4, declaration: !5, variables: !6)
3809 /// isOptimized: false, templateParams: !4, declaration: !5,
3810 /// variables: !6)
38113811 bool LLParser::ParseDISubprogram(MDNode *&Result, bool IsDistinct) {
38123812 auto Loc = Lex.getLoc();
38133813 #define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
38253825 OPTIONAL(virtualIndex, MDUnsignedField, (0, UINT32_MAX)); \
38263826 OPTIONAL(flags, DIFlagField, ); \
38273827 OPTIONAL(isOptimized, MDBoolField, ); \
3828 OPTIONAL(function, MDConstant, ); \
38293828 OPTIONAL(templateParams, MDField, ); \
38303829 OPTIONAL(declaration, MDField, ); \
38313830 OPTIONAL(variables, MDField, );
38383837 "missing 'distinct', required for !DISubprogram when 'isDefinition'");
38393838
38403839 Result = GET_OR_DISTINCT(
3841 DISubprogram, (Context, scope.Val, name.Val, linkageName.Val, file.Val,
3842 line.Val, type.Val, isLocal.Val, isDefinition.Val,
3843 scopeLine.Val, containingType.Val, virtuality.Val,
3844 virtualIndex.Val, flags.Val, isOptimized.Val, function.Val,
3845 templateParams.Val, declaration.Val, variables.Val));
3840 DISubprogram,
3841 (Context, scope.Val, name.Val, linkageName.Val, file.Val, line.Val,
3842 type.Val, isLocal.Val, isDefinition.Val, scopeLine.Val,
3843 containingType.Val, virtuality.Val, virtualIndex.Val, flags.Val,
3844 isOptimized.Val, templateParams.Val, declaration.Val, variables.Val));
38463845 return false;
38473846 }
38483847
230230 bool IsMetadataMaterialized = false;
231231
232232 bool StripDebugInfo = false;
233
234 /// Functions that need to be matched with subprograms when upgrading old
235 /// metadata.
236 SmallDenseMap FunctionsWithSPs;
233237
234238 std::vector BundleTags;
235239
21812185 break;
21822186 }
21832187 case bitc::METADATA_SUBPROGRAM: {
2184 if (Record.size() != 19)
2185 return error("Invalid record");
2186
2187 MDValueList.assignValue(
2188 GET_OR_DISTINCT(
2189 DISubprogram,
2190 Record[0] || Record[8], // All definitions should be distinct.
2191 (Context, getMDOrNull(Record[1]), getMDString(Record[2]),
2192 getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
2193 getMDOrNull(Record[6]), Record[7], Record[8], Record[9],
2194 getMDOrNull(Record[10]), Record[11], Record[12], Record[13],
2195 Record[14], getMDOrNull(Record[15]), getMDOrNull(Record[16]),
2196 getMDOrNull(Record[17]), getMDOrNull(Record[18]))),
2197 NextMDValueNo++);
2188 if (Record.size() != 18 && Record.size() != 19)
2189 return error("Invalid record");
2190
2191 bool HasFn = Record.size() == 19;
2192 DISubprogram *SP = GET_OR_DISTINCT(
2193 DISubprogram,
2194 Record[0] || Record[8], // All definitions should be distinct.
2195 (Context, getMDOrNull(Record[1]), getMDString(Record[2]),
2196 getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
2197 getMDOrNull(Record[6]), Record[7], Record[8], Record[9],
2198 getMDOrNull(Record[10]), Record[11], Record[12], Record[13],
2199 Record[14], getMDOrNull(Record[15 + HasFn]),
2200 getMDOrNull(Record[16 + HasFn]), getMDOrNull(Record[17 + HasFn])));
2201 MDValueList.assignValue(SP, NextMDValueNo++);
2202
2203 // Upgrade sp->function mapping to function->sp mapping.
2204 if (HasFn && Record[15]) {
2205 if (auto *CMD = dyn_cast(getMDOrNull(Record[15])))
2206 if (auto *F = dyn_cast(CMD->getValue())) {
2207 if (F->isMaterializable())
2208 // Defer until materialized; unmaterialized functions may not have
2209 // metadata.
2210 FunctionsWithSPs[F] = SP;
2211 else if (!F->empty())
2212 F->setSubprogram(SP);
2213 }
2214 }
21982215 break;
21992216 }
22002217 case bitc::METADATA_LEXICAL_BLOCK: {
51385155 }
51395156 }
51405157
5158 // Finish fn->subprogram upgrade for materialized functions.
5159 if (DISubprogram *SP = FunctionsWithSPs.lookup(F))
5160 F->setSubprogram(SP);
5161
51415162 // Bring in any functions that this function forward-referenced via
51425163 // blockaddresses.
51435164 return materializeForwardReferencedFunctions();
10231023 Record.push_back(N->getVirtualIndex());
10241024 Record.push_back(N->getFlags());
10251025 Record.push_back(N->isOptimized());
1026 Record.push_back(VE.getMetadataOrNullID(N->getRawFunction()));
10271026 Record.push_back(VE.getMetadataOrNullID(N->getTemplateParams().get()));
10281027 Record.push_back(VE.getMetadataOrNullID(N->getDeclaration()));
10291028 Record.push_back(VE.getMetadataOrNullID(N->getVariables().get()));
475475
476476 const Module *M = MMI->getModule();
477477
478 FunctionDIs = makeSubprogramMap(*M);
479
480478 NamedMDNode *CU_Nodes = M->getNamedMetadata("llvm.dbg.cu");
481479 if (!CU_Nodes)
482480 return;
11121110 if (!MMI->hasDebugInfo())
11131111 return;
11141112
1115 auto DI = FunctionDIs.find(MF->getFunction());
1116 if (DI == FunctionDIs.end())
1113 auto DI = MF->getFunction()->getSubprogram();
1114 if (!DI)
11171115 return;
11181116
11191117 // Grab the lexical scopes for the function, if we don't have any of those
12041202 "endFunction should be called with the same function as beginFunction");
12051203
12061204 if (!MMI->hasDebugInfo() || LScopes.empty() ||
1207 !FunctionDIs.count(MF->getFunction())) {
1205 !MF->getFunction()->getSubprogram()) {
12081206 // If we don't have a lexical scope for this function then there will
12091207 // be a hole in the range information. Keep note of this by setting the
12101208 // previously used section to nullptr.
760760 bool LiveDebugVariables::runOnMachineFunction(MachineFunction &mf) {
761761 if (!EnableLDV)
762762 return false;
763 if (!FunctionDIs.count(mf.getFunction())) {
763 if (!mf.getFunction()->getSubprogram()) {
764764 removeDebugValues(mf);
765765 return false;
766766 }
10441044 }
10451045
10461046 bool LiveDebugVariables::doInitialization(Module &M) {
1047 FunctionDIs = makeSubprogramMap(M);
10481047 return Pass::doInitialization(M);
10491048 }
10501049
16911691 Printer.printInt("virtualIndex", N->getVirtualIndex());
16921692 Printer.printDIFlags("flags", N->getFlags());
16931693 Printer.printBool("isOptimized", N->isOptimized());
1694 Printer.printMetadata("function", N->getRawFunction());
16951694 Printer.printMetadata("templateParams", N->getRawTemplateParams());
16961695 Printer.printMetadata("declaration", N->getRawDeclaration());
16971696 Printer.printMetadata("variables", N->getRawVariables());
658658 return DIExpression::get(VMContext, Addr);
659659 }
660660
661 DISubprogram *DIBuilder::createFunction(DIScopeRef Context, StringRef Name,
662 StringRef LinkageName, DIFile *File,
663 unsigned LineNo, DISubroutineType *Ty,
664 bool isLocalToUnit, bool isDefinition,
665 unsigned ScopeLine, unsigned Flags,
666 bool isOptimized, Function *Fn,
667 MDNode *TParams, MDNode *Decl) {
661 DISubprogram *DIBuilder::createFunction(
662 DIScopeRef Context, StringRef Name, StringRef LinkageName, DIFile *File,
663 unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
664 bool isDefinition, unsigned ScopeLine, unsigned Flags, bool isOptimized,
665 DITemplateParameterArray TParams, DISubprogram *Decl) {
668666 // dragonegg does not generate identifier for types, so using an empty map
669667 // to resolve the context should be fine.
670668 DITypeIdentifierMap EmptyMap;
671669 return createFunction(Context.resolve(EmptyMap), Name, LinkageName, File,
672670 LineNo, Ty, isLocalToUnit, isDefinition, ScopeLine,
673 Flags, isOptimized, Fn, TParams, Decl);
671 Flags, isOptimized, TParams, Decl);
674672 }
675673
676674 template
680678 return DISubprogram::get(std::forward(Args)...);
681679 }
682680
683 DISubprogram *DIBuilder::createFunction(DIScope *Context, StringRef Name,
684 StringRef LinkageName, DIFile *File,
685 unsigned LineNo, DISubroutineType *Ty,
686 bool isLocalToUnit, bool isDefinition,
687 unsigned ScopeLine, unsigned Flags,
688 bool isOptimized, Function *Fn,
689 MDNode *TParams, MDNode *Decl) {
690 auto *Node = getSubprogram(/* IsDistinct = */ isDefinition, VMContext,
691 DIScopeRef::get(getNonCompileUnitScope(Context)),
692 Name, LinkageName, File, LineNo, Ty, isLocalToUnit,
693 isDefinition, ScopeLine, nullptr, 0, 0, Flags,
694 isOptimized, Fn, cast_or_null(TParams),
695 cast_or_null(Decl),
696 MDTuple::getTemporary(VMContext, None).release());
681 DISubprogram *DIBuilder::createFunction(
682 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
683 unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
684 bool isDefinition, unsigned ScopeLine, unsigned Flags, bool isOptimized,
685 DITemplateParameterArray TParams, DISubprogram *Decl) {
686 auto *Node =
687 getSubprogram(/* IsDistinct = */ isDefinition, VMContext,
688 DIScopeRef::get(getNonCompileUnitScope(Context)), Name,
689 LinkageName, File, LineNo, Ty, isLocalToUnit, isDefinition,
690 ScopeLine, nullptr, 0, 0, Flags, isOptimized, TParams, Decl,
691 MDTuple::getTemporary(VMContext, None).release());
697692
698693 if (isDefinition)
699694 AllSubprograms.push_back(Node);
705700 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
706701 unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
707702 bool isDefinition, unsigned ScopeLine, unsigned Flags, bool isOptimized,
708 Function *Fn, MDNode *TParams, MDNode *Decl) {
703 DITemplateParameterArray TParams, DISubprogram *Decl) {
709704 return DISubprogram::getTemporary(
710705 VMContext, DIScopeRef::get(getNonCompileUnitScope(Context)), Name,
711706 LinkageName, File, LineNo, Ty, isLocalToUnit, isDefinition,
712 ScopeLine, nullptr, 0, 0, Flags, isOptimized, Fn,
713 cast_or_null(TParams), cast_or_null(Decl),
707 ScopeLine, nullptr, 0, 0, Flags, isOptimized, TParams, Decl,
714708 nullptr)
715709 .release();
716710 }
720714 DIFile *F, unsigned LineNo, DISubroutineType *Ty,
721715 bool isLocalToUnit, bool isDefinition, unsigned VK,
722716 unsigned VIndex, DIType *VTableHolder, unsigned Flags,
723 bool isOptimized, Function *Fn, MDNode *TParam) {
717 bool isOptimized, DITemplateParameterArray TParams) {
724718 assert(getNonCompileUnitScope(Context) &&
725719 "Methods should have both a Context and a context that isn't "
726720 "the compile unit.");
727721 // FIXME: Do we want to use different scope/lines?
728 auto *SP = getSubprogram(/* IsDistinct = */ isDefinition, VMContext,
729 DIScopeRef::get(cast(Context)), Name,
730 LinkageName, F, LineNo, Ty, isLocalToUnit,
731 isDefinition, LineNo, DITypeRef::get(VTableHolder),
732 VK, VIndex, Flags, isOptimized, Fn,
733 cast_or_null(TParam), nullptr, nullptr);
722 auto *SP = getSubprogram(
723 /* IsDistinct = */ isDefinition, VMContext,
724 DIScopeRef::get(cast(Context)), Name, LinkageName, F, LineNo, Ty,
725 isLocalToUnit, isDefinition, LineNo, DITypeRef::get(VTableHolder), VK,
726 VIndex, Flags, isOptimized, TParams, nullptr, nullptr);
734727
735728 if (isDefinition)
736729 AllSubprograms.push_back(SP);
299299
300300 bool llvm::stripDebugInfo(Function &F) {
301301 bool Changed = false;
302 if (F.getSubprogram()) {
303 Changed = true;
304 F.setSubprogram(nullptr);
305 }
302306 for (BasicBlock &BB : F) {
303307 for (Instruction &I : BB) {
304308 if (I.getDebugLoc()) {
358362 return Val->getZExtValue();
359363 return 0;
360364 }
361
362 DenseMap
363 llvm::makeSubprogramMap(const Module &M) {
364 DenseMap R;
365
366 NamedMDNode *CU_Nodes = M.getNamedMetadata("llvm.dbg.cu");
367 if (!CU_Nodes)
368 return R;
369
370 for (MDNode *N : CU_Nodes->operands()) {
371 auto *CUNode = cast(N);
372 for (auto *SP : CUNode->getSubprograms()) {
373 if (Function *F = SP->getFunction())
374 R.insert(std::make_pair(F, SP));
375 }
376 }
377 return R;
378 }
341341 MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type,
342342 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
343343 Metadata *ContainingType, unsigned Virtuality, unsigned VirtualIndex,
344 unsigned Flags, bool IsOptimized, Metadata *Function,
345 Metadata *TemplateParams, Metadata *Declaration, Metadata *Variables,
346 StorageType Storage, bool ShouldCreate) {
344 unsigned Flags, bool IsOptimized, Metadata *TemplateParams,
345 Metadata *Declaration, Metadata *Variables, StorageType Storage,
346 bool ShouldCreate) {
347347 assert(isCanonical(Name) && "Expected canonical MDString");
348348 assert(isCanonical(LinkageName) && "Expected canonical MDString");
349349 DEFINE_GETIMPL_LOOKUP(DISubprogram,
350350 (Scope, getString(Name), getString(LinkageName), File,
351351 Line, Type, IsLocalToUnit, IsDefinition, ScopeLine,
352352 ContainingType, Virtuality, VirtualIndex, Flags,
353 IsOptimized, Function, TemplateParams, Declaration,
354 Variables));
355 Metadata *Ops[] = {File, Scope, Name, Name,
356 LinkageName, Type, ContainingType, Function,
357 TemplateParams, Declaration, Variables};
353 IsOptimized, TemplateParams, Declaration, Variables));
354 Metadata *Ops[] = {File, Scope, Name, Name,
355 LinkageName, Type, ContainingType, TemplateParams,
356 Declaration, Variables};
358357 DEFINE_GETIMPL_STORE(DISubprogram,
359358 (Line, ScopeLine, Virtuality, VirtualIndex, Flags,
360359 IsLocalToUnit, IsDefinition, IsOptimized),
361360 Ops);
362361 }
363362
364 Function *DISubprogram::getFunction() const {
365 // FIXME: Should this be looking through bitcasts?
366 return dyn_cast_or_null(getFunctionConstant());
367 }
368
369363 bool DISubprogram::describes(const Function *F) const {
370364 assert(F && "Invalid function");
371 if (F == getFunction())
365 if (F->getSubprogram() == this)
372366 return true;
373367 StringRef Name = getLinkageName();
374368 if (Name.empty())
375369 Name = getName();
376370 return F->getName() == Name;
377 }
378
379 void DISubprogram::replaceFunction(Function *F) {
380 replaceFunction(F ? ConstantAsMetadata::get(F)
381 : static_cast(nullptr));
382371 }
383372
384373 DILexicalBlock *DILexicalBlock::getImpl(LLVMContext &Context, Metadata *Scope,
472472 unsigned VirtualIndex;
473473 unsigned Flags;
474474 bool IsOptimized;
475 Metadata *Function;
476475 Metadata *TemplateParams;
477476 Metadata *Declaration;
478477 Metadata *Variables;
482481 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
483482 Metadata *ContainingType, unsigned Virtuality,
484483 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
485 Metadata *Function, Metadata *TemplateParams,
486 Metadata *Declaration, Metadata *Variables)
484 Metadata *TemplateParams, Metadata *Declaration,
485 Metadata *Variables)
487486 : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
488487 Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit),
489488 IsDefinition(IsDefinition), ScopeLine(ScopeLine),
490489 ContainingType(ContainingType), Virtuality(Virtuality),
491490 VirtualIndex(VirtualIndex), Flags(Flags), IsOptimized(IsOptimized),
492 Function(Function), TemplateParams(TemplateParams),
493 Declaration(Declaration), Variables(Variables) {}
491 TemplateParams(TemplateParams), Declaration(Declaration),
492 Variables(Variables) {}
494493 MDNodeKeyImpl(const DISubprogram *N)
495494 : Scope(N->getRawScope()), Name(N->getName()),
496495 LinkageName(N->getLinkageName()), File(N->getRawFile()),
499498 ScopeLine(N->getScopeLine()), ContainingType(N->getRawContainingType()),
500499 Virtuality(N->getVirtuality()), VirtualIndex(N->getVirtualIndex()),
501500 Flags(N->getFlags()), IsOptimized(N->isOptimized()),
502 Function(N->getRawFunction()),
503501 TemplateParams(N->getRawTemplateParams()),
504502 Declaration(N->getRawDeclaration()), Variables(N->getRawVariables()) {}
505503
514512 Virtuality == RHS->getVirtuality() &&
515513 VirtualIndex == RHS->getVirtualIndex() && Flags == RHS->getFlags() &&
516514 IsOptimized == RHS->isOptimized() &&
517 Function == RHS->getRawFunction() &&
518515 TemplateParams == RHS->getRawTemplateParams() &&
519516 Declaration == RHS->getRawDeclaration() &&
520517 Variables == RHS->getRawVariables();
522519 unsigned getHashValue() const {
523520 return hash_combine(Scope, Name, LinkageName, File, Line, Type,
524521 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
525 Virtuality, VirtualIndex, Flags, IsOptimized, Function,
522 Virtuality, VirtualIndex, Flags, IsOptimized,
526523 TemplateParams, Declaration, Variables);
527524 }
528525 };
936936 Assert(isa(T), "invalid subroutine type", &N, T);
937937 Assert(isTypeRef(N, N.getRawContainingType()), "invalid containing type", &N,
938938 N.getRawContainingType());
939 if (auto *RawF = N.getRawFunction()) {
940 auto *FMD = dyn_cast(RawF);
941 auto *F = FMD ? FMD->getValue() : nullptr;
942 auto *FT = F ? dyn_cast(F->getType()) : nullptr;
943 Assert(F && FT && isa(FT->getElementType()),
944 "invalid function", &N, F, FT);
945 }
946939 if (auto *Params = N.getRawTemplateParams())
947940 visitTemplateParams(N, *Params);
948941 if (auto *S = N.getRawDeclaration()) {
962955
963956 if (N.isDefinition())
964957 Assert(N.isDistinct(), "subprogram definitions must be distinct", &N);
965
966 auto *F = N.getFunction();
967 if (!F)
968 return;
969
970 // Check that all !dbg attachments lead to back to N (or, at least, another
971 // subprogram that describes the same function).
972 //
973 // FIXME: Check this incrementally while visiting !dbg attachments.
974 // FIXME: Only check when N is the canonical subprogram for F.
975 SmallPtrSet Seen;
976 for (auto &BB : *F)
977 for (auto &I : BB) {
978 // Be careful about using DILocation here since we might be dealing with
979 // broken code (this is the Verifier after all).
980 DILocation *DL =
981 dyn_cast_or_null(I.getDebugLoc().getAsMDNode());
982 if (!DL)
983 continue;
984 if (!Seen.insert(DL).second)
985 continue;
986
987 DILocalScope *Scope = DL->getInlinedAtScope();
988 if (Scope && !Seen.insert(Scope).second)
989 continue;
990
991 DISubprogram *SP = Scope ? Scope->getSubprogram() : nullptr;
992 if (SP && !Seen.insert(SP).second)
993 continue;
994
995 // FIXME: Once N is canonical, check "SP == &N".
996 Assert(SP->describes(F),
997 "!dbg attachment points at wrong subprogram for function", &N, F,
998 &I, DL, Scope, SP);
999 }
1000958 }
1001959
1002960 void Verifier::visitDILexicalBlockBase(const DILexicalBlockBase &N) {
18111769 (F.isDeclaration() && F.hasExternalLinkage()) ||
18121770 F.hasAvailableExternallyLinkage(),
18131771 "Function is marked as dllimport, but not external.", &F);
1772
1773 auto *N = F.getSubprogram();
1774 if (!N)
1775 return;
1776
1777 // Check that all !dbg attachments lead to back to N (or, at least, another
1778 // subprogram that describes the same function).
1779 //
1780 // FIXME: Check this incrementally while visiting !dbg attachments.
1781 // FIXME: Only check when N is the canonical subprogram for F.
1782 SmallPtrSet Seen;
1783 for (auto &BB : F)
1784 for (auto &I : BB) {
1785 // Be careful about using DILocation here since we might be dealing with
1786 // broken code (this is the Verifier after all).
1787 DILocation *DL =
1788 dyn_cast_or_null(I.getDebugLoc().getAsMDNode());
1789 if (!DL)
1790 continue;
1791 if (!Seen.insert(DL).second)
1792 continue;
1793
1794 DILocalScope *Scope = DL->getInlinedAtScope();
1795 if (Scope && !Seen.insert(Scope).second)
1796 continue;
1797
1798 DISubprogram *SP = Scope ? Scope->getSubprogram() : nullptr;
1799 if (SP && !Seen.insert(SP).second)
1800 continue;
1801
1802 // FIXME: Once N is canonical, check "SP == &N".
1803 Assert(SP->describes(&F),
1804 "!dbg attachment points at wrong subprogram for function", N, &F,
1805 &I, DL, Scope, SP);
1806 }
18141807 }
18151808
18161809 // verifyBasicBlock - Verify that a basic block is well formed...
420420 // Vector of GlobalValues to lazily link in.
421421 std::vector LazilyLinkGlobalValues;
422422
423 /// Functions that have replaced other functions.
424 SmallPtrSet OverridingFunctions;
425
426423 DiagnosticHandlerFunction DiagnosticHandler;
427424
428425 /// For symbol clashes, prefer those from Src.
580577 const GlobalValue *DGV = nullptr);
581578
582579 void linkNamedMDNodes();
583 void stripReplacedSubprograms();
584580 };
585581 }
586582
14151411 }
14161412
14171413 NewGV = copyGlobalValueProto(TypeMap, SGV, DGV);
1418
1419 if (DGV && isa(DGV))
1420 if (auto *NewF = dyn_cast(NewGV))
1421 OverridingFunctions.insert(NewF);
14221414 }
14231415
14241416 NewGV->setUnnamedAddr(HasUnnamedAddr);
15991591 for (const MDNode *op : NMD.operands())
16001592 DestNMD->addOperand(MapMetadata(op, ValueMap, RF_MoveDistinctMDs,
16011593 &TypeMap, &ValMaterializer));
1602 }
1603 }
1604
1605 /// Drop DISubprograms that have been superseded.
1606 ///
1607 /// FIXME: this creates an asymmetric result: we strip functions from losing
1608 /// subprograms in DstM, but leave losing subprograms in SrcM.
1609 /// TODO: Remove this logic once the backend can correctly determine canonical
1610 /// subprograms.
1611 void ModuleLinker::stripReplacedSubprograms() {
1612 // Avoid quadratic runtime by returning early when there's nothing to do.
1613 if (OverridingFunctions.empty())
1614 return;
1615
1616 // Move the functions now, so the set gets cleared even on early returns.
1617 auto Functions = std::move(OverridingFunctions);
1618 OverridingFunctions.clear();
1619
1620 // Drop functions from subprograms if they've been overridden by the new
1621 // compile unit.
1622 NamedMDNode *CompileUnits = DstM->getNamedMetadata("llvm.dbg.cu");
1623 if (!CompileUnits)
1624 return;
1625 for (unsigned I = 0, E = CompileUnits->getNumOperands(); I != E; ++I) {
1626 auto *CU = cast(CompileUnits->getOperand(I));
1627 assert(CU && "Expected valid compile unit");
1628
1629 for (DISubprogram *SP : CU->getSubprograms()) {
1630 if (!SP || !SP->getFunction() || !Functions.count(SP->getFunction()))
1631 continue;
1632
1633 // Prevent DebugInfoFinder from tagging this as the canonical subprogram,
1634 // since the canonical one is in the incoming module.
1635 SP->replaceFunction(nullptr);
1636 }
16371594 }
16381595 }
16391596
19081865 MapValue(GV, ValueMap, RF_MoveDistinctMDs, &TypeMap, &ValMaterializer);
19091866 }
19101867
1911 // Strip replaced subprograms before mapping any metadata -- so that we're
1912 // not changing metadata from the source module (note that
1913 // linkGlobalValueBody() eventually calls RemapInstruction() and therefore
1914 // MapMetadata()) -- but after linking global value protocols -- so that
1915 // OverridingFunctions has been built.
1916 stripReplacedSubprograms();
1917
19181868 // Link in the function bodies that are defined in the source module into
19191869 // DstM.
19201870 for (Function &SF : *SrcM) {
9494 bool doInitialization(CallGraph &CG) override;
9595 /// The maximum number of elements to expand, or 0 for unlimited.
9696 unsigned maxElements;
97 DenseMap FunctionDIs;
9897 };
9998 }
10099
731730 NF->copyAttributesFrom(F);
732731
733732 // Patch the pointer to LLVM function in debug info descriptor.
734 auto DI = FunctionDIs.find(F);
735 if (DI != FunctionDIs.end()) {
736 DISubprogram *SP = DI->second;
737 SP->replaceFunction(NF);
738 // Ensure the map is updated so it can be reused on subsequent argument
739 // promotions of the same function.
740 FunctionDIs.erase(DI);
741 FunctionDIs[NF] = SP;
742 }
733 NF->setSubprogram(F->getSubprogram());
734 F->setSubprogram(nullptr);
743735
744736 DEBUG(dbgs() << "ARG PROMOTION: Promoting to:" << *NF << "\n"
745737 << "From: " << *F);
10221014 }
10231015
10241016 bool ArgPromotion::doInitialization(CallGraph &CG) {
1025 FunctionDIs = makeSubprogramMap(CG.getModule());
10261017 return CallGraphSCCPass::doInitialization(CG);
10271018 }
121121
122122 typedef SmallVector UseVector;
123123
124 // Map each LLVM function to corresponding metadata with debug info. If
125 // the function is replaced with another one, we should patch the pointer
126 // to LLVM function in metadata.
127 // As the code generation for module is finished (and DIBuilder is
128 // finalized) we assume that subprogram descriptors won't be changed, and
129 // they are stored in map for short duration anyway.
130 DenseMap FunctionDIs;
131
132124 protected:
133125 // DAH uses this to specify a different ID.
134126 explicit DAE(char &ID) : ModulePass(ID) {}
308300 }
309301
310302 // Patch the pointer to LLVM function in debug info descriptor.
311 auto DI = FunctionDIs.find(&Fn);
312 if (DI != FunctionDIs.end()) {
313 DISubprogram *SP = DI->second;
314 SP->replaceFunction(NF);
315 // Ensure the map is updated so it can be reused on non-varargs argument
316 // eliminations of the same function.
317 FunctionDIs.erase(DI);
318 FunctionDIs[NF] = SP;
319 }
303 NF->setSubprogram(Fn.getSubprogram());
320304
321305 // Fix up any BlockAddresses that refer to the function.
322306 Fn.replaceAllUsesWith(ConstantExpr::getBitCast(NF, Fn.getType()));
10961080 }
10971081
10981082 // Patch the pointer to LLVM function in debug info descriptor.
1099 auto DI = FunctionDIs.find(F);
1100 if (DI != FunctionDIs.end())
1101 DI->second->replaceFunction(NF);
1083 NF->setSubprogram(F->getSubprogram());
11021084
11031085 // Now that the old function is dead, delete it.
11041086 F->eraseFromParent();
11081090
11091091 bool DAE::runOnModule(Module &M) {
11101092 bool Changed = false;
1111
1112 // Collect debug info descriptors for functions.
1113 FunctionDIs = makeSubprogramMap(M);
11141093
11151094 // First pass: Do a simple check to see if any functions can have their "..."
11161095 // removed. We can do this if they never call va_start. This loop cannot be
304304 SmallVector LiveSubprograms;
305305 DenseSet VisitedSet;
306306
307 std::set LiveSPs;
308 for (Function &F : M) {
309 if (DISubprogram *SP = F.getSubprogram())
310 LiveSPs.insert(SP);
311 }
312
307313 for (DICompileUnit *DIC : F.compile_units()) {
308314 // Create our live subprogram list.
309315 bool SubprogramChange = false;
313319 continue;
314320
315321 // If the function referenced by DISP is not null, the function is live.
316 if (DISP->getFunction())
322 if (LiveSPs.count(DISP))
317323 LiveSubprograms.push_back(DISP);
318324 else
319325 SubprogramChange = true;
257257 DFSanABIList ABIList;
258258 DenseMap UnwrappedFnMap;
259259 AttributeSet ReadOnlyNoneAttrs;
260 DenseMap FunctionDIs;
261260
262261 Value *getShadowAddress(Value *Addr, Instruction *Pos);
263262 bool isInstrumented(const Function *F);
608607 bool DataFlowSanitizer::runOnModule(Module &M) {
609608 if (ABIList.isIn(M, "skip"))
610609 return false;
611
612 FunctionDIs = makeSubprogramMap(M);
613610
614611 if (!GetArgTLSPtr) {
615612 Type *ArgTLSTy = ArrayType::get(ShadowTy, 64);
767764 ConstantExpr::getBitCast(NewF, PointerType::getUnqual(FT));
768765 F.replaceAllUsesWith(WrappedFnCst);
769766
770 // Patch the pointer to LLVM function in debug info descriptor.
771 auto DI = FunctionDIs.find(&F);
772 if (DI != FunctionDIs.end())
773 DI->second->replaceFunction(&F);
774
775767 UnwrappedFnMap[WrappedFnCst] = &F;
776768 *i = NewF;
777769
137137 Module *M;
138138 LLVMContext *Ctx;
139139 SmallVector, 16> Funcs;
140 DenseMap FnMap;
140141 };
141142 }
142143
308309 // object users can construct, the blocks and lines will be rooted here.
309310 class GCOVFunction : public GCOVRecord {
310311 public:
311 GCOVFunction(const DISubprogram *SP, raw_ostream *os, uint32_t Ident,
312 bool UseCfgChecksum, bool ExitBlockBeforeBody)
312 GCOVFunction(const DISubprogram *SP, Function *F, raw_ostream *os,
313 uint32_t Ident, bool UseCfgChecksum, bool ExitBlockBeforeBody)
313314 : SP(SP), Ident(Ident), UseCfgChecksum(UseCfgChecksum), CfgChecksum(0),
314315 ReturnBlock(1, os) {
315316 this->os = os;
316317
317 Function *F = SP->getFunction();
318318 DEBUG(dbgs() << "Function: " << getFunctionName(SP) << "\n");
319319
320320 uint32_t i = 0;
449449 this->M = &M;
450450 Ctx = &M.getContext();
451451
452 FnMap.clear();
453 for (Function &F : M) {
454 if (DISubprogram *SP = F.getSubprogram())
455 FnMap[SP] = &F;
456 }
457
452458 if (Options.EmitNotes) emitProfileNotes();
453459 if (Options.EmitData) return emitProfileArcs();
454460 return false;
493499
494500 unsigned FunctionIdent = 0;
495501 for (auto *SP : CU->getSubprograms()) {
496 Function *F = SP->getFunction();
502 Function *F = FnMap[SP];
497503 if (!F) continue;
498504 if (!functionHasLines(F)) continue;
499505
505511 ++It;
506512 EntryBlock.splitBasicBlock(It);
507513
508 Funcs.push_back(make_unique(SP, &out, FunctionIdent++,
514 Funcs.push_back(make_unique(SP, F, &out, FunctionIdent++,
509515 Options.UseCfgChecksum,
510516 Options.ExitBlockBeforeBody));
511517 GCOVFunction &Func = *Funcs.back();
572578 auto *CU = cast(CU_Nodes->getOperand(i));
573579 SmallVector, 8> CountersBySP;
574580 for (auto *SP : CU->getSubprograms()) {
575 Function *F = SP->getFunction();
581 Function *F = FnMap[SP];
576582 if (!F) continue;
577583 if (!functionHasLines(F)) continue;
578584 if (!Result) Result = true;
187187 const DISubprogram *OldSubprogramMDNode = FindSubprogram(OldFunc, Finder);
188188 if (!OldSubprogramMDNode) return;
189189
190 // Ensure that OldFunc appears in the map.
191 // (if it's already there it must point to NewFunc anyway)
192 VMap[OldFunc] = NewFunc;
193190 auto *NewSubprogram =
194191 cast(MapMetadata(OldSubprogramMDNode, VMap));
192 NewFunc->setSubprogram(NewSubprogram);
195193
196194 for (auto *CU : Finder.compile_units()) {
197195 auto Subprograms = CU->getSubprograms();
99 @TestArrayPtr = global %struct.test* getelementptr inbounds ([10 x %struct.test], [10 x %struct.test]* @TestArray, i64 0, i64 3) ; <%struct.test**> [#uses=1]
1010 @TestArray = common global [10 x %struct.test] zeroinitializer, align 32 ; <[10 x %struct.test]*> [#uses=2]
1111
12 define i32 @main() nounwind readonly {
12 define i32 @main() nounwind readonly !dbg !1 {
1313 %diff1 = alloca i64 ; [#uses=2]
1414 ; CHECK: call void @llvm.dbg.value(metadata i64 72,
1515 call void @llvm.dbg.declare(metadata i64* %diff1, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
2626 !7 = !{!1}
2727 !6 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131941)", isOptimized: true, emissionKind: 0, file: !8, enums: !9, retainedTypes: !9, subprograms: !7)
2828 !0 = !DILocalVariable(name: "c", line: 2, scope: !1, file: !2, type: !5)
29 !1 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !8, scope: !2, type: !3, function: i32 ()* @main)
29 !1 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !8, scope: !2, type: !3)
3030 !2 = !DIFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b")
3131 !3 = !DISubroutineType(types: !4)
3232 !4 = !{!5}
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
11 ; RUN: verify-uselistorder %s
22
3 declare void @_Z3foov()
3 ; CHECK: define void @_Z3foov() !dbg !9
4 define void @_Z3foov() !dbg !9 {
5 ret void
6 }
47
58 ; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
69 !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
1922 ; CHECK: !8 = !DISubprogram(scope: null, isLocal: false, isDefinition: false, isOptimized: false)
2023 !8 = !DISubprogram(isDefinition: false)
2124
22 ; CHECK: !9 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, templateParams: !5, declaration: !8, variables: !6)
25 ; CHECK: !9 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, templateParams: !5, declaration: !8, variables: !6)
2326 !9 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
2427 file: !2, line: 7, type: !3, isLocal: true,
2528 isDefinition: true, scopeLine: 8, containingType: !4,
2629 virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10,
27 flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov,
30 flags: DIFlagPrototyped, isOptimized: true,
2831 templateParams: !5, declaration: !8, variables: !6)
32
33 !10 = !{i32 1, !"Debug Info Version", i32 3}
34 !llvm.module.flags = !{!10}
11 ; RUN: llvm-dis < %t.bc | FileCheck %s
22 ; RUN: verify-uselistorder < %t.bc
33
4 define i32 @main() {
4 define i32 @main() !dbg !4 {
55 entry:
66 %retval = alloca i32, align 4
77 store i32 0, i32* %retval
1515 !1 = !DIFile(filename: "../llvm/tools/clang/test/CodeGen/debug-info-version.c", directory: "/Users/manmanren/llvm_gmail/release")
1616 !2 = !{i32 0}
1717 !3 = !{!4}
18 !4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2)
18 !4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)
1919 !5 = !DIFile(filename: "../llvm/tools/clang/test/CodeGen/debug-info-version.c", directory: "/Users/manmanren/llvm_gmail/release")
2020 !6 = !DISubroutineType(types: !7)
2121 !7 = !{!8}
0 ; RUN: llvm-dis < %s.bc | FileCheck %s
1 ; RUN: verify-uselistorder < %s.bc
2
3 ; CHECK: define void @foo() !dbg [[SP:![0-9]+]]
4 define void @foo() {
5 ret void
6 }
7
8 !llvm.module.flags = !{!0}
9 !0 = !{i32 2, !"Debug Info Version", i32 3}
10
11 !llvm.dbg.cu = !{!1}
12 !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3}, emissionKind: 1)
13 !2 = !DIFile(filename: "foo.c", directory: "/path/to/dir")
14 ; CHECK: [[SP]] = distinct !DISubprogram
15 !3 = distinct !DISubprogram(file: !2, scope: !2, line: 51, name: "foo", function: void ()* @foo, type: !4)
16 !4 = !DISubroutineType(types: !{})
22 ; Bug 20598
33
44
5 define void @test() #0 {
5 define void @test() #0 !dbg !4 {
66 entry:
77 br label %for.body, !dbg !39
88
4747 !1 = !DIFile(filename: "test.c", directory: "")
4848 !2 = !{}
4949 !3 = !{!4}
50 !4 = distinct !DISubprogram(name: "", line: 140, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 141, file: !1, scope: !1, type: !6, function: void ()* @test, variables: !12)
50 !4 = distinct !DISubprogram(name: "", line: 140, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 141, file: !1, scope: !1, type: !6, variables: !12)
5151 !6 = !DISubroutineType(types: !7)
5252 !7 = !{null, !8}
5353 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)
44 ; CHECK: DEBUG_VALUE: test_debug_value:globalptr_arg <- SGPR0_SGPR1
55 ; CHECK: buffer_store_dword
66 ; CHECK: s_endpgm
7 define void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 {
7 define void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 !dbg !4 {
88 entry:
99 tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %globalptr_arg, i64 0, metadata !10, metadata !13), !dbg !14
1010 store i32 123, i32 addrspace(1)* %globalptr_arg, align 4
2323 !1 = !DIFile(filename: "/tmp/test_debug_value.cl", directory: "/Users/matt/src/llvm/build_debug")
2424 !2 = !{}
2525 !3 = !{!4}
26 !4 = distinct !DISubprogram(name: "test_debug_value", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, function: void (i32 addrspace(1)*)* @test_debug_value, variables: !9)
26 !4 = distinct !DISubprogram(name: "test_debug_value", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !9)
2727 !5 = !DISubroutineType(types: !6)
2828 !6 = !{null, !7}
2929 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 32)
22
33 %struct.SVal = type { i8*, i32 }
44
5 define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) nounwind ssp {
5 define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) nounwind ssp !dbg !17 {
66 entry:
77 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
88 call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !23, metadata !DIExpression()), !dbg !24
3030 ret i32 %.0, !dbg !29
3131 }
3232
33 define linkonce_odr void @_ZN4SValC1Ev(%struct.SVal* %this) nounwind ssp align 2 {
33 define linkonce_odr void @_ZN4SValC1Ev(%struct.SVal* %this) nounwind ssp align 2 !dbg !16 {
3434 entry:
3535 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
3636 call void @llvm.dbg.value(metadata %struct.SVal* %this, i64 0, metadata !31, metadata !DIExpression()), !dbg !34
4646
4747 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
4848
49 define i32 @main() nounwind ssp {
49 define i32 @main() nounwind ssp !dbg !20 {
5050 entry:
5151 %0 = alloca %struct.SVal ; <%struct.SVal*> [#uses=3]
5252 %v = alloca %struct.SVal ; <%struct.SVal*> [#uses=4]
9292 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
9393 !14 = !DISubroutineType(types: !15)
9494 !15 = !{null, !12}
95 !16 = distinct !DISubprogram(name: "SVal", linkageName: "_ZN4SValC1Ev", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !48, scope: !1, type: !14, function: void (%struct.SVal*)* @_ZN4SValC1Ev)
96 !17 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi4SVal", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !48, scope: !2, type: !18, function: i32 (i32, %struct.SVal*)* @_Z3fooi4SVal)
95 !16 = distinct !DISubprogram(name: "SVal", linkageName: "_ZN4SValC1Ev", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !48, scope: !1, type: !14)
96 !17 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi4SVal", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !48, scope: !2, type: !18)
9797 !18 = !DISubroutineType(types: !19)
9898 !19 = !{!13, !13, !1}
99 !20 = distinct !DISubprogram(name: "main", linkageName: "main", line: 23, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !48, scope: !2, type: !21, function: i32 ()* @main)
99 !20 = distinct !DISubprogram(name: "main", linkageName: "main", line: 23, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !48, scope: !2, type: !21)
100100 !21 = !DISubroutineType(types: !22)
101101 !22 = !{!13}
102102 !23 = !DILocalVariable(name: "i", line: 16, arg: 1, scope: !17, file: !2, type: !13)
2727 ; CHECK-NOT: {{DW_TAG|NULL}}
2828 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR]] 10 01 22 )
2929
30 define zeroext i8 @get1(i8 zeroext %a) nounwind optsize {
30 define zeroext i8 @get1(i8 zeroext %a) nounwind optsize !dbg !0 {
3131 entry:
3232 tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !30
3333 %0 = load i8, i8* @x1, align 4, !dbg !30
3838
3939 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
4040
41 define zeroext i8 @get2(i8 zeroext %a) nounwind optsize {
41 define zeroext i8 @get2(i8 zeroext %a) nounwind optsize !dbg !6 {
4242 entry:
4343 tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !18, metadata !DIExpression()), !dbg !32
4444 %0 = load i8, i8* @x2, align 4, !dbg !32
4747 ret i8 %0, !dbg !33
4848 }
4949
50 define zeroext i8 @get3(i8 zeroext %a) nounwind optsize {
50 define zeroext i8 @get3(i8 zeroext %a) nounwind optsize !dbg !7 {
5151 entry:
5252 tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !21, metadata !DIExpression()), !dbg !34
5353 %0 = load i8, i8* @x3, align 4, !dbg !34
5656 ret i8 %0, !dbg !35
5757 }
5858
59 define zeroext i8 @get4(i8 zeroext %a) nounwind optsize {
59 define zeroext i8 @get4(i8 zeroext %a) nounwind optsize !dbg !8 {
6060 entry:
6161 tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !24, metadata !DIExpression()), !dbg !36
6262 %0 = load i8, i8* @x4, align 4, !dbg !36
6565 ret i8 %0, !dbg !37
6666 }
6767
68 define zeroext i8 @get5(i8 zeroext %a) nounwind optsize {
68 define zeroext i8 @get5(i8 zeroext %a) nounwind optsize !dbg !9 {
6969 entry:
7070 tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !27, metadata !DIExpression()), !dbg !38
7171 %0 = load i8, i8* @x5, align 4, !dbg !38
7777 !llvm.dbg.cu = !{!2}
7878 !llvm.module.flags = !{!49}
7979
80 !0 = distinct !DISubprogram(name: "get1", linkageName: "get1", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !47, scope: !1, type: !3, function: i8 (i8)* @get1, variables: !42)
80 !0 = distinct !DISubprogram(name: "get1", linkageName: "get1", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !47, scope: !1, type: !3, variables: !42)
8181 !1 = !DIFile(filename: "foo.c", directory: "/tmp/")
8282 !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2369.8)", isOptimized: true, emissionKind: 0, file: !47, enums: !48, retainedTypes: !48, subprograms: !40, globals: !41, imports: !48)
8383 !3 = !DISubroutineType(types: !4)
8484 !4 = !{!5, !5}
8585 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "_Bool", size: 8, align: 8, encoding: DW_ATE_boolean)
86 !6 = distinct !DISubprogram(name: "get2", linkageName: "get2", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !47, scope: !1, type: !3, function: i8 (i8)* @get2, variables: !43)
87 !7 = distinct !DISubprogram(name: "get3", linkageName: "get3", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !47, scope: !1, type: !3, function: i8 (i8)* @get3, variables: !44)
88 !8 = distinct !DISubprogram(name: "get4", linkageName: "get4", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !47, scope: !1, type: !3, function: i8 (i8)* @get4, variables: !45)
89 !9 = distinct !DISubprogram(name: "get5", linkageName: "get5", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !47, scope: !1, type: !3, function: i8 (i8)* @get5, variables: !46)
86 !6 = distinct !DISubprogram(name: "get2", linkageName: "get2", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !47, scope: !1, type: !3, variables: !43)
87 !7 = distinct !DISubprogram(name: "get3", linkageName: "get3", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !47, scope: !1, type: !3, variables: !44)
88 !8 = distinct !DISubprogram(name: "get4", linkageName: "get4", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !47, scope: !1, type: !3, variables: !45)
89 !9 = distinct !DISubprogram(name: "get5", linkageName: "get5", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !47, scope: !1, type: !3, variables: !46)
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)
2727 @x4 = internal unnamed_addr global i32 4, align 4
2828 @x5 = global i32 0, align 4
2929
30 define i32 @get1(i32 %a) nounwind optsize ssp {
30 define i32 @get1(i32 %a) nounwind optsize ssp !dbg !1 {
3131 tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !30
3232 %1 = load i32, i32* @x1, align 4, !dbg !31
3333 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !11, metadata !DIExpression()), !dbg !31
3535 ret i32 %1, !dbg !31
3636 }
3737
38 define i32 @get2(i32 %a) nounwind optsize ssp {
38 define i32 @get2(i32 %a) nounwind optsize ssp !dbg !6 {
3939 tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !13, metadata !DIExpression()), !dbg !32
4040 %1 = load i32, i32* @x2, align 4, !dbg !33
4141 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !14, metadata !DIExpression()), !dbg !33
4343 ret i32 %1, !dbg !33
4444 }
4545
46 define i32 @get3(i32 %a) nounwind optsize ssp {
46 define i32 @get3(i32 %a) nounwind optsize ssp !dbg !7 {
4747 tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !16, metadata !DIExpression()), !dbg !34
4848 %1 = load i32, i32* @x3, align 4, !dbg !35
4949 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !17, metadata !DIExpression()), !dbg !35
5151 ret i32 %1, !dbg !35
5252 }
5353
54 define i32 @get4(i32 %a) nounwind optsize ssp {
54 define i32 @get4(i32 %a) nounwind optsize ssp !dbg !8 {
5555 tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !19, metadata !DIExpression()), !dbg !36
5656 %1 = load i32, i32* @x4, align 4, !dbg !37
5757 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !20, metadata !DIExpression()), !dbg !37
5959 ret i32 %1, !dbg !37
6060 }
6161
62 define i32 @get5(i32 %a) nounwind optsize ssp {
62 define i32 @get5(i32 %a) nounwind optsize ssp !dbg !9 {
6363 tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !27, metadata !DIExpression()), !dbg !38
6464 %1 = load i32, i32* @x5, align 4, !dbg !39
6565 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !28, metadata !DIExpression()), !dbg !39
7373 !llvm.module.flags = !{!49}
7474
7575 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 1, file: !47, enums: !48, retainedTypes: !48, subprograms: !40, globals: !41, imports: !48)
76 !1 = distinct !DISubprogram(name: "get1", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !47, scope: !2, type: !3, function: i32 (i32)* @get1, variables: !42)
76 !1 = distinct !DISubprogram(name: "get1", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !47, scope: !2, type: !3, variables: !42)
7777 !2 = !DIFile(filename: "ss3.c", directory: "/private/tmp")
7878 !3 = !DISubroutineType(types: !4)
7979 !4 = !{!5}
8080 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
81 !6 = distinct !DISubprogram(name: "get2", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !47, scope: !2, type: !3, function: i32 (i32)* @get2, variables: !43)
82 !7 = distinct !DISubprogram(name: "get3", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !47, scope: !2, type: !3, function: i32 (i32)* @get3, variables: !44)
83 !8 = distinct !DISubprogram(name: "get4", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !47, scope: !2, type: !3, function: i32 (i32)* @get4, variables: !45)
84 !9 = distinct !DISubprogram(name: "get5", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !47, scope: !2, type: !3, function: i32 (i32)* @get5, variables: !46)
81 !6 = distinct !DISubprogram(name: "get2", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !47, scope: !2, type: !3, variables: !43)
82 !7 = distinct !DISubprogram(name: "get3", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !47, scope: !2, type: !3, variables: !44)
83 !8 = distinct !DISubprogram(name: "get4", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !47, scope: !2, type: !3, variables: !45)
84 !9 = distinct !DISubprogram(name: "get5", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !47, scope: !2, type: !3, variables: !46)
8585 !10 = !DILocalVariable(name: "a", line: 5, arg: 1, scope: !1, file: !2, type: !5)
8686 !11 = !DILocalVariable(name: "b", line: 5, scope: !12, file: !2, type: !5)
8787 !12 = distinct !DILexicalBlock(line: 5, column: 19, file: !47, scope: !1)
1414 @d = common global i32 0, align 4
1515
1616 ; Function Attrs: nounwind ssp
17 define i32 @pr16110() #0 {
17 define i32 @pr16110() #0 !dbg !4 {
1818 for.cond1.preheader:
1919 store i32 0, i32* @c, align 4, !dbg !21
2020 br label %for.cond1.outer, !dbg !26
8282 !1 = !DIFile(filename: "pr16110.c", directory: "/d/b")
8383 !2 = !{}
8484 !3 = !{!4}
85 !4 = distinct !DISubprogram(name: "pr16110", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 7, file: !1, scope: !5, type: !6, function: i32 ()* @pr16110, variables: !9)
85 !4 = distinct !DISubprogram(name: "pr16110", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !9)
8686 !5 = !DIFile(filename: "pr16110.c", directory: "/d/b")
8787 !6 = !DISubroutineType(types: !7)
8888 !7 = !{!8}
2828 !1 = !DIFile(filename: "var.c", directory: "/tmp")
2929 !2 = !{}
3030 !3 = !{!4}
31 !4 = distinct !DISubprogram(name: "sum", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 (i32, ...)* @sum, variables: !2)
31 !4 = distinct !DISubprogram(name: "sum", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !2)
3232 !5 = !DIFile(filename: "var.c", directory: "/tmp")
3333 !6 = !DISubroutineType(types: !7)
3434 !7 = !{!8, !8}
107107 ; CHECK-THUMB-FP-ELIM: add r7, sp, #8
108108 ; CHECK-THUMB-FP-ELIM: .cfi_def_cfa r7, 20
109109
110 define i32 @sum(i32 %count, ...) {
110 define i32 @sum(i32 %count, ...) !dbg !4 {
111111 entry:
112112 %vl = alloca i8*, align 4
113113 %vl1 = bitcast i8** %vl to i8*
128128 !1 = !DIFile(filename: "exp.cpp", directory: "/tmp")
129129 !2 = !{}
130130 !3 = !{!4}
131 !4 = distinct !DISubprogram(name: "test", linkageName: "_Z4testiiiiiddddd", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: void (i32, i32, i32, i32, i32, double, double, double, double, double)* @_Z4testiiiiiddddd, variables: !2)
131 !4 = distinct !DISubprogram(name: "test", linkageName: "_Z4testiiiiiddddd", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !2)
132132 !5 = !DIFile(filename: "exp.cpp", directory: "/tmp")
133133 !6 = !DISubroutineType(types: !7)
134134 !7 = !{null, !8, !8, !8, !8, !8, !9, !9, !9, !9, !9}
55
66 %struct.tag_s = type { i32, i32, i32 }
77
8 define void @foo(%struct.tag_s* nocapture %this, %struct.tag_s* %c, i64 %x, i64 %y, %struct.tag_s* nocapture %ptr1, %struct.tag_s* nocapture %ptr2) nounwind ssp {
8 define void @foo(%struct.tag_s* nocapture %this, %struct.tag_s* %c, i64 %x, i64 %y, %struct.tag_s* nocapture %ptr1, %struct.tag_s* nocapture %ptr2) nounwind ssp !dbg !1 {
99 tail call void @llvm.dbg.value(metadata %struct.tag_s* %this, i64 0, metadata !5, metadata !DIExpression()), !dbg !20
1010 tail call void @llvm.dbg.value(metadata %struct.tag_s* %c, i64 0, metadata !13, metadata !DIExpression()), !dbg !21
1111 tail call void @llvm.dbg.value(metadata i64 %x, i64 0, metadata !14, metadata !DIExpression()), !dbg !22
3232 !llvm.module.flags = !{!33}
3333
3434 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 1, file: !32, enums: !{}, retainedTypes: !{}, subprograms: !30, imports: null)
35 !1 = distinct !DISubprogram(name: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !2, scope: !2, type: !3, function: void (%struct.tag_s*, %struct.tag_s*, i64, i64, %struct.tag_s*, %struct.tag_s*)* @foo, variables: !31)
35 !1 = distinct !DISubprogram(name: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !2, scope: !2, type: !3, variables: !31)
3636 !2 = !DIFile(filename: "one.c", directory: "/Volumes/Athwagate/R10048772")
3737 !3 = !DISubroutineType(types: !4)
3838 !4 = !{null}
2626
2727 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
2828
29 define hidden void @foobar_func_block_invoke_0(i8* %.block_descriptor, %0* %loadedMydata, [4 x i32] %bounds.coerce0, [4 x i32] %data.coerce0) ssp {
29 define hidden void @foobar_func_block_invoke_0(i8* %.block_descriptor, %0* %loadedMydata, [4 x i32] %bounds.coerce0, [4 x i32] %data.coerce0) ssp !dbg !23 {
3030 %1 = alloca %0*, align 4
3131 %bounds = alloca %struct.CR, align 4
3232 %data = alloca %struct.CR, align 4
117117 !20 = !DIFile(filename: "header4.h", directory: "/Volumes/Sandbox/llvm")
118118 !21 = !{!22}
119119 !22 = !DIEnumerator(name: "Eleven", value: 0) ; [ DW_TAG_enumerator ]
120 !23 = distinct !DISubprogram(name: "foobar_func_block_invoke_0", line: 609, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 609, file: !152, scope: !24, type: !25, function: void (i8*, %0*, [4 x i32], [4 x i32])* @foobar_func_block_invoke_0)
120 !23 = distinct !DISubprogram(name: "foobar_func_block_invoke_0", line: 609, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 609, file: !152, scope: !24, type: !25)
121121 !24 = !DIFile(filename: "MyLibrary.m", directory: "/Volumes/Sandbox/llvm")
122122 !25 = !DISubroutineType(types: !26)
123123 !26 = !{null}
1313
1414 declare <4 x float> @test0001(float) nounwind readnone ssp
1515
16 define i32 @main(i32 %argc, i8** nocapture %argv, i1 %cond) nounwind ssp {
16 define i32 @main(i32 %argc, i8** nocapture %argv, i1 %cond) nounwind ssp !dbg !10 {
1717 entry:
1818 br label %for.body9
1919
4141 !llvm.module.flags = !{!56}
4242 !llvm.dbg.cu = !{!2}
4343
44 !0 = distinct !DISubprogram(name: "test0001", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !54, scope: null, type: !3, function: <4 x float> (float)* @test0001, variables: !51)
44 !0 = distinct !DISubprogram(name: "test0001", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !54, scope: null, type: !3, variables: !51)
4545 !1 = !DIFile(filename: "build2.c", directory: "/private/tmp")
4646 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129915)", isOptimized: true, emissionKind: 1, file: !54, enums: !{}, retainedTypes: !{}, subprograms: !50, imports: null)
4747 !3 = !DISubroutineType(types: !4)
5151 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
5252 !8 = !{!9}
5353 !9 = !DISubrange(count: 4)
54 !10 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !54, scope: null, type: !11, function: i32 (i32, i8**, i1)* @main, variables: !52)
54 !10 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !54, scope: null, type: !11, variables: !52)
5555 !11 = !DISubroutineType(types: !12)
5656 !12 = !{!13}
5757 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
99 @.str = private unnamed_addr constant [11 x i8] c"%p %lf %c\0A\00", align 4
1010 @.str1 = private unnamed_addr constant [6 x i8] c"point\00", align 4
1111
12 define i32 @inlineprinter(i8* %ptr, double %val, i8 zeroext %c) nounwind optsize {
12 define i32 @inlineprinter(i8* %ptr, double %val, i8 zeroext %c) nounwind optsize !dbg !9 {
1313 entry:
1414 tail call void @llvm.dbg.value(metadata i8* %ptr, i64 0, metadata !19, metadata !DIExpression()), !dbg !26
1515 tail call void @llvm.dbg.value(metadata double %val, i64 0, metadata !20, metadata !DIExpression()), !dbg !26
1919 ret i32 0, !dbg !29
2020 }
2121
22 define i32 @printer(i8* %ptr, double %val, i8 zeroext %c) nounwind optsize noinline {
22 define i32 @printer(i8* %ptr, double %val, i8 zeroext %c) nounwind optsize noinline !dbg !0 {
2323 entry:
2424 tail call void @llvm.dbg.value(metadata i8* %ptr, i64 0, metadata !16, metadata !DIExpression()), !dbg !30
2525 tail call void @llvm.dbg.value(metadata double %val, i64 0, metadata !17, metadata !DIExpression()), !dbg !30
3333
3434 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
3535
36 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind optsize {
36 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind optsize !dbg !10 {
3737 entry:
3838 tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !22, metadata !DIExpression()), !dbg !34
3939 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !23, metadata !DIExpression()), !dbg !34
5858 !llvm.dbg.cu = !{!2}
5959 !llvm.module.flags = !{!48}
6060
61 !0 = distinct !DISubprogram(name: "printer", linkageName: "printer", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !46, scope: !1, type: !3, function: i32 (i8*, double, i8)* @printer, variables: !43)
61 !0 = distinct !DISubprogram(name: "printer", linkageName: "printer", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !46, scope: !1, type: !3, variables: !43)
6262 !1 = !DIFile(filename: "a.c", directory: "/tmp/")
6363 !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "(LLVM build 00)", isOptimized: true, emissionKind: 1, file: !46, enums: !47, retainedTypes: !47, subprograms: !42, imports: null)
6464 !3 = !DISubroutineType(types: !4)
6767 !6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: null)
6868 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 32, encoding: DW_ATE_float)
6969 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
70 !9 = distinct !DISubprogram(name: "inlineprinter", linkageName: "inlineprinter", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !46, scope: !1, type: !3, function: i32 (i8*, double, i8)* @inlineprinter, variables: !44)
71 !10 = distinct !DISubprogram(name: "main", linkageName: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !46, scope: !1, type: !11, function: i32 (i32, i8**)* @main, variables: !45)
70 !9 = distinct !DISubprogram(name: "inlineprinter", linkageName: "inlineprinter", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !46, scope: !1, type: !3, variables: !44)
71 !10 = distinct !DISubprogram(name: "main", linkageName: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !46, scope: !1, type: !11, variables: !45)
7272 !11 = !DISubroutineType(types: !12)
7373 !12 = !{!5, !5, !13}
7474 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !14)
0 ; RUN: llc -mtriple=armv7-none-linux-gnueabihf < %s -o - | FileCheck %s
11
22 ; Function Attrs: nounwind
3 define void @need_cfi_def_cfa_offset() #0 {
3 define void @need_cfi_def_cfa_offset() #0 !dbg !3 {
44 ; CHECK-LABEL: need_cfi_def_cfa_offset:
55 ; CHECK: sub sp, sp, #4
66 ; CHECK: .cfi_def_cfa_offset 4
2323 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !{!3})
2424 !1 = !DIFile(filename: "file.c", directory: "/dir")
2525 !2 = !{}
26 !3 = distinct !DISubprogram(name: "need_cfi_def_cfa_offset", scope: !1, file: !1, line: 1, type: !4, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, function: void ()* @need_cfi_def_cfa_offset, variables: !2)
26 !3 = distinct !DISubprogram(name: "need_cfi_def_cfa_offset", scope: !1, file: !1, line: 1, type: !4, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2)
2727 !4 = !DISubroutineType(types: !5)
2828 !5 = !{null}
2929 !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1414
1515 declare <4 x float> @test0001(float) nounwind readnone ssp
1616
17 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind ssp {
17 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind ssp !dbg !10 {
1818 entry:
1919 br label %for.body9
2020
3737 !llvm.dbg.cu = !{!2}
3838 !llvm.module.flags = !{!56}
3939
40 !0 = distinct !DISubprogram(name: "test0001", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !54, scope: !1, type: !3, function: <4 x float> (float)* @test0001, variables: !51)
40 !0 = distinct !DISubprogram(name: "test0001", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !54, scope: !1, type: !3, variables: !51)
4141 !1 = !DIFile(filename: "build2.c", directory: "/private/tmp")
4242 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129915)", isOptimized: true, emissionKind: 1, file: !54, enums: !{}, retainedTypes: !{}, subprograms: !50, imports: null)
4343 !3 = !DISubroutineType(types: !4)
4747 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
4848 !8 = !{!9}
4949 !9 = !DISubrange(count: 4)
50 !10 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 59, file: !54, scope: !1, type: !11, function: i32 (i32, i8**)* @main, variables: !52)
50 !10 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 59, file: !54, scope: !1, type: !11, variables: !52)
5151 !11 = !DISubroutineType(types: !12)
5252 !12 = !{!13}
5353 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1111 @.str = private unnamed_addr constant [11 x i8] c"%p %lf %c\0A\00"
1212 @.str1 = private unnamed_addr constant [6 x i8] c"point\00"
1313
14 define i32 @inlineprinter(i8* %ptr, float %val, i8 zeroext %c) nounwind optsize ssp {
14 define i32 @inlineprinter(i8* %ptr, float %val, i8 zeroext %c) nounwind optsize ssp !dbg !0 {
1515 entry:
1616 tail call void @llvm.dbg.value(metadata i8* %ptr, i64 0, metadata !8, metadata !DIExpression()), !dbg !24
1717 tail call void @llvm.dbg.value(metadata float %val, i64 0, metadata !10, metadata !DIExpression()), !dbg !25
2424
2525 declare i32 @printf(i8* nocapture, ...) nounwind optsize
2626
27 define i32 @printer(i8* %ptr, float %val, i8 zeroext %c) nounwind optsize noinline ssp {
27 define i32 @printer(i8* %ptr, float %val, i8 zeroext %c) nounwind optsize noinline ssp !dbg !6 {
2828 entry:
2929 tail call void @llvm.dbg.value(metadata i8* %ptr, i64 0, metadata !14, metadata !DIExpression()), !dbg !30
3030 tail call void @llvm.dbg.value(metadata float %val, i64 0, metadata !15, metadata !DIExpression()), !dbg !31
3535 ret i32 0, !dbg !35
3636 }
3737
38 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind optsize ssp {
38 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind optsize ssp !dbg !7 {
3939 entry:
4040 tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !17, metadata !DIExpression()), !dbg !36
4141 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !18, metadata !DIExpression()), !dbg !37
6464 !llvm.dbg.cu = !{!2}
6565 !llvm.module.flags = !{!53}
6666
67 !0 = distinct !DISubprogram(name: "inlineprinter", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !51, scope: !1, type: !3, function: i32 (i8*, float, i8)* @inlineprinter, variables: !48)
67 !0 = distinct !DISubprogram(name: "inlineprinter", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !51, scope: !1, type: !3, variables: !48)
6868 !1 = !DIFile(filename: "a.c", directory: "/private/tmp")
6969 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129915)", isOptimized: true, emissionKind: 1, file: !51, enums: !52, retainedTypes: !52, subprograms: !47, imports: null)
7070 !3 = !DISubroutineType(types: !4)
7171 !4 = !{!5}
7272 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
73 !6 = distinct !DISubprogram(name: "printer", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !51, scope: !1, type: !3, function: i32 (i8*, float, i8)* @printer, variables: !49)
74 !7 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !51, scope: !1, type: !3, function: i32 (i32, i8**)* @main, variables: !50)
73 !6 = distinct !DISubprogram(name: "printer", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !51, scope: !1, type: !3, variables: !49)
74 !7 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !51, scope: !1, type: !3, variables: !50)
7575 !8 = !DILocalVariable(name: "ptr", line: 4, arg: 1, scope: !0, file: !1, type: !9)
7676 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: null)
7777 !10 = !DILocalVariable(name: "val", line: 4, arg: 2, scope: !0, file: !1, type: !11)
1111 ; CHECK-NEXT: Ending address offset:
1212 ; CHECK-NEXT: Location description: 90 {{.. .. .. .. $}}
1313
14 define void @_Z3foov() optsize ssp {
14 define void @_Z3foov() optsize ssp !dbg !1 {
1515 entry:
1616 %call = tail call float @_Z3barv() optsize, !dbg !11
1717 tail call void @llvm.dbg.value(metadata float %call, i64 0, metadata !5, metadata !DIExpression()), !dbg !11
4343 !llvm.module.flags = !{!20}
4444
4545 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130845)", isOptimized: true, emissionKind: 1, file: !18, enums: !19, retainedTypes: !19, subprograms: !16, imports: null)
46 !1 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !18, scope: !2, type: !3, function: void ()* @_Z3foov, variables: !17)
46 !1 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !18, scope: !2, type: !3, variables: !17)
4747 !2 = !DIFile(filename: "k.cc", directory: "/private/tmp")
4848 !3 = !DISubroutineType(types: !4)
4949 !4 = !{null}
44 !llvm.module.flags = !{!9, !10}
55 !llvm.ident = !{!11}
66
7 define void @test_basic() #0 {
7 define void @test_basic() #0 !dbg !4 {
88 %mem = alloca i32, i32 10
99 call void @dummy_use (i32* %mem, i32 10)
1010 ret void
4242 !1 = !DIFile(filename: "var.c", directory: "/tmp")
4343 !2 = !{}
4444 !3 = !{!4}
45 !4 = distinct !DISubprogram(name: "test_basic", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: void ()* @test_basic, variables: !2)
45 !4 = distinct !DISubprogram(name: "test_basic", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !2)
4646 !5 = !DIFile(filename: "var.c", directory: "/tmp")
4747 !6 = !DISubroutineType(types: !7)
4848 !7 = !{!8, !8}
66 %struct.s = type opaque
77
88 ; Function Attrs: nounwind
9 define arm_aapcscc i32 @f(%struct.s* %s, i32 %u, i8* %b, i32 %n) #0 {
9 define arm_aapcscc i32 @f(%struct.s* %s, i32 %u, i8* %b, i32 %n) #0 !dbg !4 {
1010 entry:
1111 tail call void @llvm.dbg.value(metadata %struct.s* %s, i64 0, metadata !19, metadata !28), !dbg !29
1212 tail call void @llvm.dbg.value(metadata i32 %u, i64 0, metadata !20, metadata !28), !dbg !29
5353 !1 = !DIFile(filename: "", directory: "/Users/compnerd/Source/llvm")
5454 !2 = !{}
5555 !3 = !{!4}
56 !4 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 9, type: !6, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, function: i32 (%struct.s*, i32, i8*, i32)* @f, variables: !18)
56 !4 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 9, type: !6, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !18)
5757 !5 = !DIFile(filename: "", directory: "/Users/compnerd/Source/llvm")
5858 !6 = !DISubroutineType(types: !7)
5959 !7 = !{!8, !9, !12, !13, !17}
99 ; the layout of the VFP registers correctly. The fact that the numbers are
1010 ; monotonic in memory is also a nice property to have.
1111
12 define void @stack_offsets() {
12 define void @stack_offsets() !dbg !4 {
1313 ; CHECK-LABEL: stack_offsets:
1414 ; CHECK: vpush {d13}
1515 ; CHECK: vpush {d11}
3434 !1 = !DIFile(filename: "tmp.c", directory: "/Users/tim/llvm/build")
3535 !2 = !{}
3636 !3 = !{!4}
37 !4 = distinct !DISubprogram(name: "bar", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @stack_offsets, variables: !2)
37 !4 = distinct !DISubprogram(name: "bar", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
3838 !5 = !DIFile(filename: "tmp.c", directory: "/Users/tim/llvm/build")
3939 !6 = !DISubroutineType(types: !7)
4040 !7 = !{null}
1515 ; CHECK: }
1616
1717 ; Function Attrs: nounwind
18 define i32 @foo(i32 %x, i32 %y) #0 {
18 define i32 @foo(i32 %x, i32 %y) #0 !dbg !4 {
1919 entry:
2020 tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !9, metadata !14), !dbg !15
2121 tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !10, metadata !14), !dbg !16
4444 !1 = !DIFile(filename: "cfi-late.c", directory: "/test")
4545 !2 = !{}
4646 !3 = !{!4}
47 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, function: i32 (i32, i32)* @foo, variables: !8)
47 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !8)
4848 !5 = !DISubroutineType(types: !6)
4949 !6 = !{!7, !7, !7}
5050 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
22 target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
33 target triple = "hexagon"
44
5 define void @foo(i32* nocapture %a, i32* nocapture %b) nounwind {
5 define void @foo(i32* nocapture %a, i32* nocapture %b) nounwind !dbg !5 {
66 entry:
77 tail call void @llvm.dbg.value(metadata i32* %a, i64 0, metadata !13, metadata !DIExpression()), !dbg !17
88 tail call void @llvm.dbg.value(metadata i32* %b, i64 0, metadata !14, metadata !DIExpression()), !dbg !18
3939 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "QuIC LLVM Hexagon Clang version 6.1-pre-unknown, (git://git-hexagon-aus.quicinc.com/llvm/clang-mainline.git e9382867661454cdf44addb39430741578e9765c) (llvm/llvm-mainline.git 36412bb1fcf03ed426d4437b41198bae066675ac)", isOptimized: true, emissionKind: 1, file: !28, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2)
4040 !2 = !{}
4141 !3 = !{!5}
42 !5 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !28, scope: null, type: !7, function: void (i32*, i32*)* @foo, variables: !11)
42 !5 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !28, scope: null, type: !7, variables: !11)
4343 !6 = !DIFile(filename: "hwloop-dbg.c", directory: "/usr2/kparzysz/s.hex/t")
4444 !7 = !DISubroutineType(types: !8)
4545 !8 = !{null, !9, !9}
0 ; Check that DEBUG_VALUE comments come through on a variety of targets.
11
2 define i32 @main() nounwind ssp {
2 define i32 @main() nounwind ssp !dbg !0 {
33 entry:
44 ; CHECK: DEBUG_VALUE
55 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !7, metadata !DIExpression()), !dbg !9
1313 !llvm.dbg.cu = !{!2}
1414 !llvm.module.flags = !{!13}
1515
16 !0 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !12, scope: !1, type: !3, function: i32 ()* @main)
16 !0 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !12, scope: !1, type: !3)
1717 !1 = !DIFile(filename: "/tmp/x.c", directory: "/Users/manav")
1818 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 120996)", isOptimized: false, emissionKind: 0, file: !12, enums: !6, retainedTypes: !6, subprograms: !11)
1919 !3 = !DISubroutineType(types: !4)
11
22 --- |
33
4 define i32 @test(i32 %x) #0 {
4 define i32 @test(i32 %x) #0 !dbg !4 {
55 entry:
66 %x.addr = alloca i32, align 4
77 store i32 %x, i32* %x.addr, align 4
2323 !1 = !DIFile(filename: "test.ll", directory: "")
2424 !2 = !{}
2525 !3 = !{!4}
26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32)* @test, variables: !2)
26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
2727 !5 = !DIFile(filename: "test.c", directory: "")
2828 !6 = !DISubroutineType(types: !7)
2929 !7 = !{!8, !8}
11
22 --- |
33
4 define i32 @test(i32 %x) #0 {
4 define i32 @test(i32 %x) #0 !dbg !4 {
55 entry:
66 %x.addr = alloca i32, align 4
77 store i32 %x, i32* %x.addr, align 4
2323 !1 = !DIFile(filename: "test.ll", directory: "")
2424 !2 = !{}
2525 !3 = !{!4}
26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32)* @test, variables: !2)
26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
2727 !5 = !DIFile(filename: "test.c", directory: "")
2828 !6 = !DISubroutineType(types: !7)
2929 !7 = !{!8, !8}
33
44 --- |
55
6 define i32 @test(i32 %x) #0 {
6 define i32 @test(i32 %x) #0 !dbg !4 {
77 entry:
88 %x.addr = alloca i32, align 4
99 store i32 %x, i32* %x.addr, align 4
3434 !1 = !DIFile(filename: "test.ll", directory: "")
3535 !2 = !{}
3636 !3 = !{!4}
37 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32)* @test, variables: !2)
37 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
3838 !5 = !DIFile(filename: "test.c", directory: "")
3939 !6 = !DISubroutineType(types: !7)
4040 !7 = !{!8, !8}
33
44 --- |
55
6 define i32 @test(i32 %x) #0 {
6 define i32 @test(i32 %x) #0 !dbg !4 {
77 entry:
88 %x.addr = alloca i32, align 4
99 store i32 %x, i32* %x.addr, align 4
2525 !1 = !DIFile(filename: "test.ll", directory: "")
2626 !2 = !{}
2727 !3 = !{!4}
28 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32)* @test, variables: !2)
28 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
2929 !5 = !DIFile(filename: "test.c", directory: "")
3030 !6 = !DISubroutineType(types: !7)
3131 !7 = !{!8, !8}
11
22 --- |
33
4 define i32 @test(i32 %x) #0 {
4 define i32 @test(i32 %x) #0 !dbg !4 {
55 entry:
66 %x.addr = alloca i32, align 4
77 store i32 %x, i32* %x.addr, align 4
2323 !1 = !DIFile(filename: "test.ll", directory: "")
2424 !2 = !{}
2525 !3 = !{!4}
26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32)* @test, variables: !2)
26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
2727 !5 = !DIFile(filename: "test.c", directory: "")
2828 !6 = !DISubroutineType(types: !7)
2929 !7 = !{!8, !8}
33 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-v128:128:128-n32:64"
44 target triple = "powerpc64-unknown-linux-gnu"
55
6 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind readnone {
6 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind readnone !dbg !5 {
77 entry:
88 tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !15, metadata !DIExpression()), !dbg !17
99 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !16, metadata !DIExpression()), !dbg !18
1919 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1", isOptimized: true, emissionKind: 0, file: !21, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1)
2020 !1 = !{}
2121 !3 = !{!5}
22 !5 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !21, scope: null, type: !7, function: i32 (i32, i8**)* @main, variables: !13)
22 !5 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !21, scope: null, type: !7, variables: !13)
2323 !6 = !DIFile(filename: "dbg.c", directory: "/src")
2424 !7 = !DISubroutineType(types: !8)
2525 !8 = !{!9, !9, !10}
88 @grid_points = external global [3 x i32], align 4
99
1010 ; Function Attrs: nounwind
11 define fastcc void @compute_rhs() #0 {
11 define fastcc void @compute_rhs() #0 !dbg !114 {
1212 entry:
1313 br i1 undef, label %for.cond871.preheader.for.inc960_crit_edge, label %for.end1042, !dbg !439
1414
167167 !111 = !DILocalVariable(name: "d", line: 271, scope: !102, file: !5, type: !8)
168168 !112 = !DILocalVariable(name: "m", line: 271, scope: !102, file: !5, type: !8)
169169 !113 = !DILocalVariable(name: "add", line: 272, scope: !102, file: !5, type: !20)
170 !114 = distinct !DISubprogram(name: "compute_rhs", line: 1767, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1767, file: !1, scope: !5, type: !115, function: void ()* @compute_rhs, variables: !117)
170 !114 = distinct !DISubprogram(name: "compute_rhs", line: 1767, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1767, file: !1, scope: !5, type: !115, variables: !117)
171171 !115 = !DISubroutineType(types: !116)
172172 !116 = !{null}
173173 !117 = !{!118, !119, !120, !121, !122, !123, !124, !125, !126, !127, !128, !129, !130, !131}
55 @php_intpow10.powers = external unnamed_addr constant [23 x double], align 8
66
77 ; Function Attrs: nounwind
8 define double @_php_math_round(double %value, i32 signext %places, i32 signext %mode) #0 {
8 define double @_php_math_round(double %value, i32 signext %places, i32 signext %mode) #0 !dbg !6 {
99 entry:
1010 br i1 undef, label %if.then, label %if.else, !dbg !32
1111
6161 !3 = !{!4}
6262 !4 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
6363 !5 = !{!6, !18}
64 !6 = distinct !DISubprogram(name: "_php_math_round", scope: !1, file: !1, line: 15, type: !7, isLocal: false, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: true, function: double (double, i32, i32)* @_php_math_round, variables: !10)
64 !6 = distinct !DISubprogram(name: "_php_math_round", scope: !1, file: !1, line: 15, type: !7, isLocal: false, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: true, variables: !10)
6565 !7 = !DISubroutineType(types: !8)
6666 !8 = !{!4, !4, !9, !9}
6767 !9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
22 target triple = "powerpc64-unknown-linux-gnu"
33
44 ; Function Attrs: nounwind
5 define void @foo() #0 {
5 define void @foo() #0 !dbg !4 {
66 entry:
77 call void @llvm.eh.unwind.init(), !dbg !9
88 ret void, !dbg !10
2424 !1 = !DIFile(filename: "/tmp/unwind-dw2.c", directory: "/tmp")
2525 !2 = !{}
2626 !3 = !{!4}
27 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @foo, variables: !2)
27 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
2828 !5 = !DIFile(filename: "/tmp/unwind-dw2.c", directory: "/tmp")
2929 !6 = !DISubroutineType(types: !7)
3030 !7 = !{null}
452452 ; CHECK-NEXT: call void @f()
453453 ; CHECK-NEXT: unreachable
454454
455 define void @test12() personality i32 (...)* @__CxxFrameHandler3 {
455 define void @test12() personality i32 (...)* @__CxxFrameHandler3 !dbg !5 {
456456 entry:
457457 invoke void @f()
458458 to label %cont unwind label %left, !dbg !8
558558 !2 = !DIFile(filename: "test.cpp", directory: ".")
559559 !3 = !{}
560560 !4 = !{!5}
561 !5 = distinct !DISubprogram(name: "test12", scope: !2, file: !2, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @test12, variables: !3)
561 !5 = distinct !DISubprogram(name: "test12", scope: !2, file: !2, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !3)
562562 !6 = !DISubroutineType(types: !7)
563563 !7 = !{null}
564564 !8 = !DILocation(line: 1, scope: !5)
55 %struct.Pt = type { double, double }
66 %struct.Rect = type { %struct.Pt, %struct.Pt }
77
8 define double @foo(%struct.Rect* byval %my_r0) nounwind ssp {
8 define double @foo(%struct.Rect* byval %my_r0) nounwind ssp !dbg !1 {
99 entry:
1010 ;CHECK: DEBUG_VALUE
1111 %retval = alloca double ; [#uses=2]
3131 !llvm.module.flags = !{!21}
3232
3333 !0 = !DILocalVariable(name: "my_r0", line: 11, arg: 1, scope: !1, file: !2, type: !7)
34 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !19, scope: !2, type: !4, function: double (%struct.Rect*)* @foo)
34 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !19, scope: !2, type: !4)
3535 !2 = !DIFile(filename: "b2.c", directory: "/tmp/")
3636 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18)
3737 !4 = !DISubroutineType(types: !5)
66
77 %0 = type { double }
88
9 define hidden %0 @__divsc3(float %a, float %b, float %c, float %d) nounwind readnone {
9 define hidden %0 @__divsc3(float %a, float %b, float %c, float %d) nounwind readnone !dbg !1 {
1010 entry:
1111 tail call void @llvm.dbg.value(metadata float %a, i64 0, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
1212 tail call void @llvm.dbg.value(metadata float %b, i64 0, metadata !11, metadata !DIExpression()), !dbg !DILocation(scope: !1)
199199 !llvm.module.flags = !{!48}
200200
201201 !0 = !DILocalVariable(name: "a", line: 1921, arg: 1, scope: !1, file: !2, type: !9)
202 !1 = distinct !DISubprogram(name: "__divsc3", linkageName: "__divsc3", line: 1922, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 1922, file: !45, scope: !2, type: !4, function: %0 (float, float, float, float)* @__divsc3, variables: !43)
202 !1 = distinct !DISubprogram(name: "__divsc3", linkageName: "__divsc3", line: 1922, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 1922, file: !45, scope: !2, type: !4, variables: !43)
203203 !2 = !DIFile(filename: "libgcc2.c", directory: "/Users/yash/clean/LG.D/gcc/../../llvmgcc/gcc")
204204 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !45, enums: !47, retainedTypes: !47, subprograms: !44, imports: null)
205205 !4 = !DISubroutineType(types: !5)
66
77 @llvm.used = appending global [1 x i8*] [i8* bitcast (i8* (%struct.a*)* @bar to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
88
9 define i8* @bar(%struct.a* %myvar) nounwind optsize noinline ssp {
9 define i8* @bar(%struct.a* %myvar) nounwind optsize noinline ssp !dbg !9 {
1010 entry:
1111 tail call void @llvm.dbg.value(metadata %struct.a* %myvar, i64 0, metadata !8, metadata !DIExpression()), !dbg !DILocation(scope: !9)
1212 %0 = getelementptr inbounds %struct.a, %struct.a* %myvar, i64 0, i32 0, !dbg !28 ; [#uses=1]
2828 !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !36, enums: !37, retainedTypes: !37, subprograms: !32, globals: !31, imports: !37)
2929 !3 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3030 !4 = !DILocalVariable(name: "x", line: 12, arg: 1, scope: !5, file: !1, type: !3)
31 !5 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 13, file: !36, scope: !1, type: !6, function: void (i32)* @foo, variables: !33)
31 !5 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 13, file: !36, scope: !1, type: !6, variables: !33)
3232 !6 = !DISubroutineType(types: !7)
3333 !7 = !{null, !3}
3434 !8 = !DILocalVariable(name: "myvar", line: 17, arg: 1, scope: !9, file: !1, type: !13)
35 !9 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 17, file: !36, scope: !1, type: !10, function: i8* (%struct.a*)* @bar, variables: !34)
35 !9 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 17, file: !36, scope: !1, type: !10, variables: !34)
3636 !10 = !DISubroutineType(types: !11)
3737 !11 = !{!12, !13}
3838 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !36, scope: !1, baseType: null)
11 ; RUN: llc -mtriple=x86_64-apple-darwin -regalloc=basic < %s | FileCheck %s
22 ; Test to check separate label for inlined function argument.
33
4 define i32 @foo(i32 %y) nounwind optsize ssp {
4 define i32 @foo(i32 %y) nounwind optsize ssp !dbg !1 {
55 entry:
66 tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
77 %0 = tail call i32 (...) @zoo(i32 %y) nounwind, !dbg !9 ; [#uses=1]
1212
1313 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
1414
15 define i32 @bar(i32 %x) nounwind optsize ssp {
15 define i32 @bar(i32 %x) nounwind optsize ssp !dbg !8 {
1616 entry:
1717 tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !8)
1818 tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !0, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !1)
2525 !llvm.module.flags = !{!20}
2626
2727 !0 = !DILocalVariable(name: "y", line: 2, arg: 1, scope: !1, file: !2, type: !6)
28 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 2, file: !18, scope: !2, type: !4, function: i32 (i32)* @foo, variables: !15)
28 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 2, file: !18, scope: !2, type: !4, variables: !15)
2929 !2 = !DIFile(filename: "f.c", directory: "/tmp")
3030 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !18, enums: !19, retainedTypes: !19, subprograms: !17, imports: null)
3131 !4 = !DISubroutineType(types: !5)
3232 !5 = !{!6, !6}
3333 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3434 !7 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !2, type: !6)
35 !8 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !18, scope: !2, type: !4, function: i32 (i32)* @bar, variables: !16)
35 !8 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !18, scope: !2, type: !4, variables: !16)
3636 !9 = !DILocation(line: 3, scope: !10)
3737 !10 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !1)
3838 !11 = !{i32 1}
66
77 @llvm.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.foo*, i32)* @_ZN3foo3bazEi to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
88
9 define i32 @_ZN3foo3bazEi(%struct.foo* nocapture %this, i32 %x) nounwind readnone optsize noinline ssp align 2 {
9 define i32 @_ZN3foo3bazEi(%struct.foo* nocapture %this, i32 %x) nounwind readnone optsize noinline ssp align 2 !dbg !8 {
1010 ;CHECK: DEBUG_VALUE: baz:this <- RDI{{$}}
1111 entry:
1212 tail call void @llvm.dbg.value(metadata %struct.foo* %this, i64 0, metadata !15, metadata !DIExpression()), !dbg !DILocation(scope: !8)
2323 !llvm.dbg.lv = !{!0, !14, !15, !16, !17, !24, !25, !28}
2424
2525 !0 = !DILocalVariable(name: "this", line: 11, arg: 1, scope: !1, file: !3, type: !12)
26 !1 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEi", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 11, file: !31, scope: !2, type: !9, function: i32 (%struct.foo*, i32)* null)
26 !1 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEi", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 11, file: !31, scope: !2, type: !9)
2727 !2 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 3, size: 32, align: 32, file: !31, scope: !3, elements: !5)
2828 !3 = !DIFile(filename: "foo.cp", directory: "/tmp/")
2929 !4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 LLVM build", isOptimized: true, emissionKind: 0, file: !31, enums: !32, retainedTypes: !32, subprograms: !33)
3030 !5 = !{!6, !1, !8}
3131 !6 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 8, size: 32, align: 32, file: !31, scope: !2, baseType: !7)
3232 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
33 !8 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3foo3bazEi", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 15, file: !31, scope: !2, type: !9, function: i32 (%struct.foo*, i32)* @_ZN3foo3bazEi)
33 !8 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3foo3bazEi", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 15, file: !31, scope: !2, type: !9)
3434 !9 = !DISubroutineType(types: !10)
3535 !10 = !{!7, !11, !7}
3636 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !31, scope: !3, baseType: !2)
22
33 %struct.SVal = type { i8*, i32 }
44
5 define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) nounwind ssp {
5 define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) nounwind ssp !dbg !17 {
66 entry:
77 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
88 call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !23, metadata !DIExpression()), !dbg !24
3030 ret i32 %.0, !dbg !29
3131 }
3232
33 define linkonce_odr void @_ZN4SValC1Ev(%struct.SVal* %this) nounwind ssp align 2 {
33 define linkonce_odr void @_ZN4SValC1Ev(%struct.SVal* %this) nounwind ssp align 2 !dbg !16 {
3434 entry:
3535 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
3636 call void @llvm.dbg.value(metadata %struct.SVal* %this, i64 0, metadata !31, metadata !DIExpression()), !dbg !34
4646
4747 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
4848
49 define i32 @main() nounwind ssp {
49 define i32 @main() nounwind ssp !dbg !20 {
5050 entry:
5151 %0 = alloca %struct.SVal ; <%struct.SVal*> [#uses=3]
5252 %v = alloca %struct.SVal ; <%struct.SVal*> [#uses=4]
9393 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
9494 !14 = !DISubroutineType(types: !15)
9595 !15 = !{null, !12}
96 !16 = distinct !DISubprogram(name: "SVal", linkageName: "_ZN4SValC1Ev", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !47, scope: !1, type: !14, function: void (%struct.SVal*)* @_ZN4SValC1Ev)
97 !17 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi4SVal", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 16, file: !47, scope: !2, type: !18, function: i32 (i32, %struct.SVal*)* @_Z3fooi4SVal)
96 !16 = distinct !DISubprogram(name: "SVal", linkageName: "_ZN4SValC1Ev", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !47, scope: !1, type: !14)
97 !17 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi4SVal", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 16, file: !47, scope: !2, type: !18)
9898 !18 = !DISubroutineType(types: !19)
9999 !19 = !{!13, !13, !1}
100 !20 = distinct !DISubprogram(name: "main", linkageName: "main", line: 23, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 23, file: !47, scope: !2, type: !21, function: i32 ()* @main)
100 !20 = distinct !DISubprogram(name: "main", linkageName: "main", line: 23, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 23, file: !47, scope: !2, type: !21)
101101 !21 = !DISubroutineType(types: !22)
102102 !22 = !{!13}
103103 !23 = !DILocalVariable(name: "i", line: 16, arg: 1, scope: !17, file: !2, type: !13)
11 ; Radar 8286101
22 ; CHECK: .file {{[0-9]+}} ""
33
4 define i32 @foo() nounwind ssp {
4 define i32 @foo() nounwind ssp !dbg !0 {
55 entry:
66 ret i32 42, !dbg !8
77 }
88
9 define i32 @bar() nounwind ssp {
9 define i32 @bar() nounwind ssp !dbg !6 {
1010 entry:
1111 ret i32 21, !dbg !10
1212 }
1414 !llvm.dbg.cu = !{!2}
1515 !llvm.module.flags = !{!17}
1616
17 !0 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !14, scope: !1, type: !3, function: i32 ()* @foo)
17 !0 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !14, scope: !1, type: !3)
1818 !1 = !DIFile(filename: "", directory: "/private/tmp")
1919 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 114084)", isOptimized: false, emissionKind: 0, file: !15, enums: !16, retainedTypes: !16, subprograms: !13)
2020 !3 = !DISubroutineType(types: !4)
2121 !4 = !{!5}
2222 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
23 !6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !15, scope: !7, type: !3, function: i32 ()* @bar)
23 !6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !15, scope: !7, type: !3)
2424 !7 = !DIFile(filename: "bug.c", directory: "/private/tmp")
2525 !8 = !DILocation(line: 53, column: 13, scope: !9)
2626 !9 = distinct !DILexicalBlock(line: 53, column: 11, file: !14, scope: !0)
55
66 %struct.bar = type { i32, i32 }
77
8 define i32 @foo(%struct.bar* nocapture %i) nounwind readnone optsize noinline ssp {
8 define i32 @foo(%struct.bar* nocapture %i) nounwind readnone optsize noinline ssp !dbg !0 {
99 ; CHECK: TAG_formal_parameter
1010 entry:
1111 tail call void @llvm.dbg.value(metadata %struct.bar* %i, i64 0, metadata !6, metadata !DIExpression()), !dbg !12
1717 !llvm.dbg.cu = !{!2}
1818 !llvm.module.flags = !{!19}
1919
20 !0 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !17, scope: !1, type: !3, function: i32 (%struct.bar*)* @foo, variables: !16)
20 !0 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !17, scope: !1, type: !3, variables: !16)
2121 !1 = !DIFile(filename: "one.c", directory: "/private/tmp")
2222 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 117922)", isOptimized: true, emissionKind: 0, file: !17, enums: !18, retainedTypes: !18, subprograms: !15, imports: null)
2323 !3 = !DISubroutineType(types: !4)
1919 @.str1 = private unnamed_addr constant [14 x i8] c"m=%u, z_s=%d\0A\00"
2020 @str = internal constant [21 x i8] c"Failing test vector:\00"
2121
22 define i64 @gcd(i64 %a, i64 %b) nounwind readnone optsize noinline ssp {
22 define i64 @gcd(i64 %a, i64 %b) nounwind readnone optsize noinline ssp !dbg !0 {
2323 entry:
2424 tail call void @llvm.dbg.value(metadata i64 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !18
2525 tail call void @llvm.dbg.value(metadata i64 %b, i64 0, metadata !11, metadata !DIExpression()), !dbg !19
3737 ret i64 %b.addr.0, !dbg !23
3838 }
3939
40 define i32 @main() nounwind optsize ssp {
40 define i32 @main() nounwind optsize ssp !dbg !6 {
4141 entry:
4242 %call = tail call i32 @rand() nounwind optsize, !dbg !24
4343 tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !14, metadata !DIExpression()), !dbg !24
7777 !llvm.dbg.cu = !{!2}
7878 !llvm.module.flags = !{!33}
7979
80 !0 = distinct !DISubprogram(name: "gcd", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !31, scope: !1, type: !3, function: i64 (i64, i64)* @gcd, variables: !29)
80 !0 = distinct !DISubprogram(name: "gcd", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !31, scope: !1, type: !3, variables: !29)
8181 !1 = !DIFile(filename: "rem_small.c", directory: "/private/tmp")
8282 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124117)", isOptimized: true, emissionKind: 1, file: !31, enums: !32, retainedTypes: !32, subprograms: !28, imports: null)
8383 !3 = !DISubroutineType(types: !4)
8484 !4 = !{!5}
8585 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
86 !6 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !31, scope: !1, type: !7, function: i32 ()* @main, variables: !30)
86 !6 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !31, scope: !1, type: !7, variables: !30)
8787 !7 = !DISubroutineType(types: !8)
8888 !8 = !{!9}
8989 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1313
1414 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
1515
16 define signext i16 @subdivp(%struct.node.0.27* nocapture %p, double %dsq, double %tolsq, %struct.hgstruct.2.29* nocapture byval align 8 %hg) nounwind uwtable readonly ssp {
16 define signext i16 @subdivp(%struct.node.0.27* nocapture %p, double %dsq, double %tolsq, %struct.hgstruct.2.29* nocapture byval align 8 %hg) nounwind uwtable readonly ssp !dbg !14 {
1717 entry:
1818 call void @llvm.dbg.declare(metadata %struct.hgstruct.2.29* %hg, metadata !4, metadata !DIExpression()), !dbg !DILocation(scope: !14)
1919 %type = getelementptr inbounds %struct.node.0.27, %struct.node.0.27* %p, i64 0, i32 0
4646 !11 = !DIFile(filename: "MultiSource/Benchmarks/Olden/bh/newbh.c", directory: "MultiSource/Benchmarks/Olden/bh")
4747 !12 = !{i32 1, !"Debug Info Version", i32 3}
4848 !13 = !{!14}
49 !14 = distinct !DISubprogram(name: "subdivp", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !11, scope: !5, type: !15, function: i16 (%struct.node.0.27*, double, double, %struct.hgstruct.2.29* )* @subdivp)
49 !14 = distinct !DISubprogram(name: "subdivp", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !11, scope: !5, type: !15)
5050 !15 = !DISubroutineType(types: !16)
5151 !16 = !{null}
1313
1414 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
1515
16 define i32 @AttachGalley(%union.rec** nocapture %suspend_pt) nounwind uwtable ssp {
16 define i32 @AttachGalley(%union.rec** nocapture %suspend_pt) nounwind uwtable ssp !dbg !21 {
1717 entry:
1818 %num14075 = alloca [20 x i8], align 16
1919 br label %if.end33
8585 !19 = !DIFile(filename: "MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c", directory: "MultiSource/Benchmarks/MiBench/consumer-typeset")
8686
8787 !20 = !{!21}
88 !21 = distinct !DISubprogram(name: "AttachGalley", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !19, scope: !14, type: !22, function: i32 (%union.rec**)* @AttachGalley)
88 !21 = distinct !DISubprogram(name: "AttachGalley", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !19, scope: !14, type: !22)
8989 !22 = !DISubroutineType(types: !23)
9090 !23 = !{null}
9191
9898 %"class.__gnu_cxx::hash_map" = type { %"class.__gnu_cxx::hashtable" }
9999 %"class.__gnu_cxx::hashtable" = type { i64, i64, i64, i64, i64, i64 }
100100
101 define void @main() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
101 define void @main() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !37 {
102102 entry:
103103 %X = alloca %"class.__gnu_cxx::hash_map", align 8
104104 br i1 undef, label %cond.true, label %cond.end
140140 !34 = !DIFile(filename: "SingleSource/Benchmarks/Shootout-C++/hash.cpp", directory: "SingleSource/Benchmarks/Shootout-C++")
141141 !35 = !{i32 1, !"Debug Info Version", i32 3}
142142 !36 = !{!37}
143 !37 = distinct !DISubprogram(name: "main", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !19, scope: !14, type: !22, function: void ()* @main)
143 !37 = distinct !DISubprogram(name: "main", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !19, scope: !14, type: !22)
1010
1111 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
1212
13 define void @test() unnamed_addr uwtable ssp align 2 {
13 define void @test() unnamed_addr uwtable ssp align 2 !dbg !2 {
1414 entry:
1515 %callback = alloca %struct.btCompoundLeafCallback, align 8
1616 br i1 undef, label %if.end, label %if.then
3737
3838 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 168984) (llvm/trunk 168983)", isOptimized: true, emissionKind: 0, file: !6, subprograms: !1)
3939 !1 = !{!2}
40 !2 = distinct !DISubprogram(name: "test", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !5, type: !7, function: void ()* @test)
40 !2 = distinct !DISubprogram(name: "test", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !5, type: !7)
4141 !3 = !DILocalVariable(name: "callback", line: 214, scope: !2, type: !4)
4242 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "btCompoundLeafCallback", line: 90, size: 512, align: 64, file: !6)
4343 !5 = !DIFile(filename: "MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp", directory: "MultiSource/Benchmarks/Bullet")
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"
33 target triple = "x86_64-apple-macosx10.7.0"
44
5 define i32 @foo(i32 %i, i32* nocapture %c) nounwind uwtable readonly ssp {
5 define i32 @foo(i32 %i, i32* nocapture %c) nounwind uwtable readonly ssp !dbg !1 {
66 tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !6, metadata !DIExpression()), !dbg !12
77 %ab = load i32, i32* %c, align 1, !dbg !14
88 tail call void @llvm.dbg.value(metadata i32* %c, i64 0, metadata !7, metadata !DIExpression()), !dbg !13
2828 !llvm.module.flags = !{!22}
2929
3030 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !18, imports: null)
31 !1 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !20, scope: !2, type: !3, function: i32 (i32, i32*)* @foo, variables: !19)
31 !1 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !20, scope: !2, type: !3, variables: !19)
3232 !2 = !DIFile(filename: "a.c", directory: "/private/tmp")
3333 !3 = !DISubroutineType(types: !4)
3434 !4 = !{!5}
4747 @.str2 = private unnamed_addr constant [2 x i8] c"-\00", align 1
4848
4949 ; Function Attrs: uwtable
50 define void @_Z3barii(i32 %param1, i32 %param2) #0 {
50 define void @_Z3barii(i32 %param1, i32 %param2) #0 !dbg !24 {
5151 entry:
5252 %var1 = alloca %struct.AAA3, align 1
5353 %var2 = alloca %struct.AAA3, align 1
136136 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !22)
137137 !22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS4AAA3")
138138 !23 = !{!24, !35, !40}
139 !24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barii", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !1, scope: !25, type: !26, function: void (i32, i32)* @_Z3barii, variables: !29)
139 !24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barii", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !1, scope: !25, type: !26, variables: !29)
140140 !25 = !DIFile(filename: "dbg-changes-codegen-branch-folding.cpp", directory: "/tmp/dbginfo")
141141 !26 = !DISubroutineType(types: !27)
142142 !27 = !{null, !28, !28}
2323
2424 ; ModuleID = 'dbg-combine.c'
2525 ; Function Attrs: nounwind uwtable
26 define i32 @foo() #0 {
26 define i32 @foo() #0 !dbg !4 {
2727 entry:
2828 %elems = alloca i32, align 4
2929 %saved_stack = alloca i8*
7777 !1 = !DIFile(filename: "dbg-combine.c", directory: "/home/probinson/projects/scratch")
7878 !2 = !{}
7979 !3 = !{!4}
80 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @foo, variables: !2)
80 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
8181 !5 = !DIFile(filename: "dbg-combine.c", directory: "/home/probinson/projects/scratch")
8282 !6 = !DISubroutineType(types: !7)
8383 !7 = !{!8}
22 ; CHECK-LABEL: _Z3foov:
33 ; CHECK: .loc 1 4 3 prologue_end
44 ; CHECK: .cfi_escape 0x2e, 0x10
5 define void @_Z3foov() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
5 define void @_Z3foov() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !4 {
66 entry:
77 tail call void @_Z3bariii(i32 0, i32 1, i32 2) #1, !dbg !10
88 invoke void @_Z3bariii(i32 4, i32 5, i32 6) #1
4141 !1 = !DIFile(filename: "foo.cpp", directory: "foo")
4242 !2 = !{}
4343 !3 = !{!4}
44 !4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, variables: !2)
44 !4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
4545 !5 = !DISubroutineType(types: !6)
4646 !6 = !{null}
4747 !7 = !{i32 2, !"Dwarf Version", i32 4}
22 @g1 = global double 0.000000e+00, align 8
33 @g2 = global i32 0, align 4
44
5 define void @_Z16fpuop_arithmeticjj(i32, i32) {
5 define void @_Z16fpuop_arithmeticjj(i32, i32) !dbg !4 {
66 entry:
77 switch i32 undef, label %sw.bb.i1921 [
88 ]
4646 !1 = !DIFile(filename: "fpu_ieee.cpp", directory: "x87stackifier")
4747 !2 = !{}
4848 !3 = !{!4}
49 !4 = distinct !DISubprogram(name: "fpuop_arithmetic", linkageName: "_Z16fpuop_arithmeticjj", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !6, type: !7, function: void (i32, i32)* @_Z16fpuop_arithmeticjj, variables: !10)
49 !4 = distinct !DISubprogram(name: "fpuop_arithmetic", linkageName: "_Z16fpuop_arithmeticjj", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !6, type: !7, variables: !10)
5050 !5 = !DIFile(filename: "f1.cpp", directory: "x87stackifier")
5151 !6 = !DIFile(filename: "f1.cpp", directory: "x87stackifier")
5252 !7 = !DISubroutineType(types: !8)
5353 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: 1)
5454 !1 = !DIFile(filename: "24199.cpp", directory: "/bin")
5555 !2 = !{i32 2, !"Debug Info Version", i32 3}
56 !3 = distinct !DISubprogram(linkageName: "foo", file: !1, line: 18, isLocal: false, isDefinition: true, scopeLine: 18, function: void (%struct.A*)* @foo)
56 !3 = distinct !DISubprogram(linkageName: "foo", file: !1, line: 18, isLocal: false, isDefinition: true, scopeLine: 18)
5757 !4 = !DIExpression()
5858 !5 = !DILocalVariable(name: "this", arg: 1, scope: !3, flags: DIFlagArtificial | DIFlagObjectPointer)
5959 !6 = !DILocation(line: 0, scope: !3)
4242 ; CHECK-LABEL: test_with_debug
4343 ; CHECK: movl [[A]], [[B]]
4444 ; CHECK-NEXT: movl [[A]], [[C]]
45 define void @test_with_debug() {
45 define void @test_with_debug() !dbg !13 {
4646 entry:
4747 %c = alloca %class.C, align 1
4848 %0 = load i8, i8* @argc, align 1
7474 !10 = !DIDerivedType(baseType: !"_ZTS1C", tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial)
7575 !11 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
7676 !12 = !{!13}
77 !13 = distinct !DISubprogram(name: "test_with_debug", linkageName: "test_with_debug", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !14, type: !15, function: void ()* @test_with_debug, variables: !17)
77 !13 = distinct !DISubprogram(name: "test_with_debug", linkageName: "test_with_debug", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !14, type: !15, variables: !17)
7878 !14 = !DIFile(filename: "test.cpp", directory: "")
7979 !15 = !DISubroutineType(types: !16)
8080 !16 = !{null}
33 target triple = "i686-pc-linux"
44
55 ; Function Attrs: nounwind
6 define void @test() #0 {
6 define void @test() #0 !dbg !4 {
77 entry:
88 call void bitcast (void (...)* @bar to void ()*)(), !dbg !11
99 ret void, !dbg !12
2222 !1 = !DIFile(filename: "test.c", directory: "movpc-test")
2323 !2 = !{}
2424 !3 = !{!4}
25 !4 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: false, function: void ()* @test, variables: !2)
25 !4 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: false, variables: !2)
2626 !5 = !DISubroutineType(types: !6)
2727 !6 = !{null}
2828 !7 = !{i32 2, !"Dwarf Version", i32 4}
1717 !1 = !DIFile(filename: "file.c", directory: "")
1818 !2 = !{}
1919 !3 = !{!4}
20 !4 = distinct !DISubprogram(name: "", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !1, type: !6, function: i32 ()* null, variables: !2)
20 !4 = distinct !DISubprogram(name: "", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !1, type: !6, variables: !2)
2121 !6 = !DISubroutineType(types: !7)
2222 !7 = !{!8}
2323 !8 = !DIBasicType(tag: DW_TAG_base_type, size: 32, align: 32, encoding: DW_ATE_signed)
2424 ; CHECK: .cfi_adjust_cfa_offset -8
2525 ; CHECK: addl $8, %esp
2626 ; CHECK: .cfi_adjust_cfa_offset -8
27 define void @test1() #0 {
27 define void @test1() #0 !dbg !4 {
2828 entry:
2929 tail call void @foo(i32 1, i32 2) #1, !dbg !10
3030 tail call x86_stdcallcc void @stdfoo(i32 3, i32 4) #1, !dbg !11
4141 !1 = !DIFile(filename: "foo.c", directory: "foo")
4242 !2 = !{}
4343 !3 = !{!4}
44 !4 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, function: void ()* @test1, variables: !2)
44 !4 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, variables: !2)
4545 !5 = !DISubroutineType(types: !6)
4646 !6 = !{null}
4747 !7 = !{i32 2, !"Dwarf Version", i32 4}
77 @a = external global { i64, [56 x i8] }, align 32
88
99 ; Function Attrs: nounwind sspreq
10 define i32 @_Z18read_response_sizev() #0 {
10 define i32 @_Z18read_response_sizev() #0 !dbg !9 {
1111 entry:
1212 tail call void @llvm.dbg.value(metadata !22, i64 0, metadata !23, metadata !DIExpression()), !dbg !39
1313 %0 = load i64, i64* getelementptr inbounds ({ i64, [56 x i8] }, { i64, [56 x i8] }* @a, i32 0, i32 0), align 8, !dbg !40
3333 !6 = !{!7}
3434 !7 = !DIEnumerator(name: "max_frame_size", value: 0) ; [ DW_TAG_enumerator ] [max_frame_size :: 0]
3535 !8 = !{!9, !24, !41, !65}
36 !9 = distinct !DISubprogram(name: "read_response_size", linkageName: "_Z18read_response_sizev", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 27, file: !1, scope: !10, type: !11, function: i32 ()* @_Z18read_response_sizev, variables: !14)
36 !9 = distinct !DISubprogram(name: "read_response_size", linkageName: "_Z18read_response_sizev", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 27, file: !1, scope: !10, type: !11, variables: !14)
3737 !10 = !DIFile(filename: "", directory: "/Users/matt/ryan_bug")
3838 !11 = !DISubroutineType(types: !12)
3939 !12 = !{!13}
99 ; CHECK-NEXT: idivl
1010 ; CHECK-NEXT: .loc 1 4 3
1111
12 define i32 @foo(i32 %w, i32 %x, i32 %y, i32 %z) nounwind {
12 define i32 @foo(i32 %w, i32 %x, i32 %y, i32 %z) nounwind !dbg !1 {
1313 entry:
1414 %a = add i32 %w, %x, !dbg !8
1515 %b = sdiv i32 %a, %y
2121 !llvm.module.flags = !{!12}
2222
2323 !0 = !DILocalVariable(name: "x", line: 1, arg: 2, scope: !1, file: !2, type: !6)
24 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !10, scope: !2, type: !4, function: i32 (i32, i32, i32, i32)* @foo)
24 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !10, scope: !2, type: !4)
2525 !2 = !DIFile(filename: "test.c", directory: "/dir")
2626 !3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "producer", isOptimized: false, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9)
2727 !4 = !DISubroutineType(types: !5)
88 ; CHECK: .loc 1 2 0 prologue_end # test.c:2:0
99 ; CHECK: add r0, r0, 1
1010 ; CHECK: retsp 2
11 define i32 @f(i32 %a) {
11 define i32 @f(i32 %a) !dbg !4 {
1212 entry:
1313 %a.addr = alloca i32, align 4
1414 store i32 %a, i32* %a.addr, align 4
2626 !1 = !DIFile(filename: "test.c", directory: "")
2727 !2 = !{}
2828 !3 = !{!4}
29 !4 = distinct !DISubprogram(name: "f", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !1, type: !6, function: i32 (i32)* @f, variables: !2)
29 !4 = distinct !DISubprogram(name: "f", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !1, type: !6, variables: !2)
3030 !6 = !DISubroutineType(types: !7)
3131 !7 = !{!8, !8}
3232 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
2525 @_ZTV1B = external unnamed_addr constant [4 x i8*]
2626
2727 ; Function Attrs: nounwind
28 define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 {
28 define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !28 {
2929 entry:
3030 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !30, metadata !38), !dbg !39
3131 %0 = getelementptr inbounds %struct.B, %struct.B* %this, i64 0, i32 0, !dbg !40
3838 declare %struct.A* @_ZN1AC2Ev(%struct.A*)
3939
4040 ; Function Attrs: nounwind
41 define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 {
41 define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !32 {
4242 entry:
4343 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !34, metadata !38), !dbg !44
4444 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !45, metadata !38) #3, !dbg !47
8888 !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
8989 !26 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !"_ZTS1A", type: !23, containingType: !"_ZTS1A")
9090 !27 = !{!28, !32}
91 !28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC2Ev, declaration: !8, variables: !29)
91 !28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !29)
9292 !29 = !{!30}
9393 !30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31)
9494 !31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B")
95 !32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC1Ev, declaration: !8, variables: !33)
95 !32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !33)
9696 !33 = !{!34}
9797 !34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31)
9898 !35 = !{i32 2, !"Dwarf Version", i32 4}
1313 target triple = "arm64-apple-ios"
1414
1515 ; Function Attrs: nounwind optsize
16 define void @_Z5startv() #0 {
16 define void @_Z5startv() #0 !dbg !4 {
1717 entry:
1818 %size = alloca i32, align 4
1919 %0 = bitcast i32* %size to i8*, !dbg !15
4747 !1 = !DIFile(filename: "", directory: "")
4848 !2 = !{}
4949 !3 = !{!4}
50 !4 = distinct !DISubprogram(name: "start", linkageName: "_Z5startv", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @_Z5startv, variables: !9)
50 !4 = distinct !DISubprogram(name: "start", linkageName: "_Z5startv", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !9)
5151 !5 = !DIFile(filename: "test1.c", directory: "")
5252 !6 = !DIFile(filename: "test1.c", directory: "")
5353 !7 = !DISubroutineType(types: !8)
1212 ; CHECK: movn
1313
1414 ; Function Attrs: nounwind
15 define i32 @main() {
15 define i32 @main() !dbg !4 {
1616 entry:
1717 %retval = alloca i32, align 4
1818 store i32 0, i32* %retval
2626 !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
2727 !2 = !{}
2828 !3 = !{!4}
29 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @main, variables: !2)
29 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
3030 !5 = !DISubroutineType(types: !6)
3131 !6 = !{!7}
3232 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1717 ; CHECK-4: DW_AT_high_pc [DW_FORM_data4] (0x00000008)
1818 ; CHECK-3: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
1919
20 define i32 @main() nounwind {
20 define i32 @main() nounwind !dbg !3 {
2121 ret i32 0, !dbg !8
2222 }
2323
2929 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !9, enums: !1, retainedTypes: !1, subprograms: !2, globals: !1, imports: !1)
3030 !1 = !{}
3131 !2 = !{!3}
32 !3 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !4, type: !5, function: i32 ()* @main, variables: !1)
32 !3 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !4, type: !5, variables: !1)
3333 !4 = !DIFile(filename: "tmp.c", directory: "/home/tim/llvm/build")
3434 !5 = !DISubroutineType(types: !6)
3535 !6 = !{!7}
4141 @a = global i64 0, align 8
4242 @b = global i32* null, align 8
4343
44 define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 {
44 define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 !dbg !25 {
4545 entry:
4646 %agg.tmp = alloca %struct.A, align 8
4747 tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !30, metadata !46), !dbg !47
6666 ; Function Attrs: nounwind
6767 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #3
6868
69 define void @_Z3f111A(%struct.A* nocapture readonly %p1) #0 {
69 define void @_Z3f111A(%struct.A* nocapture readonly %p1) #0 !dbg !31 {
7070 entry:
7171 %agg.tmp.i = alloca %struct.A, align 8
7272 tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !33, metadata !46), !dbg !63
8282 ret void, !dbg !73
8383 }
8484
85 define void @_Z3f16v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
85 define void @_Z3f16v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !34 {
8686 entry:
8787 %agg.tmp.i.i = alloca %struct.A, align 8
8888 %d = alloca %struct.B, align 1
184184 !22 = !DISubroutineType(types: !23)
185185 !23 = !{null, !19}
186186 !24 = !{!25, !31, !34}
187 !25 = distinct !DISubprogram(name: "f13", linkageName: "_Z3f131A", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !26, type: !27, function: void (%struct.A*)* @_Z3f131A, variables: !29)
187 !25 = distinct !DISubprogram(name: "f13", linkageName: "_Z3f131A", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !26, type: !27, variables: !29)
188188 !26 = !DIFile(filename: "test.cpp", directory: "")
189189 !27 = !DISubroutineType(types: !28)
190190 !28 = !{null, !"_ZTS1A"}
191191 !29 = !{!30}
192192 !30 = !DILocalVariable(name: "p1", line: 13, arg: 1, scope: !25, file: !26, type: !"_ZTS1A")
193 !31 = distinct !DISubprogram(name: "f11", linkageName: "_Z3f111A", line: 17, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !5, scope: !26, type: !27, function: void (%struct.A*)* @_Z3f111A, variables: !32)
193 !31 = distinct !DISubprogram(name: "f11", linkageName: "_Z3f111A", line: 17, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !5, scope: !26, type: !27, variables: !32)
194194 !32 = !{!33}
195195 !33 = !DILocalVariable(name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A")
196 !34 = distinct !DISubprogram(name: "f16", linkageName: "_Z3f16v", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !5, scope: !26, type: !35, function: void ()* @_Z3f16v, variables: !37)
196 !34 = distinct !DISubprogram(name: "f16", linkageName: "_Z3f16v", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !5, scope: !26, type: !35, variables: !37)
197197 !35 = !DISubroutineType(types: !36)
198198 !36 = !{null}
199199 !37 = !{!38, !39}
55 ; func();
66 ; }
77
8 define void @prologue_end_test() nounwind uwtable {
8 define void @prologue_end_test() nounwind uwtable !dbg !4 {
99 ; CHECK: prologue_end_test:
1010 ; CHECK: .cfi_startproc
1111 ; CHECK: stp x29, x30
3030 !1 = !DIFile(filename: "foo.c", directory: "/tmp")
3131 !2 = !{}
3232 !3 = !{!4}
33 !4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, function: void ()* @prologue_end_test, variables: !2)
33 !4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2)
3434 !5 = !DISubroutineType(types: !6)
3535 !6 = !{null}
3636 !7 = !{i32 2, !"Dwarf Version", i32 2}
3030 %struct.five = type { i32, i32, i32, i32, i32 }
3131
3232 ; Function Attrs: nounwind ssp
33 define i32 @return_five_int(%struct.five* %f) #0 {
33 define i32 @return_five_int(%struct.five* %f) #0 !dbg !4 {
3434 entry:
3535 call void @llvm.dbg.declare(metadata %struct.five* %f, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
3636 %a = getelementptr inbounds %struct.five, %struct.five* %f, i32 0, i32 0, !dbg !19
5151 !1 = !DIFile(filename: "struct_by_value.c", directory: "")
5252 !2 = !{}
5353 !3 = !{!4}
54 !4 = distinct !DISubprogram(name: "return_five_int", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !5, type: !6, function: i32 (%struct.five*)* @return_five_int, variables: !2)
54 !4 = distinct !DISubprogram(name: "return_five_int", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !5, type: !6, variables: !2)
5555 !5 = !DIFile(filename: "struct_by_value.c", directory: "")
5656 !6 = !DISubroutineType(types: !7)
5757 !7 = !{!8, !9}
1212 target triple = "thumbv7-apple-ios"
1313
1414 ; Function Attrs: nounwind
15 define arm_aapcscc void @_Z1hiiiif(i32, i32, i32, i32, float %x) #0 {
15 define arm_aapcscc void @_Z1hiiiif(i32, i32, i32, i32, float %x) #0 !dbg !4 {
1616 entry:
1717 tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !12, metadata !DIExpression()), !dbg !18
1818 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !13, metadata !DIExpression()), !dbg !18
4444 !1 = !DIFile(filename: "/", directory: "")
4545 !2 = !{}
4646 !3 = !{!4}
47 !4 = distinct !DISubprogram(name: "h", linkageName: "_Z1hiiiif", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, function: void (i32, i32, i32, i32, float)* @_Z1hiiiif, variables: !11)
47 !4 = distinct !DISubprogram(name: "h", linkageName: "_Z1hiiiif", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !11)
4848 !5 = !DIFile(filename: "/arm.cpp", directory: "")
4949 !6 = !DIFile(filename: "/arm.cpp", directory: "")
5050 !7 = !DISubroutineType(types: !8)
2626 @_ZTV1B = external unnamed_addr constant [4 x i8*]
2727
2828 ; Function Attrs: nounwind
29 define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 {
29 define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !28 {
3030 entry:
3131 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !30, metadata !40), !dbg !41
3232 %0 = getelementptr inbounds %struct.B, %struct.B* %this, i32 0, i32 0, !dbg !42
3939 declare %struct.A* @_ZN1AC2Ev(%struct.A*)
4040
4141 ; Function Attrs: nounwind
42 define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 {
42 define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !32 {
4343 entry:
4444 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !34, metadata !40), !dbg !46
4545 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !47, metadata !40) #3, !dbg !49
8989 !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
9090 !26 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !"_ZTS1A", type: !23, containingType: !"_ZTS1A")
9191 !27 = !{!28, !32}
92 !28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC2Ev, declaration: !8, variables: !29)
92 !28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !29)
9393 !29 = !{!30}
9494 !30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31)
9595 !31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"_ZTS1B")
96 !32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC1Ev, declaration: !8, variables: !33)
96 !32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !33)
9797 !33 = !{!34}
9898 !34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31)
9999 !35 = !{i32 2, !"Dwarf Version", i32 4}
1212 ; CHECK: mvn
1313
1414 ; Function Attrs: nounwind
15 define i32 @main() {
15 define i32 @main() !dbg !4 {
1616 entry:
1717 %retval = alloca i32, align 4
1818 store i32 0, i32* %retval
2626 !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
2727 !2 = !{}
2828 !3 = !{!4}
29 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @main, variables: !2)
29 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
3030 !5 = !DISubroutineType(types: !6)
3131 !6 = !{!7}
3232 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
1515 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
1616 target triple = "armv7--none-eabi"
1717
18 define float @foo(float %p) {
18 define float @foo(float %p) !dbg !4 {
1919 entry:
2020 tail call void @llvm.dbg.value(metadata float %p, i64 0, metadata !9, metadata !15), !dbg !16
2121 ret float %p, !dbg !18
3030 !1 = !DIFile(filename: "test.c", directory: "")
3131 !2 = !{}
3232 !3 = !{!4}
33 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, function: float (float)* @foo, variables: !8)
33 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !8)
3434 !5 = !DISubroutineType(types: !6)
3535 !6 = !{!7, !7}
3636 !7 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
1111
1212 ; CHECK: .section __DWARF,__debug_str,regular,debug
1313
14 define void @f() {
14 define void @f() !dbg !4 {
1515 ret void, !dbg !9
1616 }
1717 !llvm.dbg.cu = !{!0}
2121 !1 = !DIFile(filename: "/foo/test.c", directory: "/foo")
2222 !2 = !{}
2323 !3 = !{!4}
24 !4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @f, variables: !2)
24 !4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
2525 !5 = !DISubroutineType(types: !6)
2626 !6 = !{null}
2727 !7 = !{i32 2, !"Dwarf Version", i32 4}
1616 target triple = "thumbv7-apple-ios8.0.0"
1717
1818 ; Function Attrs: nounwind optsize readnone
19 define void @run(float %r) #0 {
19 define void @run(float %r) #0 !dbg !4 {
2020 entry:
2121 tail call void @llvm.dbg.declare(metadata float %r, metadata !11, metadata !DIExpression()), !dbg !22
2222 %conv = fptosi float %r to i32, !dbg !23
7070 !1 = !DIFile(filename: "", directory: "/Volumes/Data/radar/15464571")
7171 !2 = !{}
7272 !3 = !{!4}
73 !4 = distinct !DISubprogram(name: "run", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !5, scope: !6, type: !7, function: void (float)* @run, variables: !10)
73 !4 = distinct !DISubprogram(name: "run", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !5, scope: !6, type: !7, variables: !10)
7474 !5 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/15464571")
7575 !6 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/15464571")
7676 !7 = !DISubroutineType(types: !8)
1818 @b = common global i32 0, align 4
1919
2020 ; Function Attrs: nounwind
21 define void @proc() #0 {
21 define void @proc() #0 !dbg !4 {
2222 entry:
2323 store i8 65, i8* @ch, align 1, !dbg !17
2424 store i32 0, i32* @b, align 4, !dbg !18
3535 !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
3636 !2 = !{}
3737 !3 = !{!4}
38 !4 = distinct !DISubprogram(name: "proc", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @proc, variables: !2)
38 !4 = distinct !DISubprogram(name: "proc", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
3939 !5 = !DISubroutineType(types: !6)
4040 !6 = !{null}
4141 !7 = !{!8, !10}
66 ; func();
77 ; }
88
9 define void @prologue_end_test() nounwind uwtable {
9 define void @prologue_end_test() nounwind uwtable !dbg !4 {
1010 ; CHECK: prologue_end_test:
1111 ; CHECK: .cfi_startproc
1212 ; CHECK: push {r7, lr}
3131 !1 = !DIFile(filename: "foo.c", directory: "/tmp")
3232 !2 = !{}
3333 !3 = !{!4}
34 !4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, function: void ()* @prologue_end_test, variables: !2)
34 !4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2)
3535 !5 = !DISubroutineType(types: !6)
3636 !6 = !{null}
3737 !7 = !{i32 2, !"Dwarf Version", i32 2}
88 ; 0x9d DW_OP_bit_piece
99 ; CHECK: Location description: 90 {{.. .. ((93 ..)|(9d .. ..)) $}}
1010
11 define void @_Z3foov() optsize ssp {
11 define void @_Z3foov() optsize ssp !dbg !1 {
1212 entry:
1313 %call = tail call float @_Z3barv() optsize, !dbg !11
1414 tail call void @llvm.dbg.value(metadata float %call, i64 0, metadata !5, metadata !DIExpression()), !dbg !11
4040 !llvm.module.flags = !{!20}
4141
4242 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130845)", isOptimized: true, emissionKind: 1, file: !18, enums: !19, retainedTypes: !19, subprograms: !16, imports: null)
43 !1 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !18, scope: !2, type: !3, function: void ()* @_Z3foov, variables: !17)
43 !1 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !18, scope: !2, type: !3, variables: !17)
4444 !2 = !DIFile(filename: "k.cc", directory: "/private/tmp")
4545 !3 = !DISubroutineType(types: !4)
4646 !4 = !{null}
0 ; RUN: llc -filetype=asm < %s | FileCheck %s
11 target triple = "thumbv7-apple-ios7.0.0"
22 %class.Matrix3.0.6.10 = type { [9 x float] }
3 define arm_aapcscc void @_Z9GetMatrixv(%class.Matrix3.0.6.10* noalias nocapture sret %agg.result) #0 {
3 define arm_aapcscc void @_Z9GetMatrixv(%class.Matrix3.0.6.10* noalias nocapture sret %agg.result) #0 !dbg !39 {
44 br i1 fcmp oeq (float fadd (float fadd (float fmul (float undef, float undef), float fmul (float undef, float undef)), float fmul (float undef, float undef)), float 0.000000e+00), label %_ZN7Vector39NormalizeEv.exit, label %1
55 tail call arm_aapcscc void @_ZL4Sqrtd() #3
66 br label %_ZN7Vector39NormalizeEv.exit
2020 declare arm_aapcscc void @_ZL4Sqrtd() #2
2121 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "Matrix3", line: 20, size: 288, align: 32, file: !5, identifier: "_ZTS7Matrix3")
2222 !5 = !DIFile(filename: "test.ii", directory: "/Volumes/Data/radar/15094721")
23 !39 = distinct !DISubprogram(name: "GetMatrix", linkageName: "_Z9GetMatrixv", line: 32, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 32, file: !5, scope: !40, type: !41, function: void (%class.Matrix3.0.6.10*)* @_Z9GetMatrixv)
23 !39 = distinct !DISubprogram(name: "GetMatrix", linkageName: "_Z9GetMatrixv", line: 32, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 32, file: !5, scope: !40, type: !41)
2424 !40 = !DIFile(filename: "test.ii", directory: "/Volumes/Data/radar/15094721")
2525 !41 = !DISubroutineType(types: null)
2626 !45 = !DILocalVariable(name: "matrix", line: 35, scope: !39, file: !40, type: !4)
1515 target triple = "armv7--linux-gnueabihf"
1616
1717 ; Function Attrs: nounwind
18 define i32 @main() {
18 define i32 @main() !dbg !4 {
1919 entry:
2020 %retval = alloca i32, align 4
2121 %x = alloca i32, align 4
5151 !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
5252 !2 = !{}
5353 !3 = !{!4}
54 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, function: i32 ()* @main, variables: !2)
54 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2)
5555 !5 = !DISubroutineType(types: !6)
5656 !6 = !{!7}
5757 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
2323 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }]
2424
2525 ; Function Attrs: nounwind sanitize_address
26 define i32 @foo() #0 {
26 define i32 @foo() #0 !dbg !4 {
2727 entry:
2828 ret i32 0, !dbg !10
2929 }
8585 !1 = !DIFile(filename: "asan.c", directory: "D:\5C")
8686 !2 = !{}
8787 !3 = !{!4}
88 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 ()* @foo, variables: !2)
88 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
8989 !5 = !DIFile(filename: "asan.c", directory: "D:C")
9090 !6 = !DISubroutineType(types: !2)
9191 !7 = !{i32 2, !"CodeView", i32 1}
250250 ; OBJ64: }
251251
252252 ; Function Attrs: nounwind
253 define void @f() #0 {
253 define void @f() #0 !dbg !4 {
254254 entry:
255255 call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !12
256256 call void @g(), !dbg !13
271271 !1 = !DIFile(filename: "", directory: "D:\5C")
272272 !2 = !{}
273273 !3 = !{!4}
274 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2)
274 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2)
275275 !5 = !DIFile(filename: "asm.c", directory: "D:\5C")
276276 !6 = !DIFile(filename: "asm.c", directory: "D:C")
277277 !7 = !DISubroutineType(types: !8)
3232 !1 = !DIFile(filename: "", directory: "D:\5C")
3333 !2 = !{}
3434 !3 = !{!4}
35 !4 = distinct !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !6, type: !7, function: i32 (i32)* @"\01?bar@foo@@YAHH@Z", variables: !2)
35 !4 = distinct !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !6, type: !7, variables: !2)
3636 !5 = !DIFile(filename: "src.cpp", directory: "D:\5C")
3737 !6 = !DIFile(filename: "src.cpp", directory: "D:C")
3838 !7 = !DISubroutineType(types: !2)
326326 ; OBJ64: }
327327
328328 ; Function Attrs: nounwind
329 define void @f() #0 {
329 define void @f() #0 !dbg !4 {
330330 entry:
331331 call void @g(), !dbg !12
332332 call void @g(), !dbg !15
347347 !1 = !DIFile(filename: "", directory: "D:\5C")
348348 !2 = !{}
349349 !3 = !{!4}
350 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2)
350 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2)
351351 !5 = !DIFile(filename: "input.c", directory: "D:\5C")
352352 !6 = !DIFile(filename: "input.c", directory: "D:C")
353353 !7 = !DISubroutineType(types: !8)
629629 ; OBJ64: }
630630
631631 ; Function Attrs: nounwind
632 define void @x() #0 {
632 define void @x() #0 !dbg !4 {
633633 entry:
634634 call void @z(), !dbg !14
635635 ret void, !dbg !15
638638 declare void @z() #1
639639
640640 ; Function Attrs: nounwind
641 define void @y() #0 {
641 define void @y() #0 !dbg !9 {
642642 entry:
643643 call void @z(), !dbg !16
644644 ret void, !dbg !17
645645 }
646646
647647 ; Function Attrs: nounwind
648 define void @f() #0 {
648 define void @f() #0 !dbg !10 {
649649 entry:
650650 call void @x(), !dbg !18
651651 call void @y(), !dbg !19
664664 !1 = !DIFile(filename: "", directory: "D:\5C")
665665 !2 = !{}
666666 !3 = !{!4, !9, !10}
667 !4 = distinct !DISubprogram(name: "x", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @x, variables: !2)
667 !4 = distinct !DISubprogram(name: "x", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2)
668668 !5 = !DIFile(filename: "source.c", directory: "D:\5C")
669669 !6 = !DIFile(filename: "source.c", directory: "D:C")
670670 !7 = !DISubroutineType(types: !8)
671671 !8 = !{null}
672 !9 = distinct !DISubprogram(name: "y", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, function: void ()* @y, variables: !2)
673 !10 = distinct !DISubprogram(name: "f", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2)
672 !9 = distinct !DISubprogram(name: "y", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, variables: !2)
673 !10 = distinct !DISubprogram(name: "f", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !7, variables: !2)
674674 !11 = !{i32 2, !"CodeView", i32 1}
675675 !12 = !{i32 1, !"Debug Info Version", i32 3}
676676 !13 = !{!"clang version 3.5 "}
228228 ; OBJ64: }
229229
230230 ; Function Attrs: nounwind
231 define void @f() #0 {
231 define void @f() #0 !dbg !4 {
232232 entry:
233233 call void @g(), !dbg !12
234234 ret void, !dbg !13
247247 !1 = !DIFile(filename: "", directory: "D:\5C")
248248 !2 = !{}
249249 !3 = !{!4}
250 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2)
250 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2)
251251 !5 = !DIFile(filename: "test.c", directory: "D:\5C")
252252 !6 = !DIFile(filename: "test.c", directory: "D:C")
253253 !7 = !DISubroutineType(types: !8)
6565 !1 = !DIFile(filename: "test.cpp", directory: "D:\5C")
6666 !2 = !{}
6767 !3 = !{!4, !7}
68