diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-04-25 10:43:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-25 10:43:29 -0400 |
| commit | 7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 (patch) | |
| tree | 9c71955dbc956b0058b19818ca127c8132cda512 /source/compiler-core | |
| parent | 284cee1f246c072f190c87c8fb60c1d2181e458f (diff) | |
Dictionary using lowerCamel (#2835)
* #include an absolute path didn't work - because paths were taken to always be relative.
* WIP lowerCamel Dictionary.
* WIP more lowerCamel fixes for Dictionary.
* Add/Remove/Clear
* GetValue/Contains
* Fix tabs in dictionary.
Count -> getCount
* Fix fields with caps.
* Key -> key
Value -> value
Use m_ for members where appropriate.
Use lowerCamel in linked list.
* Some small fixes/improvements to Dictionary.
* Kick CI.
Diffstat (limited to 'source/compiler-core')
| -rw-r--r-- | source/compiler-core/slang-artifact-associated-impl.cpp | 4 | ||||
| -rw-r--r-- | source/compiler-core/slang-artifact-container-util.cpp | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-artifact-desc-util.cpp | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-artifact-util.cpp | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-diagnostic-sink.cpp | 18 | ||||
| -rw-r--r-- | source/compiler-core/slang-doc-extractor.cpp | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-json-rpc-connection.cpp | 6 | ||||
| -rw-r--r-- | source/compiler-core/slang-json-value.cpp | 4 | ||||
| -rw-r--r-- | source/compiler-core/slang-name.cpp | 6 | ||||
| -rw-r--r-- | source/compiler-core/slang-slice-allocator.cpp | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-source-loc.cpp | 6 |
11 files changed, 27 insertions, 27 deletions
diff --git a/source/compiler-core/slang-artifact-associated-impl.cpp b/source/compiler-core/slang-artifact-associated-impl.cpp index 770c2601f..f6f64e294 100644 --- a/source/compiler-core/slang-artifact-associated-impl.cpp +++ b/source/compiler-core/slang-artifact-associated-impl.cpp @@ -76,7 +76,7 @@ void* ArtifactDiagnostics::castAs(const Guid& guid) void ArtifactDiagnostics::reset() { m_diagnostics.clear(); - m_raw.Clear(); + m_raw.clear(); m_result = SLANG_OK; m_allocator.deallocateAll(); @@ -95,7 +95,7 @@ void ArtifactDiagnostics::add(const Diagnostic& inDiagnostic) void ArtifactDiagnostics::setRaw(const CharSlice& slice) { - m_raw.Clear(); + m_raw.clear(); m_raw << asStringSlice(slice); } diff --git a/source/compiler-core/slang-artifact-container-util.cpp b/source/compiler-core/slang-artifact-container-util.cpp index 94ea792c2..1c9bb5a69 100644 --- a/source/compiler-core/slang-artifact-container-util.cpp +++ b/source/compiler-core/slang-artifact-container-util.cpp @@ -411,7 +411,7 @@ SlangResult FileSystemContents::find(ISlangFileSystemExt* fileSystem, const Unow if (entry.isDirectory()) { // Clear the current path - currentPath.Clear(); + currentPath.clear(); appendPath(i, currentPath); diff --git a/source/compiler-core/slang-artifact-desc-util.cpp b/source/compiler-core/slang-artifact-desc-util.cpp index e10ceee07..140ac780d 100644 --- a/source/compiler-core/slang-artifact-desc-util.cpp +++ b/source/compiler-core/slang-artifact-desc-util.cpp @@ -876,7 +876,7 @@ SlangResult ArtifactDescUtil::appendDefaultExtension(const ArtifactDesc& desc, S /* static */SlangResult ArtifactDescUtil::calcPathForDesc(const ArtifactDesc& desc, const UnownedStringSlice& basePath, StringBuilder& outPath) { - outPath.Clear(); + outPath.clear(); // Append the directory Index pos = Path::findLastSeparatorIndex(basePath); diff --git a/source/compiler-core/slang-artifact-util.cpp b/source/compiler-core/slang-artifact-util.cpp index 7420f6843..e03f02e1e 100644 --- a/source/compiler-core/slang-artifact-util.cpp +++ b/source/compiler-core/slang-artifact-util.cpp @@ -165,7 +165,7 @@ static SlangResult _calcInferred(IArtifact* artifact, const UnownedStringSlice& ext = toSlice("unknown"); } - outPath.Clear(); + outPath.clear(); outPath.append(basePath); if (ext.getLength()) { diff --git a/source/compiler-core/slang-diagnostic-sink.cpp b/source/compiler-core/slang-diagnostic-sink.cpp index fa638316c..49aed3000 100644 --- a/source/compiler-core/slang-diagnostic-sink.cpp +++ b/source/compiler-core/slang-diagnostic-sink.cpp @@ -295,7 +295,7 @@ static void _sourceLocationNoteDiagnostic(DiagnosticSink* sink, SourceView* sour // Now make all spaces const Index length = caretLine.getLength(); - caretLine.Clear(); + caretLine.clear(); caretLine.appendRepeatedChar(' ', length); Index caretIndex = caretLine.getLength(); @@ -506,7 +506,7 @@ void DiagnosticSink::reset() m_errorCount = 0; m_internalErrorLocsNoted = 0; - outputBuffer.Clear(); + outputBuffer.clear(); } @@ -584,7 +584,7 @@ Severity DiagnosticSink::getEffectiveMessageSeverity(DiagnosticInfo const& info) { Severity effectiveSeverity = info.severity; - Severity* pSeverityOverride = m_severityOverrides.TryGetValue(info.id); + Severity* pSeverityOverride = m_severityOverrides.tryGetValue(info.id); // See if there is an override if (pSeverityOverride) @@ -676,7 +676,7 @@ void DiagnosticSink::overrideDiagnosticSeverity(int diagnosticId, Severity overr // If the override is the same as the default, we can just remove the override if (info->severity == overrideSeverity) { - m_severityOverrides.Remove(diagnosticId); + m_severityOverrides.remove(diagnosticId); return; } } @@ -689,14 +689,14 @@ void DiagnosticSink::overrideDiagnosticSeverity(int diagnosticId, Severity overr Index DiagnosticsLookup::_findDiagnosticIndexByExactName(const UnownedStringSlice& slice) const { - const Index* indexPtr = m_nameMap.TryGetValue(slice); + const Index* indexPtr = m_nameMap.tryGetValue(slice); return indexPtr ? *indexPtr : -1; } void DiagnosticsLookup::_addName(const char* name, Index diagnosticIndex) { UnownedStringSlice nameSlice(name); - m_nameMap.Add(nameSlice, diagnosticIndex); + m_nameMap.add(nameSlice, diagnosticIndex); } void DiagnosticsLookup::addAlias(const char* name, const char* diagnosticName) @@ -711,13 +711,13 @@ void DiagnosticsLookup::addAlias(const char* name, const char* diagnosticName) const DiagnosticInfo* DiagnosticsLookup::getDiagnosticById(Int id) const { - const auto indexPtr = m_idMap.TryGetValue(id); + const auto indexPtr = m_idMap.tryGetValue(id); return indexPtr ? m_diagnostics[*indexPtr] : nullptr; } const DiagnosticInfo* DiagnosticsLookup::findDiagnosticByExactName(const UnownedStringSlice& slice) const { - const Index* indexPtr = m_nameMap.TryGetValue(slice); + const Index* indexPtr = m_nameMap.tryGetValue(slice); return indexPtr ? m_diagnostics[*indexPtr] : nullptr; } @@ -746,7 +746,7 @@ Index DiagnosticsLookup::add(const DiagnosticInfo* info) m_diagnostics.add(info); _addName(info->name, diagnosticIndex); - m_idMap.AddIfNotExists(info->id, diagnosticIndex); + m_idMap.addIfNotExists(info->id, diagnosticIndex); return diagnosticIndex; } diff --git a/source/compiler-core/slang-doc-extractor.cpp b/source/compiler-core/slang-doc-extractor.cpp index 9885e29e1..c2d36ee89 100644 --- a/source/compiler-core/slang-doc-extractor.cpp +++ b/source/compiler-core/slang-doc-extractor.cpp @@ -233,7 +233,7 @@ SlangResult DocMarkupExtractor::_extractMarkup(const FindInfo& info, const Found for (Index i = 0; i < linesCount; ++i) { UnownedStringSlice line = lines[i]; - unindentedLine.Clear(); + unindentedLine.clear(); if (i == 0) { diff --git a/source/compiler-core/slang-json-rpc-connection.cpp b/source/compiler-core/slang-json-rpc-connection.cpp index 6d687d8ca..c4413d306 100644 --- a/source/compiler-core/slang-json-rpc-connection.cpp +++ b/source/compiler-core/slang-json-rpc-connection.cpp @@ -156,7 +156,7 @@ SlangResult JSONRPCConnection::toNativeArgsOrSendError(const JSONValue& srcArgs, SlangResult JSONRPCConnection::toNativeOrSendError(const JSONValue& value, const RttiInfo* info, void* dst, const JSONValue& id) { - m_diagnosticSink.outputBuffer.Clear(); + m_diagnosticSink.outputBuffer.clear(); JSONToNativeConverter converter(&m_container, &m_typeMap, &m_diagnosticSink); @@ -271,7 +271,7 @@ SlangResult JSONRPCConnection::getMessage(const RttiInfo* rttiInfo, void* out) return SLANG_FAIL; } - m_diagnosticSink.outputBuffer.Clear(); + m_diagnosticSink.outputBuffer.clear(); JSONToNativeConverter converter(&m_container, &m_typeMap, &m_diagnosticSink); // Get the RPC response @@ -305,7 +305,7 @@ SlangResult JSONRPCConnection::getRPC(const RttiInfo* rttiInfo, void* out) return SLANG_FAIL; } - m_diagnosticSink.outputBuffer.Clear(); + m_diagnosticSink.outputBuffer.clear(); JSONToNativeConverter converter(&m_container, &m_typeMap, &m_diagnosticSink); // Convert the result in the response diff --git a/source/compiler-core/slang-json-value.cpp b/source/compiler-core/slang-json-value.cpp index 9edb81b67..7a2375f2e 100644 --- a/source/compiler-core/slang-json-value.cpp +++ b/source/compiler-core/slang-json-value.cpp @@ -600,7 +600,7 @@ UnownedStringSlice JSONContainer::getTransientString(const JSONValue& in) if (handler->isUnescapingNeeeded(unquoted)) { - m_buf.Clear(); + m_buf.clear(); handler->appendUnescaped(unquoted, m_buf); return m_buf.getUnownedSlice(); } @@ -1425,7 +1425,7 @@ void JSONBuilder::endArray(SourceLoc loc) void JSONBuilder::addQuotedKey(const UnownedStringSlice& key, SourceLoc loc) { // We need to decode - m_work.Clear(); + m_work.clear(); StringEscapeHandler* handler = StringEscapeUtil::getHandler(StringEscapeUtil::Style::JSON); StringEscapeUtil::appendUnquoted(handler, key, m_work); addUnquotedKey(m_work.getUnownedSlice(), loc); diff --git a/source/compiler-core/slang-name.cpp b/source/compiler-core/slang-name.cpp index b6035982b..cc2033339 100644 --- a/source/compiler-core/slang-name.cpp +++ b/source/compiler-core/slang-name.cpp @@ -22,19 +22,19 @@ const char* getCstr(Name* name) Name* NamePool::getName(String const& text) { RefPtr<Name> name; - if (rootPool->names.TryGetValue(text, name)) + if (rootPool->names.tryGetValue(text, name)) return name; name = new Name(); name->text = text; - rootPool->names.Add(text, name); + rootPool->names.add(text, name); return name; } Name* NamePool::tryGetName(String const& text) { RefPtr<Name> name; - if (rootPool->names.TryGetValue(text, name)) + if (rootPool->names.tryGetValue(text, name)) return name; return nullptr; } diff --git a/source/compiler-core/slang-slice-allocator.cpp b/source/compiler-core/slang-slice-allocator.cpp index 738bdf303..49fd6a571 100644 --- a/source/compiler-core/slang-slice-allocator.cpp +++ b/source/compiler-core/slang-slice-allocator.cpp @@ -75,7 +75,7 @@ namespace Slang { const auto size = blob->getBufferSize(); auto chars = (const char*)blob->getBufferPointer(); - storage.Clear(); + storage.clear(); storage.append(UnownedStringSlice(chars, size)); return TerminatedCharSlice(storage.getBuffer(), Count(size)); diff --git a/source/compiler-core/slang-source-loc.cpp b/source/compiler-core/slang-source-loc.cpp index 3d992ee8d..8710cf91f 100644 --- a/source/compiler-core/slang-source-loc.cpp +++ b/source/compiler-core/slang-source-loc.cpp @@ -628,7 +628,7 @@ void SourceManager::_resetSource() m_sourceViews.clear(); m_sourceFiles.clear(); - m_sourceFileMap.Clear(); + m_sourceFileMap.clear(); } @@ -816,7 +816,7 @@ SourceFile* SourceManager::findSourceFileByPath(const String& name) const SourceFile* SourceManager::findSourceFile(const String& uniqueIdentity) const { - SourceFile*const* filePtr = m_sourceFileMap.TryGetValue(uniqueIdentity); + SourceFile*const* filePtr = m_sourceFileMap.tryGetValue(uniqueIdentity); return (filePtr) ? *filePtr : nullptr; } @@ -867,7 +867,7 @@ SourceFile* SourceManager::findSourceFileByContent(const char* text) const void SourceManager::addSourceFile(const String& uniqueIdentity, SourceFile* sourceFile) { SLANG_ASSERT(!findSourceFileRecursively(uniqueIdentity)); - m_sourceFileMap.Add(uniqueIdentity, sourceFile); + m_sourceFileMap.add(uniqueIdentity, sourceFile); } HumaneSourceLoc SourceManager::getHumaneLoc(SourceLoc loc, SourceLocType type) |
