[llvm-commits] [llvm] r80033 - /llvm/trunk/lib/MC/MCAssembler.cpp

Daniel Dunbar daniel at zuster.org
Tue Aug 25 14:10:45 PDT 2009


Author: ddunbar
Date: Tue Aug 25 16:10:45 2009
New Revision: 80033

URL: http://llvm.org/viewvc/llvm-project?rev=80033&view=rev
Log:
llvm-mc: Add statistic for number of fragments emitted by the assembler.

Modified:
    llvm/trunk/lib/MC/MCAssembler.cpp

Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=80033&r1=80032&r2=80033&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Aug 25 16:10:45 2009
@@ -7,11 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "assembler"
 #include "llvm/MC/MCAssembler.h"
 #include "llvm/MC/MCSectionMachO.h"
 #include "llvm/Target/TargetMachOWriterInfo.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/ErrorHandling.h"
@@ -21,6 +23,8 @@
 
 class MachObjectWriter;
 
+STATISTIC(EmittedFragments, "Number of emitted assembler fragments");
+
 static void WriteFileData(raw_ostream &OS, const MCSectionData &SD,
                           MachObjectWriter &MOW);
 
@@ -692,6 +696,8 @@
   uint64_t Start = OS.tell();
   (void) Start;
     
+  ++EmittedFragments;
+
   // FIXME: Embed in fragments instead?
   switch (F.getKind()) {
   case MCFragment::FT_Align: {





More information about the llvm-commits mailing list