From 88af6b9217f9ff8b4592f38ac5175de697275f49 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Tue, 16 Nov 2010 01:06:51 +0000 Subject: [PATCH] Object: Get rid of sys::Path, Triple, and cleanup namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119309 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/ObjectFile.h | 9 +++++---- lib/Object/ObjectFile.cpp | 12 +++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index 941046c0c58..ca515814348 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -14,12 +14,13 @@ #ifndef LLVM_OBJECT_OBJECT_FILE_H #define LLVM_OBJECT_OBJECT_FILE_H -#include "llvm/ADT/Triple.h" -#include "llvm/System/Path.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/System/DataTypes.h" namespace llvm { class MemoryBuffer; +class StringRef; namespace object { @@ -155,7 +156,7 @@ public: virtual uint8_t getBytesInAddress() const = 0; virtual StringRef getFileFormatName() const = 0; - virtual Triple::ArchType getArch() const = 0; + virtual /* Triple::ArchType */ unsigned getArch() const = 0; StringRef getFilename() const; @@ -163,7 +164,7 @@ public: /// @param ObjectPath The path to the object file. ObjectPath.isObject must /// return true. /// @brief Create ObjectFile from path. - static ObjectFile *createObjectFile(const sys::Path &ObjectPath); + static ObjectFile *createObjectFile(StringRef ObjectPath); static ObjectFile *createObjectFile(MemoryBuffer *Object); private: diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp index 29aa4b8bdb8..c2ab4a5dbbc 100644 --- a/lib/Object/ObjectFile.cpp +++ b/lib/Object/ObjectFile.cpp @@ -14,9 +14,10 @@ #include "llvm/Object/ObjectFile.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/System/Path.h" -namespace llvm { -namespace object { +using namespace llvm; +using namespace object; ObjectFile::ObjectFile(MemoryBuffer *Object) : MapFile(Object) { @@ -60,9 +61,6 @@ ObjectFile *ObjectFile::createObjectFile(MemoryBuffer *Object) { } } -ObjectFile *ObjectFile::createObjectFile(const sys::Path &ObjectPath) { - return createObjectFile(MemoryBuffer::getFile(ObjectPath.c_str())); +ObjectFile *ObjectFile::createObjectFile(StringRef ObjectPath) { + return createObjectFile(MemoryBuffer::getFile(ObjectPath)); } - -} // end namespace object -} // end namespace llvm -- 2.34.1