Search in sources :

Example 1 with LLVMSourceBasicType

use of com.oracle.truffle.llvm.runtime.debug.LLVMSourceBasicType in project sulong by graalvm.

the class DITypeExtractor method visit.

@Override
public void visit(MDBasicType mdType) {
    final String name = MDNameExtractor.getName(mdType.getName());
    final long size = mdType.getSize();
    final long align = mdType.getAlign();
    final long offset = mdType.getOffset();
    LLVMSourceBasicType.Kind kind;
    switch(mdType.getEncoding()) {
        case DW_ATE_ADDRESS:
            kind = LLVMSourceBasicType.Kind.ADDRESS;
            break;
        case DW_ATE_BOOLEAN:
            kind = LLVMSourceBasicType.Kind.BOOLEAN;
            break;
        case DW_ATE_FLOAT:
            kind = LLVMSourceBasicType.Kind.FLOATING;
            break;
        case DW_ATE_SIGNED:
            kind = LLVMSourceBasicType.Kind.SIGNED;
            break;
        case DW_ATE_SIGNED_CHAR:
            kind = LLVMSourceBasicType.Kind.SIGNED_CHAR;
            break;
        case DW_ATE_UNSIGNED:
            kind = LLVMSourceBasicType.Kind.UNSIGNED;
            break;
        case DW_ATE_UNSIGNED_CHAR:
            kind = LLVMSourceBasicType.Kind.UNSIGNED_CHAR;
            break;
        default:
            kind = LLVMSourceBasicType.Kind.UNKNOWN;
            break;
    }
    final LLVMSourceLocation location = scopeBuilder.buildLocation(mdType);
    final LLVMSourceType type = new LLVMSourceBasicType(name, size, align, offset, kind, location);
    parsedTypes.put(mdType, type);
}
Also used : LLVMSourceBasicType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceBasicType) LLVMSourceLocation(com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceLocation) MDString(com.oracle.truffle.llvm.parser.metadata.MDString) LLVMSourceType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceType)

Aggregations

MDString (com.oracle.truffle.llvm.parser.metadata.MDString)1 LLVMSourceBasicType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceBasicType)1 LLVMSourceType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceType)1 LLVMSourceLocation (com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceLocation)1