use of com.oracle.truffle.llvm.parser.listeners.BCFileRoot in project graal by oracle.
the class LLVMScanner method parseBitcode.
public static void parseBitcode(ByteSequence bitcode, ModelModule model, Source bcSource) {
final BitStream bitstream = BitStream.create(bitcode);
final BCFileRoot fileParser = new BCFileRoot(model, bcSource);
final LLVMScanner scanner = new LLVMScanner(bitstream, fileParser);
final long actualMagicWord = scanner.read(Integer.SIZE);
if (actualMagicWord != Magic.BC_MAGIC_WORD.magic) {
throw new LLVMParserException("Not a valid Bitcode File!");
}
scanner.scanToEnd();
// the root block does not exist in the LLVM file and is therefore never exited by the
// scanner
fileParser.exit();
}
use of com.oracle.truffle.llvm.parser.listeners.BCFileRoot in project sulong by graalvm.
the class LLVMScanner method parseBitcodeBlock.
private static void parseBitcodeBlock(Source source, ByteBuffer bitcode, ModelModule model) {
final BitStream bitstream = BitStream.create(bitcode);
final BCFileRoot fileParser = new BCFileRoot(source, model);
final LLVMScanner scanner = new LLVMScanner(bitstream, fileParser);
final long actualMagicWord = scanner.read(Integer.SIZE);
if (actualMagicWord != BC_MAGIC_WORD) {
throw new RuntimeException("Not a valid Bitcode File!");
}
scanner.scanToEnd();
// the root block does not exist in the LLVM file and is therefore never exited by the
// scanner
fileParser.exit();
}
Aggregations