swift-reflection-test: Increase reading robustness

- Check return values from `read`
- Make the reflstr section optional, as it can be stripped by
  -strip-reflection-names.
This commit is contained in:
David Farler
2016-03-23 15:41:08 -07:00
parent 0f62e6691c
commit 76b31a9343
2 changed files with 126 additions and 75 deletions

View File

@@ -564,6 +564,8 @@ public:
for (auto Info : ReflectionInfos) {
for (auto &FieldDescriptor : Info.fieldmd) {
auto CandidateMangledName = FieldDescriptor.MangledTypeName.get();
if (!CandidateMangledName)
continue;
if (MangledName.compare(CandidateMangledName) != 0)
continue;
for (auto &Field : FieldDescriptor) {