aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCExpr.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-23 23:47:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-23 23:47:14 +0000
commitff54784683591b2cdbdc18690aeac12c8d87f97b (patch)
tree5c33718b21d9c4209c80781f9e44bdb5c5f3bffb /lib/MC/MCExpr.cpp
parent2d9f5d1d7f7aac13396778ba0d18cf1af8d0d02f (diff)
downloadexternal_llvm-ff54784683591b2cdbdc18690aeac12c8d87f97b.zip
external_llvm-ff54784683591b2cdbdc18690aeac12c8d87f97b.tar.gz
external_llvm-ff54784683591b2cdbdc18690aeac12c8d87f97b.tar.bz2
MC: Sprinkle in some more interesting statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCExpr.cpp')
-rw-r--r--lib/MC/MCExpr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index d0025f3..a9256b6 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "mcexpr"
#include "llvm/MC/MCExpr.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h"
@@ -19,6 +21,12 @@
#include "llvm/Target/TargetAsmBackend.h"
using namespace llvm;
+namespace {
+namespace stats {
+STATISTIC(MCExprEvaluate, "Number of MCExpr evaluations");
+}
+}
+
void MCExpr::print(raw_ostream &OS) const {
switch (getKind()) {
case MCExpr::Target:
@@ -231,6 +239,8 @@ static bool EvaluateSymbolicAdd(const MCValue &LHS,const MCSymbolRefExpr *RHS_A,
bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
const MCAsmLayout *Layout) const {
+ ++stats::MCExprEvaluate;
+
switch (getKind()) {
case Target:
return cast<MCTargetExpr>(this)->EvaluateAsRelocatableImpl(Res, Layout);