llvm.org GIT mirror llvm / 6b89d92
use doxygen comments for makeBuffer() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50908 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Kledzik 12 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
9090 return makeLTOModule(buffer.get(), errMsg);
9191 }
9292
93
93 /// makeBuffer - create a MemoryBuffer from a memory range.
94 /// MemoryBuffer requires the byte past end of the buffer to be a zero.
95 /// We might get lucky and already be that way, otherwise make a copy.
96 /// Also if next byte is on a different page, don't assume it is readable.
9497 MemoryBuffer* LTOModule::makeBuffer(const void* mem, size_t length)
9598 {
96 // MemoryBuffer requires the byte past end of the buffer to be a zero.
97 // We might get lucky and already be that way, otherwise make a copy.
98 // Also if next byte is on a different page, don't assume it is readable.
9999 const char* startPtr = (char*)mem;
100100 const char* endPtr = startPtr+length;
101101 if ( (((uintptr_t)endPtr & (sys::Process::GetPageSize()-1)) == 0)