[llvm] r271360 - DwarfDebug: Simplify. NFC.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue May 31 19:58:42 PDT 2016
Author: pcc
Date: Tue May 31 21:58:40 2016
New Revision: 271360
URL: http://llvm.org/viewvc/llvm-project?rev=271360&view=rev
Log:
DwarfDebug: Simplify. NFC.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=271360&r1=271359&r2=271360&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue May 31 21:58:40 2016
@@ -470,12 +470,8 @@ void DwarfDebug::beginModule() {
const Module *M = MMI->getModule();
- unsigned NumDebugCUs = 0;
- for (DICompileUnit *CUNode : M->debug_compile_units()) {
- (void)CUNode;
- ++NumDebugCUs;
- }
-
+ unsigned NumDebugCUs = std::distance(M->debug_compile_units_begin(),
+ M->debug_compile_units_end());
// Tell MMI whether we have debug info.
MMI->setDebugInfoAvailability(NumDebugCUs > 0);
SingleCU = NumDebugCUs == 1;
More information about the llvm-commits
mailing list