It turns out most of the thumb2 instructions are not allowed to touch SP. The semanti...
[llvm/avr.git] / lib / VMCore / LLVMContext.cpp
blob22882711a06dcea21e11a77bbd09cdff4729a8ad
1 //===-- LLVMContext.cpp - Implement LLVMContext -----------------------===//
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 LLVMContext, as a wrapper around the opaque
11 // struct LLVMContextImpl.
13 //===----------------------------------------------------------------------===//
15 #include "llvm/LLVMContext.h"
16 #include "llvm/Constants.h"
17 #include "llvm/DerivedTypes.h"
18 #include "llvm/Instruction.h"
19 #include "llvm/Metadata.h"
20 #include "llvm/Support/ManagedStatic.h"
21 #include "LLVMContextImpl.h"
22 #include <cstdarg>
24 using namespace llvm;
26 static ManagedStatic<LLVMContext> GlobalContext;
28 LLVMContext& llvm::getGlobalContext() {
29 return *GlobalContext;
32 LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl()) { }
33 LLVMContext::~LLVMContext() { delete pImpl; }
35 GetElementPtrConstantExpr::GetElementPtrConstantExpr
36 (Constant *C,
37 const std::vector<Constant*> &IdxList,
38 const Type *DestTy)
39 : ConstantExpr(DestTy, Instruction::GetElementPtr,
40 OperandTraits<GetElementPtrConstantExpr>::op_end(this)
41 - (IdxList.size()+1),
42 IdxList.size()+1) {
43 OperandList[0] = C;
44 for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
45 OperandList[i+1] = IdxList[i];