summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-11-19 22:42:15 +0000
committerEric Christopher <echristo@gmail.com>2012-11-19 22:42:15 +0000
commitc4639d6ec2cf1e66d0bbc22db9ec530419b18784 (patch)
tree8426c55f84c6d9780ba8c7cfc715f09e7a104fd1 /lib/CodeGen
parent0f1c7f6216c4dfdd4593bef077f7e1e082b624f9 (diff)
downloadllvm-c4639d6ec2cf1e66d0bbc22db9ec530419b18784.tar.gz
llvm-c4639d6ec2cf1e66d0bbc22db9ec530419b18784.tar.bz2
llvm-c4639d6ec2cf1e66d0bbc22db9ec530419b18784.tar.xz
Remove a function argument and propagate const around accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp12
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h6
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index cb61ac3b4c..f625027ae5 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -190,7 +190,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
{
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
- beginModule(M);
+ beginModule();
}
}
DwarfDebug::~DwarfDebug() {
@@ -684,7 +684,7 @@ void DwarfDebug::constructSubprogramDIE(CompileUnit *TheCU,
/// collectInfoFromNamedMDNodes - Collect debug info from named mdnodes such
/// as llvm.dbg.enum and llvm.dbg.ty
-void DwarfDebug::collectInfoFromNamedMDNodes(Module *M) {
+void DwarfDebug::collectInfoFromNamedMDNodes(const Module *M) {
if (NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.sp"))
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
const MDNode *N = NMD->getOperand(i);
@@ -716,7 +716,7 @@ void DwarfDebug::collectInfoFromNamedMDNodes(Module *M) {
/// collectLegacyDebugInfo - Collect debug info using DebugInfoFinder.
/// FIXME - Remove this when dragon-egg and llvm-gcc switch to DIBuilder.
-bool DwarfDebug::collectLegacyDebugInfo(Module *M) {
+bool DwarfDebug::collectLegacyDebugInfo(const Module *M) {
DebugInfoFinder DbgFinder;
DbgFinder.processModule(*M);
@@ -759,10 +759,12 @@ bool DwarfDebug::collectLegacyDebugInfo(Module *M) {
/// beginModule - Emit all Dwarf sections that should come prior to the
/// content. Create global DIEs and emit initial debug info sections.
/// This is invoked by the target AsmPrinter.
-void DwarfDebug::beginModule(Module *M) {
+void DwarfDebug::beginModule() {
if (DisableDebugInfoPrinting)
return;
+ const Module *M = MMI->getModule();
+
// If module has named metadata anchors then use them, otherwise scan the
// module using debug info finder to collect debug info.
NamedMDNode *CU_Nodes = M->getNamedMetadata("llvm.dbg.cu");
@@ -798,7 +800,9 @@ void DwarfDebug::beginModule(Module *M) {
/// endModule - Emit all Dwarf sections that should come after the content.
///
void DwarfDebug::endModule() {
+
if (!FirstCU) return;
+
const Module *M = MMI->getModule();
DenseMap<const MDNode *, LexicalScope *> DeadFnScopeMap;
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 1188ffa73c..5b281fe829 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -494,15 +494,15 @@ public:
/// collectInfoFromNamedMDNodes - Collect debug info from named mdnodes such
/// as llvm.dbg.enum and llvm.dbg.ty
- void collectInfoFromNamedMDNodes(Module *M);
+ void collectInfoFromNamedMDNodes(const Module *M);
/// collectLegacyDebugInfo - Collect debug info using DebugInfoFinder.
/// FIXME - Remove this when DragonEgg switches to DIBuilder.
- bool collectLegacyDebugInfo(Module *M);
+ bool collectLegacyDebugInfo(const Module *M);
/// beginModule - Emit all Dwarf sections that should come prior to the
/// content.
- void beginModule(Module *M);
+ void beginModule();
/// endModule - Emit all Dwarf sections that should come after the content.
///