diff options
author | Owen Anderson <resistor@mac.com> | 2009-08-04 22:41:48 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-08-04 22:41:48 +0000 |
commit | 48b2f3e4850cd27d54224cd42da8a160d6b95984 (patch) | |
tree | 4a9d1fe3a0e3feacea1d637131b754943e0939f1 /lib/VMCore/LLVMContext.cpp | |
parent | 57035994f7329d63582365df278826dbbac5b046 (diff) |
Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
not hideous. Also, fix some MSVC compile errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContext.cpp')
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index 3cd715866e..22882711a0 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // This file implements LLVMContext, as a wrapper around the opaque -// class LLVMContextImpl. +// struct LLVMContextImpl. // //===----------------------------------------------------------------------===// @@ -29,5 +29,18 @@ LLVMContext& llvm::getGlobalContext() { return *GlobalContext; } -LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { } +LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl()) { } LLVMContext::~LLVMContext() { delete pImpl; } + +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]; +} |