[clang-tools-extra] r246856 - [clang-tidy] Fix llvm-include-order check on Windows.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 4 08:46:51 PDT 2015


Author: alexfh
Date: Fri Sep  4 10:46:51 2015
New Revision: 246856

URL: http://llvm.org/viewvc/llvm-project?rev=246856&view=rev
Log:
[clang-tidy] Fix llvm-include-order check on Windows.

IncludeDirectives struct used a StringRef that pointed to a stack variable
(SmallString<128> FilenameBuffer from PPDirectives.cpp:1513).

http://reviews.llvm.org/D12632

Patch by Marek Kurdej!

Modified:
    clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp

Modified: clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.cpp?rev=246856&r1=246855&r2=246856&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.cpp Fri Sep  4 10:46:51 2015
@@ -33,7 +33,7 @@ private:
   struct IncludeDirective {
     SourceLocation Loc;    ///< '#' location in the include directive
     CharSourceRange Range; ///< SourceRange for the file name
-    StringRef Filename;    ///< Filename as a string
+    std::string Filename;  ///< Filename as a string
     bool IsAngled;         ///< true if this was an include with angle brackets
     bool IsMainModule;     ///< true if this was the first include in a file
   };

Modified: clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp?rev=246856&r1=246855&r2=246856&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp Fri Sep  4 10:46:51 2015
@@ -1,7 +1,6 @@
 // RUN: %python %S/check_clang_tidy.py %s llvm-include-order %t -- -isystem %S/Inputs/Headers
 
 // FIXME: Investigating.
-// XFAIL: win32
 
 // CHECK-MESSAGES: [[@LINE+2]]:1: warning: #includes are not sorted properly
 #include "j.h"




More information about the cfe-commits mailing list