Skip to content
Browse files

Added the @LLVMECB YARD tag and used it to add aditional documentatio…

…n to methods that require the extended C bindings in the Support module and the Value and Module classes.
  • Loading branch information...
1 parent f29e628 commit ee957707f8c242c7ec6a4772d167b0d91bb618fb @chriswailes committed Jun 12, 2012
Showing with 16 additions and 4 deletions.
  1. +2 −0 lib/rltk/cg/module.rb
  2. +2 −0 lib/rltk/cg/support.rb
  3. +2 −0 lib/rltk/cg/value.rb
  4. +10 −4 yardlib/rltk.rb
View
2 lib/rltk/cg/module.rb
@@ -97,6 +97,8 @@ def dump
# file may be specified via a file name (which will be created or
# truncated) or an object that responds to #fileno.
#
+ # @LLVMECB
+ #
# @param [String, #fileno] io File name or object with a file descriptor to print to.
#
# @return [void]
View
2 lib/rltk/cg/support.rb
@@ -21,6 +21,8 @@ module Support
# Load a shared library into memory and make its exported symbols
# available to execution engines.
#
+ # @LLVMECB
+ #
# @param [String] lib Path to the shared library to load.
def self.load_library(lib)
Bindings.load_library_permanently(lib).to_bool
View
2 lib/rltk/cg/value.rb
@@ -99,6 +99,8 @@ def null?
# may be specified via a file name (which will be created or
# truncated) or an object that responds to #fileno.
#
+ # @LLVMECB
+ #
# @param [String, #fileno] io File name or object with a file descriptor to print to.
#
# @return [void]
View
14 yardlib/rltk.rb
@@ -8,14 +8,19 @@
class RLTKTagFactory < YARD::Tags::DefaultFactory
def parse_tag(name, text)
case name
+ when :LLVMECB then ecb_tag()
when :LLVMInst then inst_tag(text)
when :LLVMPass then pass_tag(text)
else super
end
end
-
+
private
-
+
+ def ecb_tag
+ YARD::Tags::Tag.new('note', 'This method requires the [LLVM Extended C Bindings](https://github.com/chriswailes/llvm-ecb).')
+ end
+
def inst_tag(text)
url = "http://llvm.org/docs/LangRef.html#i_#{text}"
markup = "<a href=\"#{url}\">LLVM Instruction: #{text}</a>"
@@ -31,6 +36,7 @@ def pass_tag(text)
end
end
-YARD::Tags::Library.define_tag 'Instruction', :LLVMInst
-YARD::Tags::Library.define_tag 'Pass', :LLVMPass
+YARD::Tags::Library.define_tag 'ExtendedBindings', :LLVMECB
+YARD::Tags::Library.define_tag 'Instruction', :LLVMInst
+YARD::Tags::Library.define_tag 'Pass', :LLVMPass
YARD::Tags::Library.default_factory = RLTKTagFactory

0 comments on commit ee95770

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