summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-03-11 23:44:52 +0000
committerDevang Patel <dpatel@apple.com>2010-03-11 23:44:52 +0000
commitf5c2a6b371e382a5d913805fcd373785d28015b5 (patch)
tree65d12b530923aed7b91652cbd771b2a5649659ac
parentfaec0815a3c71d0c146062b7f3f1216335f5e52d (diff)
downloadbcm5719-llvm-f5c2a6b371e382a5d913805fcd373785d28015b5.tar.gz
bcm5719-llvm-f5c2a6b371e382a5d913805fcd373785d28015b5.zip
There is no need to create specification DIE for definitions at DIFile level.
llvm-svn: 98302
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index bccca34d068..fe8c95e8f70 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1324,6 +1324,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(MDNode *SPNode) {
// expect specification DIE in parent function. So avoid creating
// specification DIE for a function defined inside a function.
if (SP.isDefinition() && !SP.getContext().isCompileUnit()
+ && !SP.getContext().isFile()
&& !SP.getContext().isSubprogram()) {
addUInt(SPDie, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1);
// Add arguments.
@@ -1684,7 +1685,7 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
// Do not create specification DIE if context is either compile unit
// or a subprogram.
if (DI_GV.isDefinition() && !GVContext.isCompileUnit()
- && !GVContext.isSubprogram()) {
+ && !GVContext.isFile() && !GVContext.isSubprogram()) {
// Create specification DIE.
DIE *VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
OpenPOWER on IntegriCloud