aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-10-15 16:58:33 +0000
committerDavid Robillard <d@drobilla.net>2009-10-15 16:58:33 +0000
commit7743d332e41c7795dcbaa49511293f22597e4db7 (patch)
treec6018e89d3265698e992a3e96b77a25ae40675b6 /src/llvm.cpp
parentcc8d52479fea5b2f4419463daf027ec11e813dc8 (diff)
downloadresp-7743d332e41c7795dcbaa49511293f22597e4db7.tar.gz
resp-7743d332e41c7795dcbaa49511293f22597e4db7.tar.bz2
resp-7743d332e41c7795dcbaa49511293f22597e4db7.zip
Replace more use of at(0) with head().
git-svn-id: http://svn.drobilla.net/resp/tuplr@228 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r--src/llvm.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 1b01e4d..30927d4 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -46,12 +46,12 @@ static const Type*
llType(const AType* t)
{
if (t->kind == AType::PRIM) {
- if (t->at(0)->str() == "Nothing") return Type::VoidTy;
- if (t->at(0)->str() == "Bool") return Type::Int1Ty;
- if (t->at(0)->str() == "Int") return Type::Int32Ty;
- if (t->at(0)->str() == "Float") return Type::FloatTy;
+ if (t->head()->str() == "Nothing") return Type::VoidTy;
+ if (t->head()->str() == "Bool") return Type::Int1Ty;
+ if (t->head()->str() == "Int") return Type::Int32Ty;
+ if (t->head()->str() == "Float") return Type::FloatTy;
throw Error(t->loc, string("Unknown primitive type `") + t->str() + "'");
- } else if (t->kind == AType::EXPR && t->at(0)->str() == "Fn") {
+ } else if (t->kind == AType::EXPR && t->head()->str() == "Fn") {
const AType* retT = t->at(2)->as<const AType*>();
if (!llType(retT))
return NULL;
@@ -339,7 +339,7 @@ LLVMEngine::compilePrimitive(CEnv& cenv, APrimitive* prim)
Value* a = llVal(prim->at(1)->compile(cenv));
Value* b = llVal(prim->at(2)->compile(cenv));
bool isFloat = cenv.type(prim->at(1))->str() == "Float";
- const string n = prim->at(0)->to<ASymbol*>()->str();
+ const string n = prim->head()->to<ASymbol*>()->str();
// Binary arithmetic operations
Instruction::BinaryOps op = (Instruction::BinaryOps)0;