Commit 41897941 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[torque] Remove LookupType(std::string&)

Change-Id: Idaa8776eea68fd264785c06355842daa6bfa30e0
Bug: v8:7793
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585849
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61469}
parent 9b81e4a8
......@@ -79,10 +79,6 @@ const Type* Declarations::LookupType(const Identifier* name) {
return alias->type();
}
const Type* Declarations::LookupType(std::string name) {
return LookupType(QualifiedName(std::move(name)));
}
const Type* Declarations::LookupGlobalType(const std::string& name) {
TypeAlias* declaration = EnsureUnique(
FilterDeclarables<TypeAlias>(LookupGlobalScope(name)), name, "type");
......
......@@ -57,7 +57,6 @@ class Declarations {
static const TypeAlias* LookupTypeAlias(const QualifiedName& name);
static const Type* LookupType(const QualifiedName& name);
static const Type* LookupType(const Identifier* identifier);
static const Type* LookupType(std::string name);
static const Type* LookupGlobalType(const std::string& name);
static Builtin* FindSomeInternalBuiltinWithType(
......
......@@ -762,12 +762,12 @@ VisitResult ImplementationVisitor::Visit(NumberLiteralExpression* expr) {
// TODO(tebbi): Do not silently loose precision; support 64bit literals.
double d = std::stod(expr->number.c_str());
int32_t i = static_cast<int32_t>(d);
const Type* result_type = Declarations::LookupType(CONST_FLOAT64_TYPE_STRING);
const Type* result_type = TypeOracle::GetConstFloat64Type();
if (i == d) {
if ((i >> 30) == (i >> 31)) {
result_type = Declarations::LookupType(CONST_INT31_TYPE_STRING);
result_type = TypeOracle::GetConstInt31Type();
} else {
result_type = Declarations::LookupType(CONST_INT32_TYPE_STRING);
result_type = TypeOracle::GetConstInt32Type();
}
}
return VisitResult{result_type, expr->number};
......
......@@ -184,6 +184,10 @@ class TypeOracle : public ContextualClass<TypeOracle> {
return Get().GetBuiltinType(FLOAT64_TYPE_STRING);
}
static const Type* GetConstFloat64Type() {
return Get().GetBuiltinType(CONST_FLOAT64_TYPE_STRING);
}
static const Type* GetNeverType() {
return Get().GetBuiltinType(NEVER_TYPE_STRING);
}
......@@ -192,6 +196,10 @@ class TypeOracle : public ContextualClass<TypeOracle> {
return Get().GetBuiltinType(CONST_INT31_TYPE_STRING);
}
static const Type* GetConstInt32Type() {
return Get().GetBuiltinType(CONST_INT32_TYPE_STRING);
}
static bool IsImplicitlyConvertableFrom(const Type* to, const Type* from) {
for (Generic* from_constexpr :
Declarations::LookupGeneric(kFromConstexprMacroName)) {
......
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