Add Win32 support to llvm::llvm_execute_on_thread(). Thanks to Aaron Ballman!
[oota-llvm.git] / lib / DebugInfo / DWARFDebugAranges.cpp
index b116f8f7d89eb93fe92636896b3060b088ae9461..576d37d7813a9d1ef6d52a8bcfa7a480d445b66b 100644 (file)
@@ -83,11 +83,24 @@ bool DWARFDebugAranges::extract(DataExtractor debug_aranges_data) {
   return false;
 }
 
+bool DWARFDebugAranges::generate(DWARFContext *ctx) {
+  clear();
+  if (ctx) {
+    const uint32_t num_compile_units = ctx->getNumCompileUnits();
+    for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
+      DWARFCompileUnit *cu = ctx->getCompileUnitAtIndex(cu_idx);
+      if (cu)
+        cu->buildAddressRangeTable(this, true);
+    }
+  }
+  return !isEmpty();
+}
+
 void DWARFDebugAranges::dump(raw_ostream &OS) const {
   const uint32_t num_ranges = getNumRanges();
   for (uint32_t i = 0; i < num_ranges; ++i) {
     const Range &range = Aranges[i];
-    OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)", range.Offset,
+    OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)\n", range.Offset,
                  (uint64_t)range.LoPC, (uint64_t)range.HiPC());
   }
 }