Skip to content
Browse files

[llvm] Bind LLVM::Value.isAFoo methods.

TODO: rename them to more perlish style similar as in LLVM::Builder.
  • Loading branch information...
1 parent 529a8c6 commit 0c7ed058b3dafd395c7845c162093db8155a6f87 @bacek bacek committed with rurban Mar 31, 2011
Showing with 88 additions and 0 deletions.
  1. +88 −0 runtime/parrot/library/LLVM/Value.pm
View
88 runtime/parrot/library/LLVM/Value.pm
@@ -17,6 +17,94 @@ class LLVM::Value is LLVM::Opaque {
method dump() {
LLVM::call("DumpValue", self);
}
+
+INIT {
+ my @types := <
+ Argument
+ BasicBlock
+ InlineAsm
+ User
+ Constant
+ ConstantAggregateZero
+ ConstantArray
+ ConstantExpr
+ ConstantFP
+ ConstantInt
+ ConstantPointerNull
+ ConstantStruct
+ ConstantVector
+ GlobalValue
+ Function
+ GlobalAlias
+ GlobalVariable
+ UndefValue
+ Instruction
+ BinaryOperator
+ CallInst
+ IntrinsicInst
+ DbgInfoIntrinsic
+ DbgDeclareInst
+ EHSelectorInst
+ MemIntrinsic
+ MemCpyInst
+ MemMoveInst
+ MemSetInst
+ CmpInst
+ FCmpInst
+ ICmpInst
+ ExtractElementInst
+ GetElementPtrInst
+ InsertElementInst
+ InsertValueInst
+ PHINode
+ SelectInst
+ ShuffleVectorInst
+ StoreInst
+ TerminatorInst
+ BranchInst
+ InvokeInst
+ ReturnInst
+ SwitchInst
+ UnreachableInst
+ UnwindInst
+ UnaryInstruction
+ AllocaInst
+ CastInst
+ BitCastInst
+ FPExtInst
+ FPToSIInst
+ FPToUIInst
+ FPTruncInst
+ IntToPtrInst
+ PtrToIntInst
+ SExtInst
+ SIToFPInst
+ TruncInst
+ UIToFPInst
+ ZExtInst
+ ExtractValueInst
+ LoadInst
+ VAArgInst
+ >;
+
+ my $HOW := LLVM::Value.HOW;
+ my $WHAT := LLVM::Value.WHAT;
+
+ for @types {
+ $HOW.add_method(
+ "isA$_",
+ multi method () {
+ LLVM::Value.create(
+ LLVM::call("IsA$_", self)
+ )
+ },
+ to => $WHAT
+ );
+ }
}
+}
+
+
+
# vim: ft=perl6

0 comments on commit 0c7ed05

Please sign in to comment.
Something went wrong with that request. Please try again.