Search in sources :

Example 6 with FunctionDefinition

use of com.oracle.truffle.llvm.parser.model.functions.FunctionDefinition 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

FunctionDefinition (com.oracle.truffle.llvm.parser.model.functions.FunctionDefinition)6 FunctionDeclaration (com.oracle.truffle.llvm.parser.model.functions.FunctionDeclaration)3 SymbolImpl (com.oracle.truffle.llvm.parser.model.SymbolImpl)2 Type (com.oracle.truffle.llvm.runtime.types.Type)2 FrameSlot (com.oracle.truffle.api.frame.FrameSlot)1 SymbolTable (com.oracle.truffle.llvm.parser.model.SymbolTable)1 ValueSymbol (com.oracle.truffle.llvm.parser.model.ValueSymbol)1 AttributesCodeEntry (com.oracle.truffle.llvm.parser.model.attributes.AttributesCodeEntry)1 Linkage (com.oracle.truffle.llvm.parser.model.enums.Linkage)1 LazyFunctionParser (com.oracle.truffle.llvm.parser.model.functions.LazyFunctionParser)1 GlobalAlias (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalAlias)1 GlobalValueSymbol (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalValueSymbol)1 FunctionType (com.oracle.truffle.llvm.runtime.types.FunctionType)1 MetaType (com.oracle.truffle.llvm.runtime.types.MetaType)1 PointerType (com.oracle.truffle.llvm.runtime.types.PointerType)1 Map (java.util.Map)1