[llvm-commits] [llvm] r119309 - in /llvm/trunk: include/llvm/Object/ObjectFile.h lib/Object/ObjectFile.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Mon Nov 15 17:06:51 PST 2010
Author: mspencer
Date: Mon Nov 15 19:06:51 2010
New Revision: 119309
URL: http://llvm.org/viewvc/llvm-project?rev=119309&view=rev
Log:
Object: Get rid of sys::Path, Triple, and cleanup namespace.
Modified:
llvm/trunk/include/llvm/Object/ObjectFile.h
llvm/trunk/lib/Object/ObjectFile.cpp
Modified: llvm/trunk/include/llvm/Object/ObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ObjectFile.h?rev=119309&r1=119308&r2=119309&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ObjectFile.h Mon Nov 15 19:06:51 2010
@@ -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 @@
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 @@
/// @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:
Modified: llvm/trunk/lib/Object/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ObjectFile.cpp?rev=119309&r1=119308&r2=119309&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/ObjectFile.cpp Mon Nov 15 19:06:51 2010
@@ -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(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
More information about the llvm-commits
mailing list