[llvm-commits] [llvm] r49577 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h

Gabor Greif ggreif at gmail.com
Sat Apr 12 00:25:40 PDT 2008


Author: ggreif
Date: Sat Apr 12 02:25:40 2008
New Revision: 49577

URL: http://llvm.org/viewvc/llvm-project?rev=49577&view=rev
Log:
fix templated GEP ctrs

Modified:
    llvm/branches/ggreif/use-diet/include/llvm/Instructions.h

Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49577&r1=49576&r2=49577&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Sat Apr 12 02:25:40 2008
@@ -455,11 +455,11 @@
   /// instruction, the second appends the new instruction to the specified
   /// BasicBlock.
   template<typename InputIterator>
-  GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, 
-                    InputIterator IdxEnd,
-                    unsigned Values,
-                    const std::string &Name,
-                    Instruction *InsertBefore)
+  inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, 
+                           InputIterator IdxEnd,
+                           unsigned Values,
+                           const std::string &Name,
+                           Instruction *InsertBefore);/*
       : Instruction(PointerType::get(
                       checkType(getIndexedType(Ptr->getType(),
                                                IdxBegin, IdxEnd, true)),
@@ -467,11 +467,11 @@
                     GetElementPtr, 0, Values, InsertBefore) {
     init(Ptr, IdxBegin, IdxEnd, Name,
          typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+         }*/
   template<typename InputIterator>
-  GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
-                    unsigned Values,
-                    const std::string &Name, BasicBlock *InsertAtEnd)
+  inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
+                           unsigned Values,
+                           const std::string &Name, BasicBlock *InsertAtEnd);/*
       : Instruction(PointerType::get(
                       checkType(getIndexedType(Ptr->getType(),
                                                IdxBegin, IdxEnd, true)),
@@ -479,7 +479,7 @@
                     GetElementPtr, 0, Values, InsertAtEnd) {
     init(Ptr, IdxBegin, IdxEnd, Name,
          typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+         }*/
 
   /// Constructors - These two constructors are convenience methods because one
   /// and two index getelementptr instructions are so common.
@@ -602,6 +602,40 @@
     OL[i].init(GEPIOL[i], this);
 }
 
+template<typename InputIterator>
+GetElementPtrInst::GetElementPtrInst(Value *Ptr,
+                                     InputIterator IdxBegin, 
+                                     InputIterator IdxEnd,
+                                     unsigned Values,
+                                     const std::string &Name,
+                                     Instruction *InsertBefore)
+  : Instruction(PointerType::get(
+                                 checkType(getIndexedType(Ptr->getType(),
+                                                          IdxBegin, IdxEnd, true)),
+                                 cast<PointerType>(Ptr->getType())->getAddressSpace()),
+                GetElementPtr, OperandTraits<GetElementPtrInst>::op_end(this) - Values,
+                Values, InsertBefore) {
+  init(Ptr, IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+template<typename InputIterator>
+GetElementPtrInst::GetElementPtrInst(Value *Ptr,
+                                     InputIterator IdxBegin,
+                                     InputIterator IdxEnd,
+                                     unsigned Values,
+                                     const std::string &Name,
+                                     BasicBlock *InsertAtEnd)
+  : Instruction(PointerType::get(
+                                 checkType(getIndexedType(Ptr->getType(),
+                                                          IdxBegin, IdxEnd, true)),
+                                 cast<PointerType>(Ptr->getType())->getAddressSpace()),
+                GetElementPtr, OperandTraits<GetElementPtrInst>::op_end(this) - Values,
+                Values, InsertAtEnd) {
+  init(Ptr, IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrInst, Value)
 
 





More information about the llvm-commits mailing list