<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2014-05-07 6:11 GMT+04:00 Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank" class="cremed">mail@justinbogner.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":7y2" class="" style="overflow:hidden">+std::string FileInfo::getCoveragePath(StringRef Filename,<br>
+ StringRef MainFilename) {<br>
+ if (Options.NoOutput)<br>
+ // This is probably a bug in gcov, but when -n is specified, paths aren't<br>
+ // mangled at all, and the -l and -p options are ignored. Here, we do the<br>
+ // same.<br>
+ return Filename;<br>
+<br>
+ std::string CoveragePath;<br>
+ if (Options.LongFileNames && !Filename.equals(MainFilename))<br>
+ CoveragePath =<br>
+ mangleCoveragePath(MainFilename, Options.PreservePaths) + "##";<br>
+ CoveragePath +=<br>
+ mangleCoveragePath(Filename, Options.PreservePaths) + ".gcov";<br>
+ return CoveragePath;<br>
+}<br>
+<br>
+std::unique_ptr<raw_ostream><br>
+FileInfo::openCoveragePath(StringRef CoveragePath) {<br>
+ if (Options.NoOutput)<br>
+ return <span class="">make_unique</span><raw_null_ostream>();<br>
+<br>
+ std::string ErrorInfo;<br>
+ auto OS = <span class="">make_unique</span><raw_fd_ostream>(CoveragePath.str().c_str(), ErrorInfo,<br>
+ sys::fs::F_Text);<br>
+ if (!ErrorInfo.empty()) {<br>
+ errs() << ErrorInfo << "\n";<br>
+ return <span class="">make_unique</span><raw_null_ostream>();<br>
+ }<br>
+ return std::move(OS);<br>
+}<br>
+</div></blockquote></div><br>FYI Visual Studio 2013 is not happy with that:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">llvm\lib\IR\GCOV.cpp(518) : error C2668: 'llvm::make_unique' : ambiguous call to overloaded function</div>
<div class="gmail_extra"> llvm\include\llvm/ADT/STLExtras.h(393): could be 'std::unique_ptr<llvm::raw_fd_ostream,std::default_delete<llvm::raw_fd_ostream>> llvm::make_unique<llvm::raw_fd_ostream,const _Elem*,std::string&,llvm::sys::fs::OpenFlags>(const _Elem *&&,std::string &,llvm::sys::fs::OpenFlags &&)'</div>
<div class="gmail_extra"> with</div><div class="gmail_extra"> [</div><div class="gmail_extra"> _Elem=char</div><div class="gmail_extra"> ]</div><div class="gmail_extra"> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\memory(1637): or 'std::unique_ptr<llvm::raw_fd_ostream,std::default_delete<llvm::raw_fd_ostream>> std::make_unique<llvm::raw_fd_ostream,const _Elem*,std::string&,llvm::sys::fs::OpenFlags>(const _Elem *&&,std::string &,llvm::sys::fs::OpenFlags &&)' [found using argument-dependent lookup]</div>
<div class="gmail_extra"> with</div><div class="gmail_extra"> [</div><div class="gmail_extra"> _Elem=char</div><div class="gmail_extra"> ]</div><div class="gmail_extra"> while trying to match the argument list '(const char *, std::string, llvm::sys::fs::OpenFlags)'</div>
<div><br></div></div></div>