[PATCH] D24926: Added support of configuration files

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 11:38:05 PDT 2016


ABataev added inline comments.


================
Comment at: include/llvm/Support/CommandLine.h:1793
 
+/// \brief Tokenizes content of configuration file.
+///
----------------
`\brief` tag is not required


================
Comment at: include/llvm/Support/CommandLine.h:1802
+///
+void TokenizeConfigFile(StringRef Source, StringSaver &Saver,
+                        SmallVectorImpl<const char *> &NewArgv,
----------------
s/TokenizeConfigFile/tokenizeConfigFile/g


================
Comment at: include/llvm/Support/CommandLine.h:1818
+
+/// \brief Tries to find configuration file specified by command line arguments.
+///
----------------
No `\brief`


================
Comment at: include/llvm/Support/CommandLine.h:1833
+
+/// \brief Tries to find configuration file specified by the given environment
+/// variable.
----------------
No `\brief`


================
Comment at: include/llvm/Support/CommandLine.h:1844
+
+/// \brief Tries to find default configuration file.
+///
----------------
No `\brief`


================
Comment at: include/llvm/Support/CommandLine.h:1857
+
+/// \brief Report error occurred in config file search.
+///
----------------
No `\brief`


================
Comment at: include/llvm/Support/CommandLine.h:1871
+
+/// \brief Tries to read command line options from configuration file.
+///
----------------
No `\brief`


================
Comment at: lib/Support/CommandLine.cpp:716-717
+        continue; // Ignore backlash followed by '\n'.
+      if (Src[I] == '\r' && I + 1 < E && Src[I + 1] == '\n') {
+        ++I;
+        continue; // Ignore backlash followed by \r\n.
----------------
Is this sequence expected on Linux too?


================
Comment at: lib/Support/CommandLine.cpp:1012
+  if (!llvm::sys::path::has_parent_path(CfgFile)) {
+    if (!StringRef(CfgFile).endswith(".cfg"))
+      CfgFile += ".cfg";
----------------
Use `llvm::sys::path::extension(CfgFile) != ".cfg"` instead


https://reviews.llvm.org/D24926





More information about the llvm-commits mailing list