Fix test.
[oota-llvm.git] / lib / VMCore / LLVMContextImpl.cpp
1 //===--------------- LLVMContextImpl.cpp - Implementation ------*- C++ -*--===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //  This file implements LLVMContextImpl, the opaque implementation 
11 //  of LLVMContext.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "LLVMContextImpl.h"
16 #include "llvm/Constants.h"
17 #include "llvm/DerivedTypes.h"
18 #include "llvm/LLVMContext.h"
19 #include "llvm/Metadata.h"
20 using namespace llvm;
21
22 LLVMContextImpl::LLVMContextImpl(LLVMContext &C) :
23     Context(C), TheTrueVal(0), TheFalseVal(0) { }
24
25 GetElementPtrConstantExpr::GetElementPtrConstantExpr
26   (Constant *C,
27    const std::vector<Constant*> &IdxList,
28    const Type *DestTy)
29     : ConstantExpr(DestTy, Instruction::GetElementPtr,
30                    OperandTraits<GetElementPtrConstantExpr>::op_end(this)
31                    - (IdxList.size()+1),
32                    IdxList.size()+1) {
33   OperandList[0] = C;
34   for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
35     OperandList[i+1] = IdxList[i];
36 }