This is an archive of the discontinued LLVM Phabricator instance.

Make DIASession work if msdia*.dll isn't registered.
ClosedPublic

Authored by thakis on Apr 1 2016, 12:44 PM.

Details

Reviewers
zturner
rnk
Summary

This fixes various symbolization test failures for me when I build with a hermetic VS2015 without having run the 2015 installer.

Diff Detail

Event Timeline

thakis updated this revision to Diff 52412.Apr 1 2016, 12:44 PM
thakis retitled this revision from to Make DIASession work if msdia*.dll isn't registered..
thakis updated this object.
thakis added a reviewer: rnk.
thakis added a subscriber: llvm-commits.
rnk added a reviewer: zturner.Apr 1 2016, 2:32 PM
rnk added inline comments.
lib/DebugInfo/PDB/DIA/DIASession.cpp
27

LLVM prefers 'static' functions to anonymous namespaces:
http://llvm.org/docs/CodingStandards.html#anonymous-namespaces
*shrug*

thakis added inline comments.Apr 1 2016, 2:34 PM
lib/DebugInfo/PDB/DIA/DIASession.cpp
27

Yes, but there was already an empty unnamed namespace _right here_! It seemed like fate wanted this to be in an unnamed namespace :-)

(will change before landing)

thakis added a comment.Apr 1 2016, 2:36 PM

Zach: Background is that this helps with https://bugs.chromium.org/p/chromium/issues/detail?id=596201 The NoRegCoCreate() technique is from similar code in breakpad.

zturner added inline comments.Apr 1 2016, 2:54 PM
lib/DebugInfo/PDB/DIA/DIASession.cpp
37–47

Why don't we just check _MSC_VER? That looks equivalent to this whole guid comparison logic.

#if ((_MSC_VER/100) == 19)
    msdia_dll = L"msdia140.dll";
#elif ((_MSC_VER/100) == 18)
    msdia_dll = L"msdia120.dll";
thakis updated this revision to Diff 52433.Apr 1 2016, 3:17 PM

address comments

lib/DebugInfo/PDB/DIA/DIASession.cpp
37–47

Sure, I can do that. The current approach works with compilers that don't set _MSC_VER as long as they understand _uuidof, but that's probably not a very important use case.

Done.

zturner accepted this revision.Apr 1 2016, 3:24 PM
zturner edited edge metadata.
This revision is now accepted and ready to land.Apr 1 2016, 3:24 PM
thakis added a comment.Apr 1 2016, 3:27 PM

r265193, thanks!

thakis closed this revision.Apr 12 2016, 8:17 AM