Mercurial > projects > ldc
comparison gen/aa.cpp @ 1571:8d086d552909
IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Fri, 14 Aug 2009 00:39:18 +0200 |
parents | 1d5c3354b3c2 |
children | 819b4f961711 |
comparison
equal
deleted
inserted
replaced
1570:ab03cfb3a212 | 1571:8d086d552909 |
---|---|
100 | 100 |
101 // Only check bounds for rvalues ('aa[key]'). | 101 // Only check bounds for rvalues ('aa[key]'). |
102 // Lvalue use ('aa[key] = value') auto-adds an element. | 102 // Lvalue use ('aa[key] = value') auto-adds an element. |
103 if (!lvalue && global.params.useArrayBounds) { | 103 if (!lvalue && global.params.useArrayBounds) { |
104 llvm::BasicBlock* oldend = gIR->scopeend(); | 104 llvm::BasicBlock* oldend = gIR->scopeend(); |
105 llvm::BasicBlock* failbb = llvm::BasicBlock::Create("aaboundscheckfail", gIR->topfunc(), oldend); | 105 llvm::BasicBlock* failbb = llvm::BasicBlock::Create(gIR->context(), "aaboundscheckfail", gIR->topfunc(), oldend); |
106 llvm::BasicBlock* okbb = llvm::BasicBlock::Create("aaboundsok", gIR->topfunc(), oldend); | 106 llvm::BasicBlock* okbb = llvm::BasicBlock::Create(gIR->context(), "aaboundsok", gIR->topfunc(), oldend); |
107 | 107 |
108 LLValue* nullaa = LLConstant::getNullValue(ret->getType()); | 108 LLValue* nullaa = LLConstant::getNullValue(ret->getType()); |
109 LLValue* cond = gIR->ir->CreateICmpNE(nullaa, ret, "aaboundscheck"); | 109 LLValue* cond = gIR->ir->CreateICmpNE(nullaa, ret, "aaboundscheck"); |
110 gIR->ir->CreateCondBr(cond, okbb, failbb); | 110 gIR->ir->CreateCondBr(cond, okbb, failbb); |
111 | 111 |