anton-afanasyev marked an inline comment as done.
anton-afanasyev added inline comments.


================
Comment at: clang/lib/Parse/ParseAST.cpp:154
   if (HaveLexer) {
+    llvm::TimeTraceScope TimeScope("Frontend", StringRef(""));
     P.Initialize();
----------------
takuto.ikuta wrote:
> anton-afanasyev wrote:
> > takuto.ikuta wrote:
> > > Remove StringRef?
> > I use `StringRef("")` to explicitly cast to one of overloaded 
> > `TimeScope(StringRef, StringRef)` and `TimeScope(StringRef, 
> > fuction_ref(std::string()))`.
> I think function_ref(std::string()) does not have constructor receiving 
> StringRef, so I feel explicit cast is redundant.
> 
The compiler tries to use function_ref<..>(Callable&&, ...) constructor and 
instantiates `function_ref<std::string()>::function_ref<char const (&)[1]>`, so 
one gets error like:
```
error: call to constructor of 'llvm::TimeTraceScope' is ambiguous
    llvm::TimeTraceScope TimeScope("Frontend", "");
                         ^         ~~~~~~~~~~~~~~
.../include/llvm/Support/TimeProfiler.h:54:3: note: candidate constructor
  TimeTraceScope(StringRef Name, StringRef Detail) {
  ^
.../include/llvm/Support/TimeProfiler.h:58:3: note: candidate constructor
  TimeTraceScope(StringRef Name, llvm::function_ref<std::string()> Detail) {
  ^

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58675/new/

https://reviews.llvm.org/D58675



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to