diff options
| author | Dan Gohman <gohman@apple.com> | 2009-07-17 21:33:58 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-07-17 21:33:58 +0000 |
| commit | d2a251f9f9b2c1ff977d64b6324810e81114c0e5 (patch) | |
| tree | 6860197de5a914ecfe012d1a0e9819420809ea95 /llvm/lib | |
| parent | 563033bcb6eb865d175b4bb40c1646170c998440 (diff) | |
| download | bcm5719-llvm-d2a251f9f9b2c1ff977d64b6324810e81114c0e5.tar.gz bcm5719-llvm-d2a251f9f9b2c1ff977d64b6324810e81114c0e5.zip | |
Add a GEPOperator class, and move the hasNoPointerOverflow
accessors into it.
llvm-svn: 76245
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 915cbb8f8b8..c1b57a6e1e4 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -16,6 +16,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/Operator.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/ConstantRange.h" @@ -1024,7 +1025,7 @@ void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx, setName(Name); // GetElementPtr instructions have undefined results on overflow by default. - setHasNoPointerOverflow(true); + cast<GEPOperator>(this)->setHasNoPointerOverflow(true); } void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) { @@ -1036,7 +1037,7 @@ void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) { setName(Name); // GetElementPtr instructions have undefined results on overflow by default. - setHasNoPointerOverflow(true); + cast<GEPOperator>(this)->setHasNoPointerOverflow(true); } GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) @@ -1050,7 +1051,8 @@ GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) OL[i] = GEPIOL[i]; // Transfer the hasNoPointerOverflow() value from the original GEPI. - setHasNoPointerOverflow(GEPI.hasNoPointerOverflow()); + cast<GEPOperator>(this) + ->setHasNoPointerOverflow(cast<GEPOperator>(GEPI).hasNoPointerOverflow()); } GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, |

