[LLVMDebugInfoPDB] - Use cantFail() instead of assert().
commitd60ddc37433b26b71728cbe488111828dca33356
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 22 Oct 2019 08:52:45 +0000 (22 08:52 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 22 Oct 2019 08:52:45 +0000 (22 08:52 +0000)
treed0efc67d236af90b76714730c9c6895c8a838532
parent59b9923cc91f6baeeec9d66a9619e42189841e2b
[LLVMDebugInfoPDB] - Use cantFail() instead of assert().

Currently injected-sources-native.test fails with "Expected<T>
value was in success state.
(Note: Expected<T> values in success mode must still be checked
prior to being destroyed)"
when llvm is compiled with LLVM_ENABLE_ABI_BREAKING_CHECKS in Release.

The problem is that getStringForID returns Expected<StringRef>
and Expected value must always be checked, even if it is in success state.
Checking with assert only helps in Debug and is wrong.

Differential revision: https://reviews.llvm.org/D69251

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375492 91177308-0d34-0410-b5e6-96231b3b80d8
lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp