Remove localName from NamedType
The Formatter CL introduced definedName to type which is the very thing
that NamedType::localName already did.
Thus localName should be removed.
Bug: 137553653
Test: ./test/run_all_*_test.sh
Change-Id: I61bff460d77d7b880831115be0602a49669fd7be
Merged-In: I61bff460d77d7b880831115be0602a49669fd7be
diff --git a/Scope.cpp b/Scope.cpp
index c8f57b8..aec1da4 100644
--- a/Scope.cpp
+++ b/Scope.cpp
@@ -38,13 +38,13 @@
void Scope::addType(NamedType* type) {
size_t index = mTypes.size();
mTypes.push_back(type);
- mTypeIndexByName[type->localName()] = index;
+ mTypeIndexByName[type->definedName()] = index;
}
status_t Scope::validateUniqueNames() const {
for (const auto* type : mTypes) {
- if (mTypes[mTypeIndexByName.at(type->localName())] != type) {
- std::cerr << "ERROR: A type named '" << type->localName()
+ if (mTypes[mTypeIndexByName.at(type->definedName())] != type) {
+ std::cerr << "ERROR: A type named '" << type->definedName()
<< "' is already declared in the scope at " << type->location() << std::endl;
return UNKNOWN_ERROR;
}
@@ -154,7 +154,7 @@
std::sort(mTypes.begin(), mTypes.end(), less);
for (size_t i = 0; i != mTypes.size(); ++i) {
- mTypeIndexByName.at(mTypes[i]->localName()) = i;
+ mTypeIndexByName.at(mTypes[i]->definedName()) = i;
}
}