chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp

//
// Copyright 2002 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

#include "compiler/translator/QualifierTypes.h"

#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/ImmutableStringBuilder.h"

#include <algorithm>

namespace sh
{

namespace
{

constexpr const ImmutableString kSpecifiedMultipleTimes(" specified multiple times");
constexpr const ImmutableString kInvariantMultipleTimes(
    "The invariant qualifier specified multiple times.");
constexpr const ImmutableString kPreciseMultipleTimes(
    "The precise qualifier specified multiple times.");
constexpr const ImmutableString kPrecisionMultipleTimes(
    "The precision qualifier specified multiple times.");
constexpr const ImmutableString kLayoutMultipleTimes(
    "The layout qualifier specified multiple times.");
constexpr const ImmutableString kLayoutAndInvariantDisallowed(
    "The layout qualifier and invariant qualifier cannot coexist in the same "
    "declaration according to the grammar.");
constexpr const ImmutableString kInterpolationMultipleTimes(
    "The interpolation qualifier specified multiple times.");
constexpr const ImmutableString kOutputLayoutMultipleTimes(
    "Output layout location specified multiple times.");
constexpr const ImmutableString kInvariantQualifierFirst(
    "The invariant qualifier has to be first in the expression.");
constexpr const ImmutableString kStorageAfterInterpolation(
    "Storage qualifiers have to be after interpolation qualifiers.");
constexpr const ImmutableString kPrecisionAfterInterpolation(
    "Precision qualifiers have to be after interpolation qualifiers.");
constexpr const ImmutableString kStorageAfterLayout(
    "Storage qualifiers have to be after layout qualifiers.");
constexpr const ImmutableString kPrecisionAfterLayout(
    "Precision qualifiers have to be after layout qualifiers.");
constexpr const ImmutableString kPrecisionAfterStorage(
    "Precision qualifiers have to be after storage qualifiers.");
constexpr const ImmutableString kPrecisionAfterMemory(
    "Precision qualifiers have to be after memory qualifiers.");

// GLSL ES 3.10 does not impose a strict order on type qualifiers and allows multiple layout
// declarations.
// GLSL ES 3.10 Revision 4, 4.10 Order of Qualification
bool AreTypeQualifierChecksRelaxed(int shaderVersion)
{}

bool IsScopeQualifier(TQualifier qualifier)
{}

bool IsScopeQualifierWrapper(const TQualifierWrapperBase *qualifier)
{}

// Returns true if the invariant/precise for the qualifier sequence holds
bool IsInvariantCorrect(const TTypeQualifierBuilder::QualifierSequence &qualifiers)
{}

ImmutableString QualifierSpecifiedMultipleTimesErrorMessage(const ImmutableString &qualifierString)
{}

// Returns true if there are qualifiers which have been specified multiple times
// If areQualifierChecksRelaxed is set to true, then layout qualifier repetition is allowed.
bool HasRepeatingQualifiers(const TTypeQualifierBuilder::QualifierSequence &qualifiers,
                            bool areQualifierChecksRelaxed,
                            ImmutableString *errorMessage)
{}

// GLSL ES 3.00_6, 4.7 Order of Qualification
// The correct order of qualifiers is:
// invariant-qualifier interpolation-qualifier storage-qualifier precision-qualifier
// layout-qualifier has to be before storage-qualifier.
//
// GLSL ES 3.1 relaxes the order of qualification:
// When multiple qualifiers are present in a declaration, they may appear in any order, but they
// must all appear before the type.
bool AreQualifiersInOrder(const TTypeQualifierBuilder::QualifierSequence &qualifiers,
                          int shaderVersion,
                          ImmutableString *errorMessage)
{}

struct QualifierComparator
{};

void SortSequence(TTypeQualifierBuilder::QualifierSequence &qualifiers)
{}

// Handles the joining of storage qualifiers for variables.
bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storageQualifier)
{}

// Handles the joining of storage qualifiers for a parameter in a function.
bool JoinParameterStorageQualifier(TQualifier *joinedQualifier, TQualifier storageQualifier)
{}

bool JoinMemoryQualifier(TMemoryQualifier *joinedMemoryQualifier, TQualifier memoryQualifier)
{}

TTypeQualifier GetVariableTypeQualifierFromSortedSequence(
    const TTypeQualifierBuilder::QualifierSequence &sortedSequence,
    TDiagnostics *diagnostics)
{}

TTypeQualifier GetParameterTypeQualifierFromSortedSequence(
    TBasicType parameterBasicType,
    const TTypeQualifierBuilder::QualifierSequence &sortedSequence,
    TDiagnostics *diagnostics)
{}
}  // namespace

TLayoutQualifier JoinLayoutQualifiers(TLayoutQualifier leftQualifier,
                                      TLayoutQualifier rightQualifier,
                                      const TSourceLoc &rightQualifierLocation,
                                      TDiagnostics *diagnostics)
{}

unsigned int TInvariantQualifierWrapper::getRank() const
{}

unsigned int TPreciseQualifierWrapper::getRank() const
{}

unsigned int TInterpolationQualifierWrapper::getRank() const
{}

unsigned int TLayoutQualifierWrapper::getRank() const
{}

unsigned int TStorageQualifierWrapper::getRank() const
{}

unsigned int TMemoryQualifierWrapper::getRank() const
{}

unsigned int TPrecisionQualifierWrapper::getRank() const
{}

TTypeQualifier::TTypeQualifier(TQualifier scope, const TSourceLoc &loc)
    :{}

TTypeQualifierBuilder::TTypeQualifierBuilder(const TStorageQualifierWrapper *scope,
                                             int shaderVersion)
    :{}

void TTypeQualifierBuilder::appendQualifier(const TQualifierWrapperBase *qualifier)
{}

bool TTypeQualifierBuilder::checkSequenceIsValid(TDiagnostics *diagnostics) const
{}

TTypeQualifier TTypeQualifierBuilder::getParameterTypeQualifier(TBasicType parameterBasicType,
                                                                TDiagnostics *diagnostics) const
{}

TTypeQualifier TTypeQualifierBuilder::getVariableTypeQualifier(TDiagnostics *diagnostics) const
{}

}  // namespace sh