Etienne Bergeron | de1ec03 | 2016-05-10 15:31:15 +0000 | [diff] [blame] | 1 | //===--- DanglingHandleCheck.cpp - clang-tidy------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "OptionsUtils.h" |
| 11 | |
| 12 | namespace clang { |
| 13 | namespace tidy { |
| 14 | namespace utils { |
| 15 | namespace options { |
| 16 | |
| 17 | static const char StringsDelimiter[] = ";"; |
| 18 | |
| 19 | std::vector<std::string> parseStringList(StringRef Option) { |
| 20 | SmallVector<StringRef, 4> Names; |
| 21 | Option.split(Names, StringsDelimiter); |
| 22 | std::vector<std::string> Result; |
| 23 | for (StringRef &Name : Names) { |
| 24 | Name = Name.trim(); |
| 25 | if (!Name.empty()) |
| 26 | Result.push_back(Name); |
| 27 | } |
| 28 | return Result; |
| 29 | } |
| 30 | |
| 31 | std::string serializeStringList(ArrayRef<std::string> Strings) { |
| 32 | return llvm::join(Strings.begin(), Strings.end(), StringsDelimiter); |
| 33 | } |
| 34 | |
| 35 | } // namespace options |
| 36 | } // namespace utils |
| 37 | } // namespace tidy |
| 38 | } // namespace clang |