From f12745f7a7e68c05c89ebd515b9b4faedce37dd0 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 10 Jun 2013 15:27:39 +0000 Subject: Pass a StringRef to sys::identifyFileType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183669 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/ObjectBuffer.h | 1 + include/llvm/Support/PathV1.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/llvm/ExecutionEngine/ObjectBuffer.h b/include/llvm/ExecutionEngine/ObjectBuffer.h index 96a48b2..32de404 100644 --- a/include/llvm/ExecutionEngine/ObjectBuffer.h +++ b/include/llvm/ExecutionEngine/ObjectBuffer.h @@ -44,6 +44,7 @@ public: const char *getBufferStart() const { return Buffer->getBufferStart(); } size_t getBufferSize() const { return Buffer->getBufferSize(); } + StringRef getBuffer() const { return Buffer->getBuffer(); } protected: // The memory contained in an ObjectBuffer diff --git a/include/llvm/Support/PathV1.h b/include/llvm/Support/PathV1.h index af46cc1..d4bb58a 100644 --- a/include/llvm/Support/PathV1.h +++ b/include/llvm/Support/PathV1.h @@ -725,9 +725,9 @@ namespace sys { /// This utility function allows any memory block to be examined in order /// to determine its file type. - LLVMFileType identifyFileType(const char *Magic, unsigned Length); + LLVMFileType identifyFileType(StringRef Magic); inline LLVMFileType IdentifyFileType(const char *Magic, unsigned Length) { - return identifyFileType(Magic, Length); + return identifyFileType(StringRef(Magic, Length)); } /// This function can be used to copy the file specified by Src to the -- cgit v1.1