Skip to content

Commit

Permalink
make more perlish method names
Browse files Browse the repository at this point in the history
  • Loading branch information
luben committed Mar 30, 2011
1 parent 9352457 commit a732aa3
Showing 1 changed file with 69 additions and 71 deletions.
140 changes: 69 additions & 71 deletions runtime/parrot/library/LLVM/Value.pm
Expand Up @@ -19,83 +19,81 @@ class LLVM::Value is LLVM::Opaque {
}

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 {
for hash(
Argument => "argument",
BasicBlock => "basic_block",
InlineAsm => "inline_asm",
User => "user",
Constant => "constant",
ConstantAggregateZero => "constant_aggregate_zero",
ConstantArray => "constant_array",
ConstantExpr => "constant_expr",
ConstantFP => "constant_f_p",
ConstantInt => "constant_int",
ConstantPointerNull => "constant_pointer_null",
ConstantStruct => "constant_struct",
ConstantVector => "constant_vector",
GlobalValue => "global_value",
Function => "function",
GlobalAlias => "global_alias",
GlobalVariable => "global_variable",
UndefValue => "undef_value",
Instruction => "instruction",
BinaryOperator => "binary_operator",
CallInst => "call_inst",
IntrinsicInst => "intrinsic_inst",
DbgInfoIntrinsic => "dbg_info_intrinsic",
DbgDeclareInst => "dbg_declare_inst",
EHSelectorInst => "eh_selector_inst",
MemIntrinsic => "mem_intrinsic",
MemCpyInst => "mem_cpy_inst",
MemMoveInst => "mem_move_inst",
MemSetInst => "mem_set_inst",
CmpInst => "cmp_inst",
FCmpInst => "f_cmp_inst",
ICmpInst => "i_cmp_inst",
ExtractElementInst => "extract_element_inst",
GetElementPtrInst => "get_element_ptr_inst",
InsertElementInst => "insert_element_inst",
InsertValueInst => "insert_value_inst",
PHINode => "phi_node",
SelectInst => "select_inst",
ShuffleVectorInst => "shuffle_vector_inst",
StoreInst => "store_inst",
TerminatorInst => "terminator_inst",
BranchInst => "branch_inst",
InvokeInst => "invoke_inst",
ReturnInst => "return_inst",
SwitchInst => "switch_inst",
UnreachableInst => "unreachable_inst",
UnwindInst => "unwind_inst",
UnaryInstruction => "unary_instruction",
AllocaInst => "alloca_inst",
CastInst => "cast_inst",
BitCastInst => "bit_cast_inst",
FPExtInst => "fp_ext_inst",
FPToSIInst => "fp_to_si_inst",
FPToUIInst => "fp_to_ui_inst",
FPTruncInst => "fp_trunc_inst",
IntToPtrInst => "int_to_ptr_inst",
PtrToIntInst => "ptr_to_int_inst",
SExtInst => "s_ext_inst",
SIToFPInst => "si_to_fp_inst",
TruncInst => "trunc_inst",
UIToFPInst => "ui_to_fp_inst",
ZExtInst => "z_ext_inst",
ExtractValueInst => "extract_value_inst",
LoadInst => "load_inst",
VAArgInst => "va_arg_inst",
).kv -> $call,$sub {
$HOW.add_method(
"isA$_",
"is_$sub",
multi method () {
LLVM::Value.create(
LLVM::call("IsA$_", self)
LLVM::call("IsA$call", self)
)
},
to => $WHAT
Expand Down

0 comments on commit a732aa3

Please sign in to comment.