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);
}
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);
}
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);
}
Aggregations