Search in sources :

Example 1 with ValueSymbol

use of com.oracle.truffle.llvm.parser.model.ValueSymbol in project sulong by graalvm.

the class LLVMLivenessAnalysis method resolve.

private static int resolve(FrameDescriptor frame, SymbolImpl symbol) {
    if (symbol instanceof ValueSymbol && !(symbol instanceof GlobalValueSymbol || symbol instanceof FunctionDefinition || symbol instanceof FunctionDeclaration)) {
        String name = ((ValueSymbol) symbol).getName();
        assert name != null;
        FrameSlot frameSlot = frame.findFrameSlot(name);
        assert frameSlot != null : "No Frameslot for ValueSymbol: " + symbol;
        return frameSlot.getIndex();
    }
    return -1;
}
Also used : FunctionDeclaration(com.oracle.truffle.llvm.parser.model.functions.FunctionDeclaration) FrameSlot(com.oracle.truffle.api.frame.FrameSlot) FunctionDefinition(com.oracle.truffle.llvm.parser.model.functions.FunctionDefinition) GlobalValueSymbol(com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalValueSymbol) ValueSymbol(com.oracle.truffle.llvm.parser.model.ValueSymbol) GlobalValueSymbol(com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalValueSymbol)

Aggregations

FrameSlot (com.oracle.truffle.api.frame.FrameSlot)1 ValueSymbol (com.oracle.truffle.llvm.parser.model.ValueSymbol)1 FunctionDeclaration (com.oracle.truffle.llvm.parser.model.functions.FunctionDeclaration)1 FunctionDefinition (com.oracle.truffle.llvm.parser.model.functions.FunctionDefinition)1 GlobalValueSymbol (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalValueSymbol)1