All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.qbicc.object.FunctionDeclaration Maven / Gradle / Ivy

There is a newer version: 0.77.0
Show newest version
package org.qbicc.object;

import static org.qbicc.object.Function.*;

import org.qbicc.type.FunctionType;
import org.qbicc.type.definition.element.ExecutableElement;

/**
 * A function declaration.
 */
public final class FunctionDeclaration extends Declaration {
    private final int fnFlags;

    FunctionDeclaration(final ExecutableElement originalElement, ProgramModule programModule, final String name, final FunctionType functionType, final int fnFlags) {
        super(originalElement, programModule, name, functionType);
        this.fnFlags = fnFlags;
    }

    FunctionDeclaration(final Function original) {
        super(original);
        this.fnFlags = original.getFlags();
    }

    public int getFlags() {
        return fnFlags;
    }

    public boolean isNoReturn() {
        return (fnFlags & FN_NO_RETURN) != 0;
    }

    public boolean isNoSideEffects() {
        return (fnFlags & FN_NO_SIDE_EFFECTS) != 0;
    }

    public boolean isNoSafePoints() {
        return (fnFlags & FN_NO_SAFEPOINTS) != 0;
    }

    public boolean isNoThrow() {
        return (fnFlags & FN_NO_THROW) != 0;
    }

    @Override
    public FunctionDeclaration getDeclaration() {
        return this;
    }

    public FunctionType getValueType() {
        return (FunctionType) super.getValueType();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy