skia2/src/sksl/ir/SkSLIRNode.h

41 lines
848 B
C
Raw Normal View History

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SKSL_IRNODE
#define SKSL_IRNODE
#include "src/sksl/SkSLLexer.h"
#include "src/sksl/SkSLString.h"
namespace SkSL {
/**
* Represents a node in the intermediate representation (IR) tree. The IR is a fully-resolved
* version of the program (all types determined, everything validated), ready for code generation.
*/
struct IRNode {
Revert "Enable deprecated-copy-dtor warning." This reverts commit e990fcc4b0c7d2d7b7e5350970da538a8c7a6c20. Reason for revert: Build-Win-Clang-x86_64-Release-Shared Original change's description: > Enable deprecated-copy-dtor warning. > > In C++11 a user declared destructor still requires the compiler to > implicitly default the copy constructor and copy assignment operator, > but this is deprecated. Note that a user declared destructor suppresses > the move constructor and move assignment operator; a user declared > destructor exists if any '~Foo' method declaration appears inside > 'class Foo' (even if defaulted); if the copy and move operations are the > same then copy operations that take 'const Foo&' will do fine double > duty as move operations. > > Clang seems to have an issue with this warning, in that it does not > appear to distinguish between compiler defaulted and user defaulted > destructors. As a result, it does not always warn when it should. > There may yet be places in the code where a move operation is desired > but may be suppressed because the implicitly defaulted moves are not > declared because a destructor has been declared. > > This wraps dawn and shaderc configs in 'third_party' so that their > headers will be included through '-isystem' in order to avoid the > warnings generated by including their headers. > > Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406 > Reviewed-by: Mike Klein <mtklein@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Ben Wagner <bungeman@google.com> TBR=mtklein@google.com,bsalomon@google.com,bungeman@google.com Change-Id: Icd6a2487637d21fcf7c4c7ab7cba7a8adfda5afd No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280836 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-31 22:31:46 +00:00
IRNode(int offset)
: fOffset(offset) {}
virtual ~IRNode() {}
virtual int nodeCount() const {
SkASSERT(false);
return 1;
}
virtual String description() const = 0;
// character offset of this element within the program being compiled, for error reporting
// purposes
int fOffset;
};
} // namespace
#endif