Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made to always be named parameter for consistency

  • Loading branch information...
commit 069ba8cdfa898c987d2539ccf7489ef7a4ea4195 1 parent 47411b9
@bacek bacek authored rurban committed
View
40 runtime/parrot/library/LLVM/Builder.pm
@@ -127,14 +127,14 @@ class LLVM::Builder is LLVM::Opaque {
# # Arithmetic is generated in INIT block.
# LLVMBuildNeg => "pppt",
- multi method neg(LLVM::Value $v, $name?) {
+ multi method neg(LLVM::Value $v, :$name?) {
LLVM::Value.create(
LLVM::call("BuildNeg", self, $v, $name)
);
}
# LLVMBuildNot => "pppt",
- multi method not(LLVM::Value $v, $name?) {
+ multi method not(LLVM::Value $v, :$name?) {
LLVM::Value.create(
LLVM::call("BuildNot", self, $v, $name)
);
@@ -142,27 +142,27 @@ class LLVM::Builder is LLVM::Opaque {
# # Memory
# LLVMBuildMalloc => "pppt",
- multi method malloc(LLVM::Type $type, $name?) {
+ multi method malloc(LLVM::Type $type, :$name?) {
LLVM::Value.create(
LLVM::call("BuildMalloc", self, $type, $name)
);
}
# LLVMBuildArrayMalloc => "ppppt",
- multi method array_malloc(LLVM::Type $type, LLVM::Value $n, $name?) {
+ multi method array_malloc(LLVM::Type $type, LLVM::Value $n, :$name?) {
LLVM::Value.create(
LLVM::call("BuildArrayMalloc", self, $type, $n, $name)
);
}
# LLVMBuildAlloca => "pppt",
- multi method alloca(LLVM::Type $type, $name?) {
+ multi method alloca(LLVM::Type $type, :$name?) {
LLVM::Value.create(
LLVM::call("BuildAlloca", self, $type, $name)
);
}
# LLVMBuildArrayAlloca => "ppppt",
- multi method array_alloca(LLVM::Type $type, LLVM::Value $n, $name?) {
+ multi method array_alloca(LLVM::Type $type, LLVM::Value $n, :$name?) {
LLVM::Value.create(
LLVM::call("BuildArrayAlloca", self, $type, $n, $name)
);
@@ -175,7 +175,7 @@ class LLVM::Builder is LLVM::Opaque {
}
# LLVMBuildLoad => "pppt",
- multi method load(LLVM::Value $ptr, $name?) {
+ multi method load(LLVM::Value $ptr, :$name?) {
LLVM::Value.create(
LLVM::call("BuildLoad", self, $ptr, $name)
);
@@ -195,7 +195,7 @@ class LLVM::Builder is LLVM::Opaque {
}
# LLVMBuildStructGEP => "ppppt",
- multi method struct_gep(LLVM::Value $ptr, $idx, $name?) {
+ multi method struct_gep(LLVM::Value $ptr, $idx, :$name?) {
LLVM::Value.create(
LLVM::call("BuildStructGEP", self, $ptr, $idx, $name)
);
@@ -240,7 +240,7 @@ class LLVM::Builder is LLVM::Opaque {
# # Miscellaneous instructions
# LLVMBuildPhi => "pppt",
- multi method phi(LLVM::Type $type, $name?){
+ multi method phi(LLVM::Type $type, :$name?){
LLVM::Value.create(
LLVM::call("BuildFhi", self, $type, $name)
)
@@ -259,69 +259,69 @@ class LLVM::Builder is LLVM::Opaque {
)
}
# LLVMBuildSelect => "pppppt",
- multi method select(LLVM::Value $if, LLVM::BasicBlock $then, LLVM::BasicBlock $else, $name?) {
+ multi method select(LLVM::Value $if, LLVM::BasicBlock $then, LLVM::BasicBlock $else, :$name?) {
LLVM::Value::create(
LLVM::call("BuildSelect", self, $if, $then, $else, $name)
);
}
# LLVMBuildVAArg => "ppppt",
- multi method va_arg(LLVM::Value $list, LLVM::Type $type, $name?) {
+ multi method va_arg(LLVM::Value $list, LLVM::Type $type, :$name?) {
LLVM::Value::create(
LLVM::call("BuildVAARG", self, $list, $type, $name)
);
}
# LLVMBuildExtractElement => "ppppt",
- multi method extract_element(LLVM::Value $vector, LLVM::Value $index, $name?) {
+ multi method extract_element(LLVM::Value $vector, LLVM::Value $index, :$name?) {
LLVM::Value::create(
LLVM::call("BuildExtractElement", self, $vector, $index, $name)
);
}
-
+
# LLVMBuildInsertElement => "pppppt",
- multi method insert_element(LLVM::Value $vector, LLVM::Value $val, LLVM::Value $index, $name?) {
+ multi method insert_element(LLVM::Value $vector, LLVM::Value $val, LLVM::Value $index, :$name?) {
LLVM::Value::create(
LLVM::call("BuildInsertElement", self, $vector, $val, $index, $name)
);
}
# LLVMBuildShuffleVector => "pppppt",
- multi method shuffle_vector(LLVM::Value $v1, LLVM::Value $v2, LLVM::Value $mask, $name?) {
+ multi method shuffle_vector(LLVM::Value $v1, LLVM::Value $v2, LLVM::Value $mask, :$name?) {
LLVM::Value::create(
LLVM::call("BuildShuffleVector", self, $v1, $v2, $mask, $name)
);
}
# LLVMBuildExtractValue => "ppp3t",
- multi method extract_value(LLVM::Value $aggr, $index, $name?) {
+ multi method extract_value(LLVM::Value $aggr, $index, :$name?) {
LLVM::Value::create(
LLVM::call("BuildExtractValue", self, $aggr, $index, $name)
);
}
# LLVMBuildInsertValue => "pppp3t",
- multi method insert_value(LLVM::Value $aggr, LLVM::Value $val, $index, $name?) {
+ multi method insert_value(LLVM::Value $aggr, LLVM::Value $val, $index, :$name?) {
LLVM::Value::create(
LLVM::call("BuildInsertValue", self, $aggr, $val, $index, $name)
);
}
# LLVMBuildIsNull => "pppt",
- multi method is_null(LLVM::Value $val, $name?) {
+ multi method is_null(LLVM::Value $val, :$name?) {
LLVM::Value::create(
LLVM::call("BuildIsNull", self, $val, $name)
);
}
# LLVMBuildIsNotNull => "pppt",
- multi method is_not_null(LLVM::Value $val, $name?) {
+ multi method is_not_null(LLVM::Value $val, :$name?) {
LLVM::Value::create(
LLVM::call("BuildIsNotNull", self, $val, $name)
);
}
# LLVMBuildPtrDiff => "ppppt",
- multi method ptr_diff(LLVM::Value $ptr1, LLVM::Value $ptr2, $name?) {
+ multi method ptr_diff(LLVM::Value $ptr1, LLVM::Value $ptr2, :$name?) {
LLVM::Value::create(
LLVM::call("BuildPtrDiff", self, $ptr1, $ptr2, $name)
);
View
4 runtime/parrot/library/LLVM/PassManager.pm
@@ -122,13 +122,13 @@ class LLVM::PassManager is LLVM::Opaque {
LLVM::call("DisposePassManager", self);
}
- method add(Str $name) {
+ multi method add(Str $name) {
my $m := %LLVM::F{"Add" ~ $name};
pir::die("Unknown pass $name") unless pir::defined($m);
$m(self);
}
- method run(LLVM::Module $module) {
+ multi method run(LLVM::Module $module) {
LLVM::call("RunPassManager", self, $module);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.