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 | afd0c4cd567cadc50d8089278ce95c7909e0902f (patch) | |
tree | 0ca3612b6ab6d41a34cace90d589ff77aaf4ec96 /llvm/lib/VMCore/LLVMContext.cpp | |
parent | e922c77ddd586ab59e3a329be0cb6f6e97824217 (diff) | |
download | bcm5719-llvm-afd0c4cd567cadc50d8089278ce95c7909e0902f.tar.gz bcm5719-llvm-afd0c4cd567cadc50d8089278ce95c7909e0902f.zip |
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.
llvm-svn: 78115
Diffstat (limited to 'llvm/lib/VMCore/LLVMContext.cpp')
-rw-r--r-- | llvm/lib/VMCore/LLVMContext.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/LLVMContext.cpp b/llvm/lib/VMCore/LLVMContext.cpp index 3cd715866e5..22882711a06 100644 --- a/llvm/lib/VMCore/LLVMContext.cpp +++ b/llvm/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]; +} |