Search in sources :

Example 1 with LLVMAlias

use of com.oracle.truffle.llvm.runtime.LLVMAlias in project graal by oracle.

the class ParserDriver method createNewGlobal.

private static void createNewGlobal(LLVMScope scope, String originalName, LLVMParserResult parserResult, GlobalVariable external, String lib, String name) {
    LLVMGlobal originalSymbol = scope.getGlobalVariable(originalName);
    if (originalSymbol == null) {
        throw new LLVMLinkerException(String.format("The symbol %s could not be imported because the symbol %s was not found in library %s", external.getName(), originalName, lib));
    }
    LLVMAlias newGlobal = new LLVMAlias(name, originalSymbol, false);
    parserResult.getRuntime().getFileScope().register(newGlobal);
}
Also used : LLVMAlias(com.oracle.truffle.llvm.runtime.LLVMAlias) LLVMGlobal(com.oracle.truffle.llvm.runtime.global.LLVMGlobal) LLVMLinkerException(com.oracle.truffle.llvm.runtime.except.LLVMLinkerException)

Example 2 with LLVMAlias

use of com.oracle.truffle.llvm.runtime.LLVMAlias in project graal by oracle.

the class LLVMParser method defineAlias.

private void defineAlias(String existingName, String newName, boolean newExported) {
    // handle the file scope
    LLVMSymbol aliasTarget = runtime.lookupSymbol(existingName);
    LLVMAlias aliasSymbol = new LLVMAlias(newName, aliasTarget, newExported);
    runtime.getFileScope().register(aliasSymbol);
    registerInPublicFileScope(aliasSymbol);
}
Also used : LLVMAlias(com.oracle.truffle.llvm.runtime.LLVMAlias) LLVMSymbol(com.oracle.truffle.llvm.runtime.LLVMSymbol)

Example 3 with LLVMAlias

use of com.oracle.truffle.llvm.runtime.LLVMAlias in project graal by oracle.

the class LLVMParser method defineAlias.

private void defineAlias(GlobalAlias alias, DataLayout targetDataLayout) {
    LLVMSymbol alreadyRegisteredSymbol = runtime.getFileScope().get(alias.getName());
    if (alreadyRegisteredSymbol != null) {
        // this alias was already registered by a recursive call
        assert alreadyRegisteredSymbol instanceof LLVMAlias;
        return;
    }
    defineAlias(alias.getName(), alias.isExported(), alias.getValue(), targetDataLayout);
}
Also used : LLVMAlias(com.oracle.truffle.llvm.runtime.LLVMAlias) LLVMSymbol(com.oracle.truffle.llvm.runtime.LLVMSymbol)

Aggregations

LLVMAlias (com.oracle.truffle.llvm.runtime.LLVMAlias)3 LLVMSymbol (com.oracle.truffle.llvm.runtime.LLVMSymbol)2 LLVMLinkerException (com.oracle.truffle.llvm.runtime.except.LLVMLinkerException)1 LLVMGlobal (com.oracle.truffle.llvm.runtime.global.LLVMGlobal)1