Skip to content

Commit 42f7a35

Browse files
committed
omitNeedlessWords: sink helper enum into .cpp file
No functionality change.
1 parent 3fdbd1b commit 42f7a35

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

Diff for: include/swift/Basic/StringExtras.h

-19
Original file line numberDiff line numberDiff line change
@@ -315,25 +315,6 @@ namespace swift {
315315
size_t findWord(StringRef string, StringRef word);
316316
} // end namespace camel_case
317317

318-
/// Describes the role that a particular name has within a
319-
/// signature, which can affect how we omit needless words.
320-
enum class NameRole {
321-
/// The base name of a function or method.
322-
BaseName,
323-
324-
/// The first parameter of a function or method.
325-
FirstParameter,
326-
327-
// Subsequent parameters in a function or method.
328-
SubsequentParameter,
329-
330-
// The name of a property.
331-
Property,
332-
333-
// A partial name; used internally.
334-
Partial,
335-
};
336-
337318
/// Flags used by \c OmissionTypeName to describe the input type.
338319
enum class OmissionTypeFlags {
339320
/// Whether the parameter with this type has a default argument.

Diff for: lib/Basic/StringExtras.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,27 @@ static bool textMatchesPropertyName(StringRef text,
576576
return false;
577577
}
578578

579+
namespace {
580+
/// Describes the role that a particular name has within a
581+
/// signature, which can affect how we omit needless words.
582+
enum class NameRole {
583+
/// The base name of a function or method.
584+
BaseName,
585+
586+
/// The first parameter of a function or method.
587+
FirstParameter,
588+
589+
// Subsequent parameters in a function or method.
590+
SubsequentParameter,
591+
592+
// The name of a property.
593+
Property,
594+
595+
// A partial name; used internally.
596+
Partial,
597+
};
598+
} // end anonymous namespace
599+
579600
static StringRef omitNeedlessWords(StringRef name,
580601
OmissionTypeName typeName,
581602
NameRole role,

0 commit comments

Comments
 (0)