aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-29 14:57:45 +0000
committerChris Lattner <sabre@nondot.org>2002-04-29 14:57:45 +0000
commit96c466b06ab0c830b07329c1b16037f585ccbe40 (patch)
treee07bbfb58ede2e61ef3243a083dbe5da3b47d712 /lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
parent691fa3cfb12f459b953dd400057841b10ccf4b72 (diff)
downloadexternal_llvm-96c466b06ab0c830b07329c1b16037f585ccbe40.tar.gz
external_llvm-96c466b06ab0c830b07329c1b16037f585ccbe40.tar.bz2
external_llvm-96c466b06ab0c830b07329c1b16037f585ccbe40.zip
Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp')
-rw-r--r--lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index 0367348ef5..1eb582ebc4 100644
--- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -9,15 +9,16 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h"
-#include "llvm/Constants.h"
+#include "llvm/Constant.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
#include "llvm/Pass.h"
namespace {
struct DecomposePass : public BasicBlockPass {
+ const char *getPassName() const { return "Decompose Subscripting Exps"; }
+
virtual bool runOnBasicBlock(BasicBlock *BB);
private:
@@ -79,8 +80,9 @@ void DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) {
// Check for a zero index. This will need a cast instead of
// a getElementPtr, or it may need neither.
- bool indexIsZero = isa<ConstantUInt>(*OI) &&
- cast<Constant>(*OI)->isNullValue();
+ bool indexIsZero = isa<Constant>(*OI) &&
+ cast<Constant>(*OI)->isNullValue() &&
+ (*OI)->getType() == Type::UIntTy;
// Extract the first index. If the ptr is a pointer to a structure
// and the next index is a structure offset (i.e., not an array offset),