<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Jul 29, 2013, at 1:38 PM, Sebastian Pop <<a href="mailto:spop@codeaurora.org">spop@codeaurora.org</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Jul 26, 2013 at 10:32 AM, Argyrios Kyrtzidis <<a href="mailto:akyrtzi@gmail.com">akyrtzi@gmail.com</a>> wrote:<br><blockquote type="cite">Author: akirtzidis<br>Date: Fri Jul 26 10:32:04 2013<br>New Revision: 187207<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=187207&view=rev">http://llvm.org/viewvc/llvm-project?rev=187207&view=rev</a><br>Log:<br>[frontend] '-frewrite-includes' should not ignore headers included from command-line.<br><br><a href="rdar://14556182">rdar://14556182</a><br><br>Added:<br>   cfe/trunk/test/Frontend/rewrite-includes-header-cmd-line.c<br>Modified:<br>   cfe/trunk/lib/Rewrite/Frontend/InclusionRewriter.cpp<br></blockquote><br>This patch breaks Hexagon's buildbots:<br><br><a href="http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/803">http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/803</a><br><br>       ********************<br>       Failing Tests (1):<br>           Clang :: Driver/qa_override.c<br></div></blockquote><div><br></div><div>I don't see how the patch would affect this test in any way.</div><div>Did you verify by reverting the patch locally and retrying the test ?</div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>To reproduce, in a linux box, configure with:<br><br>$ ../configure --disable-bindings --build=x86_64-linux-gnu<br>--host=x86_64-linux-gnu --target=hexagon-unknown-elf<br>--enable-targets=hexagon --build=hexagon-unknown-elf<br>--host=hexagon-unknown-elf --without-llvmgcc --without-llvmgxx<br>--enable-optimized --enable-assertions<br>$ make && make check-all<br><br>Thanks,<br>Sebastian<br><br><blockquote type="cite"><br>Modified: cfe/trunk/lib/Rewrite/Frontend/InclusionRewriter.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Frontend/InclusionRewriter.cpp?rev=187207&r1=187206&r2=187207&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Frontend/InclusionRewriter.cpp?rev=187207&r1=187206&r2=187207&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Rewrite/Frontend/InclusionRewriter.cpp (original)<br>+++ cfe/trunk/lib/Rewrite/Frontend/InclusionRewriter.cpp Fri Jul 26 10:32:04 2013<br>@@ -40,6 +40,7 @@ class InclusionRewriter : public PPCallb<br>  Preprocessor &PP; ///< Used to find inclusion directives.<br>  SourceManager &SM; ///< Used to read and manage source files.<br>  raw_ostream &OS; ///< The destination stream for rewritten contents.<br>+  const llvm::MemoryBuffer *PredefinesBuffer; ///< The preprocessor predefines.<br>  bool ShowLineMarkers; ///< Show #line markers.<br>  bool UseLineDirective; ///< Use of line directives or line markers.<br>  typedef std::map<unsigned, FileChange> FileChangeMap;<br>@@ -50,6 +51,9 @@ class InclusionRewriter : public PPCallb<br>public:<br>  InclusionRewriter(Preprocessor &PP, raw_ostream &OS, bool ShowLineMarkers);<br>  bool Process(FileID FileId, SrcMgr::CharacteristicKind FileType);<br>+  void setPredefinesBuffer(const llvm::MemoryBuffer *Buf) {<br>+    PredefinesBuffer = Buf;<br>+  }<br>private:<br>  virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,<br>                           SrcMgr::CharacteristicKind FileType,<br>@@ -89,7 +93,7 @@ private:<br>/// Initializes an InclusionRewriter with a \p PP source and \p OS destination.<br>InclusionRewriter::InclusionRewriter(Preprocessor &PP, raw_ostream &OS,<br>                                     bool ShowLineMarkers)<br>-    : PP(PP), SM(PP.getSourceManager()), OS(OS),<br>+    : PP(PP), SM(PP.getSourceManager()), OS(OS), PredefinesBuffer(0),<br>    ShowLineMarkers(ShowLineMarkers),<br>    LastInsertedFileChange(FileChanges.end()) {<br>  // If we're in microsoft mode, use normal #line instead of line markers.<br>@@ -214,6 +218,11 @@ void InclusionRewriter::OutputContentUpT<br>                                          bool EnsureNewline) {<br>  if (WriteTo <= WriteFrom)<br>    return;<br>+  if (&FromFile == PredefinesBuffer) {<br>+    // Ignore the #defines of the predefines buffer.<br>+    WriteFrom = WriteTo;<br>+    return;<br>+  }<br>  OS.write(FromFile.getBufferStart() + WriteFrom, WriteTo - WriteFrom);<br>  // count lines manually, it's faster than getPresumedLoc()<br>  Line += std::count(FromFile.getBufferStart() + WriteFrom,<br>@@ -525,6 +534,8 @@ void clang::RewriteIncludesInInput(Prepr<br>  do {<br>    PP.Lex(Tok);<br>  } while (Tok.isNot(tok::eof));<br>+  Rewrite->setPredefinesBuffer(SM.getBuffer(PP.getPredefinesFileID()));<br>+  Rewrite->Process(PP.getPredefinesFileID(), SrcMgr::C_User);<br>  Rewrite->Process(SM.getMainFileID(), SrcMgr::C_User);<br>  OS->flush();<br>}<br><br>Added: cfe/trunk/test/Frontend/rewrite-includes-header-cmd-line.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/rewrite-includes-header-cmd-line.c?rev=187207&view=auto">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/rewrite-includes-header-cmd-line.c?rev=187207&view=auto</a><br>==============================================================================<br>--- cfe/trunk/test/Frontend/rewrite-includes-header-cmd-line.c (added)<br>+++ cfe/trunk/test/Frontend/rewrite-includes-header-cmd-line.c Fri Jul 26 10:32:04 2013<br>@@ -0,0 +1,7 @@<br>+// RUN: %clang_cc1 -E -frewrite-includes -include rewrite-includes2.h -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s<br>+<br>+// STARTMAIN<br>+<br>+// CHECK-NOT: {{^}}#define<br>+// CHECK: included_line2<br>+// CHECK: {{^}}// STARTMAIN{{$}}<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote><br><br><br>--<span class="Apple-converted-space"> </span><br>Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,<br>hosted by The Linux Foundation</div></blockquote></div><br></body></html>