Skip to content

Commit f1d4e8e

Browse files
formatting nits
Remove comment that looks like code (unique_ptr should be easy enough to understand). Co-authored-by: Hubert Tong <[email protected]>
1 parent 290e2bc commit f1d4e8e

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@ if(LLVM_HAS_LOGF128)
272272
set(LLVM_HAS_LOGF128 "${HAS_LOGF128}")
273273
endif()
274274

275-
#Check for icu.
275+
# Check for ICU.
276276
if(LLVM_ENABLE_ICU)
277277
set(LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
278278
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
279279
if (LLVM_ENABLE_ICU STREQUAL FORCE_ON)
280280
find_package(ICU REQUIRED COMPONENTS uc i18n)
281281
if (NOT ICU_FOUND)
282-
message(FATAL_ERROR "Failed to configure icu, but LLVM_ENABLE_ICU is FORCE_ON")
282+
message(FATAL_ERROR "Failed to configure ICU, but LLVM_ENABLE_ICU is FORCE_ON")
283283
endif()
284284
else()
285285
find_package(ICU COMPONENTS uc i18n)

llvm/include/llvm/Config/config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
/* Have host's ___chkstk_ms */
280280
#cmakedefine HAVE____CHKSTK_MS ${HAVE____CHKSTK_MS}
281281

282-
/* Define if icu library is available */
282+
/* Define if ICU library is available */
283283
#cmakedefine HAVE_ICU ${HAVE_ICU}
284284

285285
/* Define if iconv library is available */

llvm/include/llvm/Support/CharSet.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class CharSetConverterImplBase {
4646
/// - std::errc::invalid_argument: The input contains an incomplete
4747
/// multibyte sequence.
4848
///
49+
/// If the destination charset is a stateful character set, the shift state
50+
/// will be set to the initial state.
51+
///
4952
/// In case of an error, the result string contains the successfully converted
5053
/// part of the input string.
5154
///
52-
/// If the destination charset is a stateful character set, the shift state
53-
/// will be set to the initial state.
54-
5555
virtual std::error_code convert(StringRef Source,
5656
SmallVectorImpl<char> &Result) const = 0;
5757
};
@@ -70,16 +70,15 @@ enum class id {
7070

7171
/// Utility class to convert between different character set encodings.
7272
class CharSetConverter {
73-
// details::CharSetConverterImplBase *Converter;
7473
std::unique_ptr<details::CharSetConverterImplBase> Converter;
7574

7675
CharSetConverter(std::unique_ptr<details::CharSetConverterImplBase> Converter)
7776
: Converter(std::move(Converter)) {}
7877

7978
public:
8079
/// Creates a CharSetConverter instance.
81-
/// \param[in] CSFrom name of the source character encoding
82-
/// \param[in] CSTo name of the target character encoding
80+
/// \param[in] CSFrom the source character encoding
81+
/// \param[in] CSTo the target character encoding
8382
/// \return a CharSetConverter instance
8483
static CharSetConverter create(text_encoding::id CSFrom,
8584
text_encoding::id CSTo);
@@ -95,9 +94,8 @@ class CharSetConverter {
9594
CharSetConverter(const CharSetConverter &) = delete;
9695
CharSetConverter &operator=(const CharSetConverter &) = delete;
9796

98-
CharSetConverter(CharSetConverter &&Other) {
99-
Converter = std::move(Other.Converter);
100-
}
97+
CharSetConverter(CharSetConverter &&Other)
98+
: Converter(std::move(Other.Converter)) {}
10199

102100
CharSetConverter &operator=(CharSetConverter &&Other) {
103101
if (this != &Other)

llvm/lib/Support/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ add_llvm_component_library(LLVMSupport
311311
Demangle
312312
)
313313

314-
# Link icu library if it is an external library.
314+
# Link ICU library if it is an external library.
315315
if(ICU_FOUND)
316316
target_link_libraries(LLVMSupport
317317
PRIVATE

llvm/lib/Support/CharSet.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
///
99
/// \file
1010
/// This file provides utility classes to convert between different character
11-
/// set encoding.
11+
/// set encodings.
1212
///
1313
//===----------------------------------------------------------------------===//
1414

@@ -80,7 +80,7 @@ enum ConversionType {
8080
IBM1047ToUTF,
8181
};
8282

83-
// Support conversion between EBCDIC 1047 and UTF8. This class uses
83+
// Support conversion between EBCDIC 1047 and UTF-8. This class uses
8484
// built-in translation tables that allow for translation between the
8585
// aforementioned character sets. The use of tables for conversion is only
8686
// possible because EBCDIC 1047 is a single-byte, stateless encoding; other
@@ -166,9 +166,8 @@ CharSetConverterICU::convert(StringRef Source,
166166
Capacity < std::numeric_limits<size_t>::max()) {
167167
HandleOverflow(Capacity, Output, OutputLength, Result);
168168
continue;
169-
} else
170-
// Some other error occured.
171-
return std::error_code(EILSEQ, std::generic_category());
169+
// Some other error occured.
170+
return std::error_code(EILSEQ, std::generic_category());
172171
}
173172
break;
174173
} while (true);

0 commit comments

Comments
 (0)