[PATCH] D24933: Enable configuration files in clang
    Hal Finkel via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Thu Oct 26 19:18:40 PDT 2017
    
    
  
hfinkel added inline comments.
================
Comment at: lib/Driver/Driver.cpp:706
+
+  // Determine architecture part of the file name, if it presents.
+  size_t ArchPrefixLen = 0;
----------------
if it presents. -> if it is present.
================
Comment at: lib/Driver/Driver.cpp:739
+      // like: i386-clang.cfg -> x86_64-clang.cfg.
+      if (ArchPrefixLen < CfgFileName.size())
+        FixedConfigFile += CfgFileName.substr(ArchPrefixLen);
----------------
I don't see how this length check makes sense in all cases. If CfgFileName came from a --config command-line options, whether or not it is longer or shoter than ArchPrefixLen seems irrelevant. Do you need to do some prefix check here?
https://reviews.llvm.org/D24933
    
    
More information about the cfe-commits
mailing list