mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Add support for printing out statistics information when -stats is added to
the command line git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
#include "llvm/iOther.h"
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "Support/StatisticReporter.h"
|
||||
|
||||
static Statistic<> NumAdded("lowerrefs\t\t- New instructions added");
|
||||
|
||||
namespace {
|
||||
struct DecomposePass : public BasicBlockPass {
|
||||
@@ -112,6 +115,7 @@ void DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) {
|
||||
if (!indexIsZero) {
|
||||
LastPtr = new GetElementPtrInst(LastPtr, Indices, "ptr1");
|
||||
NewInsts.push_back(cast<Instruction>(LastPtr));
|
||||
++NumAdded;
|
||||
}
|
||||
|
||||
// Instruction 2: nextPtr2 = cast nextPtr1 to NextPtrTy
|
||||
@@ -120,6 +124,7 @@ void DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) {
|
||||
if (LastPtr->getType() != NextPtrTy) {
|
||||
LastPtr = new CastInst(LastPtr, NextPtrTy, "ptr2");
|
||||
NewInsts.push_back(cast<Instruction>(LastPtr));
|
||||
++NumAdded;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user