Skip to content

Commit def255f

Browse files
committed
refactor canonicalization
Always canonicalize on the ID. This is simple, fast, and always correct. We do it always, when the corpus is built. fix #31, fix #36
1 parent 421175a commit def255f

16 files changed

+414
-452
lines changed

Diff for: include/mrdox/meta/Symbols.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ enum class InfoType
4949
IT_typedef
5050
};
5151

52-
/** Return true if s0 is less than s1.
52+
/** Return the result of comparing s0 to s1.
5353
5454
This function returns true if the string
5555
s0 is less than the string s1. The comparison
@@ -58,7 +58,7 @@ enum class InfoType
5858
are compared with lowercase letters coming
5959
before uppercase letters.
6060
*/
61-
bool
61+
std::strong_ordering
6262
compareSymbolNames(
6363
llvm::StringRef symbolName0,
6464
llvm::StringRef symbolName1) noexcept;

Diff for: source/lib/Corpus.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,7 @@ build(
238238
if(GotFailure)
239239
return makeErrorString("one or more errors occurred");
240240

241-
//
242-
// Finish up
243-
//
244-
245-
if(! corpus->canonicalize(R))
246-
return makeError("canonicalization failed");
241+
corpus->canonicalize(R);
247242

248243
return corpus;
249244
}

0 commit comments

Comments
 (0)