Skip to content

Commit

Permalink
Add Module.verify
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Mar 8, 2011
1 parent c25732a commit 97c4860
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions runtime/parrot/library/LLVM.pm
Expand Up @@ -831,6 +831,24 @@ module LLVM {
# See llvm::createStripSymbolsPass function. */
AddStripSymbolsPass => "vp",

####### Analysis.h

#typedef enum {
# LLVMAbortProcessAction, /* verifier will print to stderr and abort() */
# LLVMPrintMessageAction, /* verifier will print to stderr and return 1 */
# LLVMReturnStatusAction /* verifier will just return 1 */
#} LLVMVerifierFailureAction;


# Verifies that a module is valid, taking the specified action if not.
# Optionally returns a human-readable description of any invalid constructs.
# OutMessage must be disposed with LLVMDisposeMessage. */
VerifyModule => "ipiB", # FIXME

# Verifies that a single function is valid, taking the specified action. Useful
# for debugging. */
VerifyFunction => "ipi",

);

for %funcs.kv -> $name, $signature {
Expand Down
4 changes: 4 additions & 0 deletions runtime/parrot/library/LLVM/Module.pm
Expand Up @@ -9,6 +9,10 @@ class LLVM::Module is LLVM::Opaque {
self.new.wrap( %LLVM::F<ModuleCreateWithName>($name) );
}

method verify($action?) {
%LLVM::F<VerifyModule>(self, $action // 2, "");
}

method dump() {
%LLVM::F<DumpModule>(self);
}
Expand Down

0 comments on commit 97c4860

Please sign in to comment.