Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 20 lines (15 sloc) 0.434 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
file = ARGV.shift
klass = ARGV.shift

require 'tempfile'

path = "llvm-type-temp.cpp"

File.open(path, "w+") do |f|
  f.puts "#include \"#{file}\""
  f.puts "void useme(#{klass}* thing);"
  f.puts "void blah(#{klass}* thing) { useme(thing); }"
end

str = `llvm-g++ -I. -I.. -Iexternal_libs/libtommath -emit-llvm -S -o - "#{path}"`

str.split("\n").each do |line|
  if /%"?struct.#{klass}"? = type/.match(line)
    puts line
  end
end
Something went wrong with that request. Please try again.