2009-07-16 18:04:31 +00:00
|
|
|
//===--------------- LLVMContextImpl.cpp - Implementation ------*- C++ -*--===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements LLVMContextImpl, the opaque implementation
|
|
|
|
// of LLVMContext.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "LLVMContextImpl.h"
|
|
|
|
#include "llvm/Constants.h"
|
|
|
|
#include "llvm/DerivedTypes.h"
|
|
|
|
#include "llvm/LLVMContext.h"
|
2009-07-28 21:49:47 +00:00
|
|
|
#include "llvm/Metadata.h"
|
2009-07-16 18:04:31 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-21 20:13:12 +00:00
|
|
|
LLVMContextImpl::LLVMContextImpl(LLVMContext &C) :
|
2009-08-02 19:38:12 +00:00
|
|
|
Context(C), TheTrueVal(0), TheFalseVal(0) { }
|
2009-08-04 20:25:11 +00:00
|
|
|
|
|
|
|
GetElementPtrConstantExpr::GetElementPtrConstantExpr
|
|
|
|
(Constant *C,
|
|
|
|
const std::vector<Constant*> &IdxList,
|
|
|
|
const Type *DestTy)
|
|
|
|
: ConstantExpr(DestTy, Instruction::GetElementPtr,
|
|
|
|
OperandTraits<GetElementPtrConstantExpr>::op_end(this)
|
|
|
|
- (IdxList.size()+1),
|
|
|
|
IdxList.size()+1) {
|
|
|
|
OperandList[0] = C;
|
|
|
|
for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
|
|
|
|
OperandList[i+1] = IdxList[i];
|
|
|
|
}
|