Skip to content

Commit f5e9042

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 740b8b5 commit f5e9042

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
@@ -294,14 +294,14 @@ if(LLVM_HAS_LOGF128)
294294
set(LLVM_HAS_LOGF128 "${HAS_LOGF128}")
295295
endif()
296296

297-
#Check for icu.
297+
# Check for ICU.
298298
if(LLVM_ENABLE_ICU)
299299
set(LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
300300
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
301301
if (LLVM_ENABLE_ICU STREQUAL FORCE_ON)
302302
find_package(ICU REQUIRED COMPONENTS uc i18n)
303303
if (NOT ICU_FOUND)
304-
message(FATAL_ERROR "Failed to configure icu, but LLVM_ENABLE_ICU is FORCE_ON")
304+
message(FATAL_ERROR "Failed to configure ICU, but LLVM_ENABLE_ICU is FORCE_ON")
305305
endif()
306306
else()
307307
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
@@ -240,7 +240,7 @@
240240
/* Have host's ___chkstk_ms */
241241
#cmakedefine HAVE____CHKSTK_MS ${HAVE____CHKSTK_MS}
242242

243-
/* Define if icu library is available */
243+
/* Define if ICU library is available */
244244
#cmakedefine HAVE_ICU ${HAVE_ICU}
245245

246246
/* 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
@@ -312,7 +312,7 @@ add_llvm_component_library(LLVMSupport
312312
Demangle
313313
)
314314

315-
# Link icu library if it is an external library.
315+
# Link ICU library if it is an external library.
316316
if(ICU_FOUND)
317317
target_link_libraries(LLVMSupport
318318
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)