Commit 55616a24 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

[torque] Minor Torque fixes

This is a partial reland of https://crrev.com/c/v8/v8/+/2199640 . It
allows scoped lookups to not crash during CompileCurrentAst, fixes the
formatting in an error message, and includes an extra line for
convenience when generating macros for bitfields.

Change-Id: I7ed9f7d76b3ce5e2cc0f2580d7ba1953da340ae8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2216301Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#68018}
parent 5a2cb2e1
......@@ -28,7 +28,6 @@ class DebugInfo : public TorqueGeneratedDebugInfo<DebugInfo, Struct> {
public:
NEVER_READ_ONLY_SPACE
DEFINE_TORQUE_GENERATED_DEBUG_INFO_FLAGS()
using Flags = base::Flags<Flag>;
// DebugInfo can be detached from the SharedFunctionInfo iff it is empty.
bool IsEmpty() const;
......
......@@ -95,7 +95,8 @@ std::vector<Declarable*> Scope::Lookup(const QualifiedName& name) {
base::Optional<std::string> TypeConstraint::IsViolated(const Type* type) const {
if (upper_bound && !type->IsSubtypeOf(*upper_bound)) {
return {ToString("expected ", *type, " to be a subtype of ", *upper_bound)};
return {
ToString("expected ", *type, " to be a subtype of ", **upper_bound)};
}
return base::nullopt;
}
......
......@@ -3371,6 +3371,7 @@ void ImplementationVisitor::GenerateBitFields(
<< " = 1 << " << field.offset << ", \\\n";
}
header << " }; \\\n";
header << " using Flags = base::Flags<Flag>; \\\n";
}
header << "\n";
......
......@@ -55,6 +55,7 @@ void CompileCurrentAst(TorqueCompilerOptions options) {
}
TargetArchitecture::Scope target_architecture(options.force_32bit_output);
TypeOracle::Scope type_oracle;
CurrentScope::Scope current_namespace(GlobalContext::GetDefaultNamespace());
// Two-step process of predeclaration + resolution allows to resolve type
// declarations independent of the order they are given.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment