From kde-commits Sun Jul 08 15:28:36 2012 From: =?utf-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sun, 08 Jul 2012 15:28:36 +0000 To: kde-commits Subject: icecream/client Message-Id: <20120708152836.C63D3AC7A9 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=134176155417370 SVN commit 1304635 by lunakl: hack for clang that will be in opensuse 12.2 M +13 -2 cpp.cpp --- trunk/icecream/client/cpp.cpp #1304634:1304635 @@ -116,7 +116,7 @@ int argc = flags.size(); argc++; // the program argc += 2; // -E file.i - argc += 1; // -Wp,-rewrite-includes + argc += 2; // -Wp,-rewrite-includes -CC argv = new char*[argc + 1]; argv[0] = strdup( find_compiler( job ).c_str() ); int i = 1; @@ -126,8 +126,19 @@ } argv[i++] = strdup( "-E" ); argv[i++] = strdup( job.inputFile().c_str() ); - if ( compiler_only_rewrite_includes( job )) + if ( compiler_only_rewrite_includes( job )) { argv[i++] = strdup( "-Wp,-rewrite-includes" ); + // The -CC option actually does nothing. The resulting files from -rewrite-includes + // is rather large, because it in practice is a merge of all the included files, + // including the comments, so at one point in time the patch implementing + // -rewrite-includes had options to strip the comments that would never be visible + // in clang's error messages. That reduced the network traffic, but I don't find + // the additional CPU power needed to parse the comments worth it, so + // -rewrite-includes now again ignores -CC. However that version of the patch + // has already made it into openSUSE 12.2, so use -CC, in case the clang + // used is that one, because it otherwise would strip the comments. + argv[i++] = strdup( "-CC" ); + } argv[i++] = 0; }