diff options
| author | Rui Ueyama <ruiu@google.com> | 2015-04-04 02:44:36 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2015-04-04 02:44:36 +0000 |
| commit | 55f5b2b277e7abccefb8d17da02494a8dd34b128 (patch) | |
| tree | 9708a22bc785131db5be7646daa465778df6ae9d /lld/lib/ReaderWriter/YAML | |
| parent | 3d44178733c451f12075b6527580db10ce11c50d (diff) | |
| download | bcm5719-llvm-55f5b2b277e7abccefb8d17da02494a8dd34b128.tar.gz bcm5719-llvm-55f5b2b277e7abccefb8d17da02494a8dd34b128.zip | |
Remove a parameter for file extension from canParse.
canParse took three parameters -- file magic, filename extension and
memory buffer. All but YAMLReader ignored the second parameter.
This patch removes the parameter.
llvm-svn: 234080
Diffstat (limited to 'lld/lib/ReaderWriter/YAML')
| -rw-r--r-- | lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index d33c06bad76..df74e9bcaf0 100644 --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -25,6 +25,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Path.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" #include <memory> @@ -1304,8 +1305,9 @@ class YAMLReader : public Reader { public: YAMLReader(const Registry ®istry) : _registry(registry) {} - bool canParse(file_magic, StringRef ext, const MemoryBuffer &) const override { - return (ext.equals(".objtxt") || ext.equals(".yaml")); + bool canParse(file_magic magic, const MemoryBuffer &mb) const override { + StringRef ext = llvm::sys::path::extension(mb.getBufferIdentifier()); + return ext.equals(".objtxt") || ext.equals(".yaml"); } std::error_code |

