mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Add two new functions to the C API:
LLVMCreateMemoryBufferWithMemoryRange - exposes MemoryBuffer::getMemBuffer LLVMCreateMemoryBufferWithMemoryRangeCopy - exposes MemoryBuffer::getMemBufferCopy Patch by Moritz Maxeiner! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175199 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7b672ed380
commit
31cfc70705
@ -2548,6 +2548,13 @@ LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
|
||||
char **OutMessage);
|
||||
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
|
||||
char **OutMessage);
|
||||
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData,
|
||||
size_t InputDataLength,
|
||||
const char *BufferName,
|
||||
bool RequiresNullTerminator);
|
||||
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData,
|
||||
size_t InputDataLength,
|
||||
const char *BufferName);
|
||||
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
|
||||
|
||||
/**
|
||||
|
@ -2369,6 +2369,29 @@ LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
|
||||
return 1;
|
||||
}
|
||||
|
||||
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(
|
||||
const char *InputData,
|
||||
size_t InputDataLength,
|
||||
const char *BufferName,
|
||||
bool RequiresNullTerminator) {
|
||||
|
||||
return wrap(MemoryBuffer::getMemBuffer(
|
||||
StringRef(InputData, InputDataLength),
|
||||
StringRef(BufferName),
|
||||
RequiresNullTerminator));
|
||||
}
|
||||
|
||||
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(
|
||||
const char *InputData,
|
||||
size_t InputDataLength,
|
||||
const char *BufferName) {
|
||||
|
||||
return wrap(MemoryBuffer::getMemBufferCopy(
|
||||
StringRef(InputData, InputDataLength),
|
||||
StringRef(BufferName)));
|
||||
}
|
||||
|
||||
|
||||
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf) {
|
||||
delete unwrap(MemBuf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user