aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2007-01-08 22:15:18 +0000
committerJim Laskey <jlaskey@mac.com>2007-01-08 22:15:18 +0000
commit6488a078baefe7e638a8c0a12396173d32092f1e (patch)
treed9181a4f9f9d7eab98ea73d65110f3a526fc9f4c /lib
parentdfc12993b97c0afb25eb82aacb901bd9000e4be2 (diff)
downloadexternal_llvm-6488a078baefe7e638a8c0a12396173d32092f1e.zip
external_llvm-6488a078baefe7e638a8c0a12396173d32092f1e.tar.gz
external_llvm-6488a078baefe7e638a8c0a12396173d32092f1e.tar.bz2
Need to handle static declarations properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index a03274c..153d96f 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -1614,7 +1614,8 @@ private:
AddType(Static, StaticTy, Unit);
// Add flags.
- AddUInt(Static, DW_AT_external, DW_FORM_flag, 1);
+ if (!StaticDesc->isStatic())
+ AddUInt(Static, DW_AT_external, DW_FORM_flag, 1);
AddUInt(Static, DW_AT_declaration, DW_FORM_flag, 1);
Buffer.AddChild(Static);
@@ -1662,7 +1663,8 @@ private:
}
// Add flags.
- AddUInt(Method, DW_AT_external, DW_FORM_flag, 1);
+ if (!MethodDesc->isStatic())
+ AddUInt(Method, DW_AT_external, DW_FORM_flag, 1);
AddUInt(Method, DW_AT_declaration, DW_FORM_flag, 1);
Buffer.AddChild(Method);
@@ -1773,8 +1775,9 @@ private:
AddString(VariableDie, DW_AT_MIPS_linkage_name, DW_FORM_string,
LinkageName);
}
- AddType(VariableDie, GVD->getType(), Unit);
- AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1);
+ AddType(VariableDie, GVD->getType(), Unit);
+ if (!GVD->isStatic())
+ AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1);
// Add source line info if available.
AddSourceLine(VariableDie, UnitDesc, GVD->getLine());
@@ -1814,7 +1817,6 @@ private:
const std::string &Name = SPD->getName();
const std::string &FullName = SPD->getFullName();
const std::string &LinkageName = SPD->getLinkageName();
- unsigned IsExternal = SPD->isStatic() ? 0 : 1;
DIE *SubprogramDie = new DIE(DW_TAG_subprogram);
AddString(SubprogramDie, DW_AT_name, DW_FORM_string, Name);
@@ -1823,7 +1825,8 @@ private:
LinkageName);
}
if (SPD->getType()) AddType(SubprogramDie, SPD->getType(), Unit);
- AddUInt(SubprogramDie, DW_AT_external, DW_FORM_flag, IsExternal);
+ if (!SPD->isStatic())
+ AddUInt(SubprogramDie, DW_AT_external, DW_FORM_flag, 1);
AddUInt(SubprogramDie, DW_AT_prototyped, DW_FORM_flag, 1);
// Add source line info if available.