Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/gfx/skia/skia/src/sksl/ir/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  SkSLSymbol.cpp

  Sprache: C
 

/*
 * Copyright 2024 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "src/sksl/ir/SkSLSymbol.h"

#include "src/sksl/ir/SkSLExpression.h"
#include "src/sksl/ir/SkSLFieldAccess.h"
#include "src/sksl/ir/SkSLFieldSymbol.h"
#include "src/sksl/ir/SkSLFunctionDeclaration.h"
#include "src/sksl/ir/SkSLFunctionReference.h"
#include "src/sksl/ir/SkSLType.h"
#include "src/sksl/ir/SkSLTypeReference.h"
#include "src/sksl/ir/SkSLVariable.h"
#include "src/sksl/ir/SkSLVariableReference.h"

#include <utility>

namespace SkSL {

std::unique_ptr<Expression> Symbol::instantiate(const Context& context, Position pos) const {
    switch (this->kind()) {
        case Symbol::Kind::kFunctionDeclaration:
            return std::make_unique<FunctionReference>(
                    context, pos, &this->as<FunctionDeclaration>());

        case Symbol::Kind::kVariable: {
            const Variable* var = &this->as<Variable>();
            // default to kRead_RefKind; this will be corrected later if the variable is written to
            return VariableReference::Make(pos, var, VariableReference::RefKind::kRead);
        }
        case Symbol::Kind::kField: {
            const FieldSymbol* field = &this->as<FieldSymbol>();
            auto base = VariableReference::Make(
                    pos, &field->owner(), VariableReference::RefKind::kRead);
            return FieldAccess::Make(context,
                                     pos,
                                     std::move(base),
                                     field->fieldIndex(),
                                     FieldAccess::OwnerKind::kAnonymousInterfaceBlock);
        }
        case Symbol::Kind::kType:
            return TypeReference::Convert(context, pos, &this->as<Type>());

        default:
            SkDEBUGFAILF("unsupported symbol type %d\n", fKind);
            return nullptr;
    }
}

}  // namespace SkSL

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.