aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfWriter.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-01-04 14:30:12 +0000
committerJim Laskey <jlaskey@mac.com>2006-01-04 14:30:12 +0000
commit7d78a2ab7e3575561a15abd5bd386ea4a0301b23 (patch)
tree437aeec090b498d611669f8abaa8a78f950c77cb /lib/CodeGen/DwarfWriter.cpp
parent129e079e0669052daf39068c14ffd158e14dbb3a (diff)
Add check for debug presence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 2fc65e6f95..c62cf8996f 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -70,6 +70,7 @@ void DwarfWriter::EmitSLEB128Bytes(int Value, std::string Comment) {
/// BeginModule - Emit all dwarf sections that should come prior to the content.
///
void DwarfWriter::BeginModule() {
+ if (!DebugInfo.hasInfo()) return;
EmitComment("Dwarf Begin Module");
// define base addresses for dwarf sections
@@ -84,6 +85,7 @@ void DwarfWriter::BeginModule() {
/// EndModule - Emit all dwarf sections that should come after the content.
///
void DwarfWriter::EndModule() {
+ if (!DebugInfo.hasInfo()) return;
EmitComment("Dwarf End Module");
// Print out dwarf file info
std::vector<std::string> Sources = DebugInfo.getSourceFiles();
@@ -96,12 +98,14 @@ void DwarfWriter::EndModule() {
/// BeginFunction - Emit pre-function debug information.
///
void DwarfWriter::BeginFunction() {
+ if (!DebugInfo.hasInfo()) return;
EmitComment("Dwarf Begin Function");
}
/// EndFunction - Emit post-function debug information.
///
void DwarfWriter::EndFunction() {
+ if (!DebugInfo.hasInfo()) return;
EmitComment("Dwarf End Function");
}