There are two DataExtractors in scope: one from the llvm namespace
and one from the lldb_private namespace. Some Microsoft Visual C++
compilers (I tested with MSVC 14.23 specifically) cannot handle this
situation, and generate ambiguous symbol errors. This change fixes
this compile error.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think the better solution here is to get rid of the using namespace llvm; in the implementation file instead.
That is a good point. I did a quick look at the file DataFileCache.h and none of the files it includes directly use using namespace llvm;.
It looks like across llvm-project we have 54 headers that use using namespace llvm; I thought it was a lot more.
I personally dislike it even in .cpp files using llvm:: or lldb_private:: does not feel like an undue burden. Although the count for .cpp files is 4000+ 😱
It looks like at least some of those are inside functions, which is kind of OK. But what's worse, some of those are not inside functions, which is 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱 😱. using directives in headers completely mangle the symbol lookups in any file which includes them.
Removed "using namespace llvm" from the implementation file
and qualified all associated references with "llvm::".
Thanks for cleaning up the implementation file. LGMT module removing the added lldb_private:: which I believe we no longer need.
lldb/include/lldb/Core/DataFileCache.h | ||
---|---|---|
164 ↗ | (On Diff #412361) | I assume the header was never a problem and you did this to match the signature in the implementation file (which no longer needs the namespace qualifier without the using namespace llvm), unless one of the headers included here (transitively) includes a header that has the "😱 😱 😱" top level using namespace llvm;? |