[llvm] r194040 - Revert "llvm-cov: Added command-line option to change dir."

Yuchen Wu yuchenericwu at hotmail.com
Mon Nov 11 15:03:44 PST 2013


Alp,

It's in the review process. I've already asked a colleague of mine to take a look at it, but a second pair of eyes can't hurt.

It was sent out under the subject "[PATCH] Added basic testing support for llvm-cov", as it spawned from splitting up another patch. Probably should've split the email thread too but oh well.

-Yuchen

----------------------------------------
> Date: Mon, 11 Nov 2013 22:52:16 +0000
> From: alp at nuanti.com
> To: yuchenericwu at hotmail.com
> Subject: Re: [llvm] r194040 - Revert "llvm-cov: Added command-line option to change dir."
>
> Thanks Yuchen,
>
> I didn't see your patch, is it in review or did it land already?
>
> Good to hear either way, let me know if I can help :-)
>
>
> On 11/11/2013 21:49, Yuchen Wu wrote:
>> Hi Alp,
>>
>> Thanks for your feedback. For one reason or another I did not see any of your emails until now.
>>
>> I've changed the patch to use the full path when searching for files, so that chdir is not necessary. Should be cleaner now.
>>
>> -Yuchen Wu
>>
>> ----------------------------------------
>>> Date: Tue, 5 Nov 2013 02:12:05 +0000
>>> From: alp at nuanti.com
>>> To: yuchenericwu at hotmail.com; llvm-commits at cs.uiuc.edu
>>> Subject: Re: [llvm] r194040 - Revert "llvm-cov: Added command-line option to change dir."
>>>
>>> Thanks, this fixed the Windows builders.
>>>
>>> I hope you'll find a clean solution that doesn't involve changing the
>>> current working directory.
>>>
>>> Alp.
>>>
>>>
>>> On 05/11/2013 01:56, Yuchen Wu wrote:
>>>> Author: ywu
>>>> Date: Mon Nov 4 19:56:29 2013
>>>> New Revision: 194040
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=194040&view=rev
>>>> Log:
>>>> Revert "llvm-cov: Added command-line option to change dir."
>>>>
>>>> This reverts commit d8acf0078cf363252727acff00f85ae8074f95b3.
>>>>
>>>> Modified:
>>>> llvm/trunk/lib/IR/GCOV.cpp
>>>> llvm/trunk/tools/llvm-cov/llvm-cov.cpp
>>>>
>>>> Modified: llvm/trunk/lib/IR/GCOV.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/GCOV.cpp?rev=194040&r1=194039&r2=194040&view=diff
>>>> ==============================================================================
>>>> --- llvm/trunk/lib/IR/GCOV.cpp (original)
>>>> +++ llvm/trunk/lib/IR/GCOV.cpp Mon Nov 4 19:56:29 2013
>>>> @@ -266,20 +266,18 @@ void FileInfo::print(raw_fd_ostream &OS,
>>>> for (StringMap<LineCounts>::iterator I = LineInfo.begin(), E = LineInfo.end();
>>>> I != E; ++I) {
>>>> StringRef Filename = I->first();
>>>> - OwningPtr<MemoryBuffer> Buff;
>>>> - if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
>>>> - errs() << Filename << ": " << ec.message() << "\n";
>>>> - return;
>>>> - }
>>>> - StringRef AllLines = Buff.take()->getBuffer();
>>>> -
>>>> OS << " -: 0:Source:" << Filename << "\n";
>>>> OS << " -: 0:Graph:" << gcnoFile << "\n";
>>>> OS << " -: 0:Data:" << gcdaFile << "\n";
>>>> OS << " -: 0:Runs:" << RunCount << "\n";
>>>> OS << " -: 0:Programs:" << ProgramCount << "\n";
>>>> -
>>>> LineCounts &L = LineInfo[Filename];
>>>> + OwningPtr<MemoryBuffer> Buff;
>>>> + if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
>>>> + errs() << Filename << ": " << ec.message() << "\n";
>>>> + return;
>>>> + }
>>>> + StringRef AllLines = Buff.take()->getBuffer();
>>>> uint32_t i = 0;
>>>> while (!AllLines.empty()) {
>>>> if (L.find(i) != L.end()) {
>>>>
>>>> Modified: llvm/trunk/tools/llvm-cov/llvm-cov.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/llvm-cov.cpp?rev=194040&r1=194039&r2=194040&view=diff
>>>> ==============================================================================
>>>> --- llvm/trunk/tools/llvm-cov/llvm-cov.cpp (original)
>>>> +++ llvm/trunk/tools/llvm-cov/llvm-cov.cpp Mon Nov 4 19:56:29 2013
>>>> @@ -20,7 +20,6 @@
>>>> #include "llvm/Support/raw_ostream.h"
>>>> #include "llvm/Support/Signals.h"
>>>> #include "llvm/Support/system_error.h"
>>>> -#include <unistd.h>
>>>> using namespace llvm;
>>>>
>>>> static cl::opt<bool>
>>>> @@ -35,9 +34,6 @@ InputGCDA("gcda", cl::desc("<input gcda
>>>> static cl::opt<std::string>
>>>> OutputFile("o", cl::desc("<output llvm-cov file>"), cl::init("-"));
>>>>
>>>> -static cl::opt<std::string>
>>>> -WorkingDir("C", cl::desc("change path of working directory"),
>>>> - cl::init(""));
>>>>
>>>> //===----------------------------------------------------------------------===//
>>>> int main(int argc, char **argv) {
>>>> @@ -48,13 +44,6 @@ int main(int argc, char **argv) {
>>>>
>>>> cl::ParseCommandLineOptions(argc, argv, "llvm coverage tool\n");
>>>>
>>>> - if (!WorkingDir.empty()) {
>>>> - if (chdir(WorkingDir.c_str()) == -1) {
>>>> - errs() << "Cannot change to directory: " << WorkingDir << ".\n";
>>>> - return 1;
>>>> - }
>>>> - }
>>>> -
>>>> std::string ErrorInfo;
>>>> raw_fd_ostream OS(OutputFile.c_str(), ErrorInfo);
>>>> if (!ErrorInfo.empty())
>>>> @@ -88,6 +77,7 @@ int main(int argc, char **argv) {
>>>> }
>>>> }
>>>>
>>>> +
>>>> if (DumpGCOV)
>>>> GF.dump();
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>> --
>>> http://www.nuanti.com
>>> the browser experts
>>>
>
> --
> http://www.nuanti.com
> the browser experts
> 		 	   		  



More information about the llvm-commits mailing list