Check isInlinedSubroutine() before creating DW_TAG_inlined_subroutine.
llvm-svn: 69202
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 597f925..d30e909 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -2091,7 +2091,8 @@
ConstructDbgScope(Scope, ParentStartID, ParentEndID, ParentDie, Unit);
} else {
DIE *ScopeDie = NULL;
- if (MainCU && TAI->doesDwarfUsesInlineInfoSection()) {
+ if (MainCU && TAI->doesDwarfUsesInlineInfoSection()
+ && Scope->isInlinedSubroutine()) {
ScopeDie = new DIE(DW_TAG_inlined_subroutine);
DIE *Origin = MainCU->getDieMapSlotFor(Scope->getDesc().getGV());
AddDIEntry(ScopeDie, DW_AT_abstract_origin, DW_FORM_ref4, Origin);