Lex: Return "" when HeaderMap::lookupFilename fails
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 23 Feb 2016 00:48:16 +0000 (00:48 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 23 Feb 2016 00:48:16 +0000 (00:48 +0000)
commitb5ce11fcc6b4706a56b5169acd23e47746e8b1bd
tree2213720a9885bdadf0d6a2b15492b43e80e0cad6
parentde19ed1eb1aca8493abb5168d46b7f6f3cf9e770
Lex: Return "" when HeaderMap::lookupFilename fails

Change getString() to return Optional<StringRef>, and change
lookupFilename() to return an empty string if either one of the prefix
and suffix can't be found.

This is a more robust follow-up to r261461, but it's still not entirely
satisfactory.  Ideally we'd report that the header map is corrupt;
perhaps something for a follow-up.

llvm-svn: 261596
clang/include/clang/Lex/HeaderMap.h
clang/lib/Lex/HeaderMap.cpp
clang/unittests/Lex/HeaderMapTest.cpp