는 LLVM의 비트 코드를 출력하는 것은 가능하지 않는 것 때문에 더 이상 나는 그 다음주는 LLVM-으로 적외선을 공급하는 파이썬 스크립트를 작성 나 비트 코드. 성능 측면에서 이것은 재앙이지만, 적어도 작동합니다. 에서 [문서]에서
#/usr/bin/env python
import sys, subprocess
args = list(sys.argv)
del args[0] # Remove our exec name
compiler = args[0]
del args[0] # Remove the compile name
compileArguments = [compiler]
outputFile = ''
foundFile = False
for arg in args:
if arg.startswith('-o'):
foundFile = True
elif foundFile:
outputFile = arg
foundFile = False
arg = "/dev/stdout"
compileArguments.append(arg)
compileProcess = subprocess.Popen(compileArguments, stdout=subprocess.PIPE)
asbin = 'llvm-as'
ir2bcProcess = subprocess.Popen([asbin, '-f', '-o=' + outputFile], stdin=compileProcess.stdout)
stdout, stderr = ir2bcProcess.communicate()
compileProcess.wait()
ir2bcProcess.wait()
은 (http://llvm.org/docs/BitCodeFormat.html는) : 일반적으로 (또한, 때로는 anachronistically 바이트 코드라고도 함) LLVM 비트 코드 파일 형식으로 알려진 사실은 두 가지입니다 : 비트 스트림 컨테이너 형식 및 LLVM IR의 컨테이너 형식으로의 인코딩. – abergmeier
IR을 얻을 수있는 동안 컨테이너도 필요합니다. 게다가 이미 LLVM IR을 시도했지만 다른 LLVM 도구로 인식되기 시작하지 않습니다. – abergmeier