[llvm] r231214 - Revert "[ADT] fail-fast iterators for DenseMap"
Sanjoy Das
sanjoy at playingwithpointers.com
Wed Mar 4 14:43:29 PST 2015
The problem is that lldb explicitly #defines and #undefs NDEBUG before
including clang/llvm headers, and it does so inconsistently. From my
earlier mail:
'''
As an example, ClangASTType.h will include clang headers without
#defining NDEBUG while ClangExternalASTSourceCommon.h will include
clang headers *after* #defining NDEBUG.
'''
So you can end up with a copy of InsertIntoBucketImpl compiled with
NDEBUG set in one TU and without NDEBUG set in another TU. If a call
to InsertIntoBucketImpl in the latter gets linked to the definition of
InsertIntoBucketImplin the former, then you're in trouble. This is
what is happening, as far as I can tell.
Did I understand your question correctly?
-- Sanjoy
On Wed, Mar 4, 2015 at 2:35 PM, Zachary Turner <zturner at google.com> wrote:
> I'm still a little confused about why I was getting the same issue on
> Windows. I can understand if someone uses LLVM as a library and they use,
> for example, a release version of clang/llvm but a debug version of LLDB.
> But I didn't do that. I build LLDB the same way anyone else builds clang or
> any other subproejct. I use CMake with -DCMAKE_BUILD_TYPE=Debug, then run
> ninja, and that's it. So I should have the same value of NDEBUG for both
> projects, and still I was getting the error.
>
> On Wed, Mar 4, 2015 at 2:29 PM Sanjoy Das <sanjoy at playingwithpointers.com>
> wrote:
>>
>> > A separate define seems like the best we can do. The downside is that we
>> > can't turn this on by default in a standard +Asserts build, or we've
>> > just
>> > moved the ABI incompatibility problem to a different define.
>>
>> This may be the most practical solution so far, but I dislike it
>> because it means a default +Asserts build won't get the kind of
>> verification it can and should.
>>
>> -- Sanjoy
More information about the llvm-commits
mailing list