mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Use static instead of anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199419 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6846082281
commit
a560d155d9
@ -23,16 +23,13 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace object;
|
using namespace object;
|
||||||
|
|
||||||
namespace {
|
|
||||||
using support::ulittle8_t;
|
using support::ulittle8_t;
|
||||||
using support::ulittle16_t;
|
using support::ulittle16_t;
|
||||||
using support::ulittle32_t;
|
using support::ulittle32_t;
|
||||||
using support::little16_t;
|
using support::little16_t;
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
// Returns false if size is greater than the buffer size. And sets ec.
|
// Returns false if size is greater than the buffer size. And sets ec.
|
||||||
bool checkSize(const MemoryBuffer *M, error_code &EC, uint64_t Size) {
|
static bool checkSize(const MemoryBuffer *M, error_code &EC, uint64_t Size) {
|
||||||
if (M->getBufferSize() < Size) {
|
if (M->getBufferSize() < Size) {
|
||||||
EC = object_error::unexpected_eof;
|
EC = object_error::unexpected_eof;
|
||||||
return false;
|
return false;
|
||||||
@ -43,8 +40,8 @@ bool checkSize(const MemoryBuffer *M, error_code &EC, uint64_t Size) {
|
|||||||
// Sets Obj unless any bytes in [addr, addr + size) fall outsize of m.
|
// Sets Obj unless any bytes in [addr, addr + size) fall outsize of m.
|
||||||
// Returns unexpected_eof if error.
|
// Returns unexpected_eof if error.
|
||||||
template<typename T>
|
template<typename T>
|
||||||
error_code getObject(const T *&Obj, const MemoryBuffer *M, const uint8_t *Ptr,
|
static error_code getObject(const T *&Obj, const MemoryBuffer *M,
|
||||||
const size_t Size = sizeof(T)) {
|
const uint8_t *Ptr, const size_t Size = sizeof(T)) {
|
||||||
uintptr_t Addr = uintptr_t(Ptr);
|
uintptr_t Addr = uintptr_t(Ptr);
|
||||||
if (Addr + Size < Addr ||
|
if (Addr + Size < Addr ||
|
||||||
Addr + Size < Size ||
|
Addr + Size < Size ||
|
||||||
@ -54,7 +51,6 @@ error_code getObject(const T *&Obj, const MemoryBuffer *M, const uint8_t *Ptr,
|
|||||||
Obj = reinterpret_cast<const T *>(Addr);
|
Obj = reinterpret_cast<const T *>(Addr);
|
||||||
return object_error::success;
|
return object_error::success;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const coff_symbol *COFFObjectFile::toSymb(DataRefImpl Ref) const {
|
const coff_symbol *COFFObjectFile::toSymb(DataRefImpl Ref) const {
|
||||||
const coff_symbol *Addr = reinterpret_cast<const coff_symbol*>(Ref.p);
|
const coff_symbol *Addr = reinterpret_cast<const coff_symbol*>(Ref.p);
|
||||||
@ -1003,4 +999,4 @@ ObjectFile *ObjectFile::createCOFFObjectFile(MemoryBuffer *Object) {
|
|||||||
error_code EC;
|
error_code EC;
|
||||||
return new COFFObjectFile(Object, EC);
|
return new COFFObjectFile(Object, EC);
|
||||||
}
|
}
|
||||||
} // end namespace llvm
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user