File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 316158df8e423f6c123cf2d3349e27c2794b147b
2
+ refs/heads/master: 3bbd741c2e0e9c17bb1a6406be37e6991b6d14cd
Original file line number Diff line number Diff line change 18
18
using namespace llvm ;
19
19
using namespace object ;
20
20
21
- LLVMObjectFileRef LLVMCreateObjectFile (const char *ObjectPath) {
22
- StringRef SR (ObjectPath);
23
- return wrap (ObjectFile::createObjectFile (SR));
21
+ LLVMObjectFileRef LLVMCreateObjectFile (LLVMMemoryBufferRef MemBuf) {
22
+ return wrap (ObjectFile::createObjectFile (unwrap (MemBuf)));
24
23
}
25
24
26
25
void LLVMDisposeObjectFile (LLVMObjectFileRef ObjectFile) {
@@ -36,9 +35,14 @@ void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI) {
36
35
delete unwrap (SI);
37
36
}
38
37
38
+ bool LLVMIsSectionIteratorAtEnd (LLVMObjectFileRef ObjectFile,
39
+ LLVMSectionIteratorRef SI) {
40
+ return *unwrap (SI) == unwrap (ObjectFile)->end_sections ();
41
+ }
42
+
39
43
void LLVMMoveToNextSection (LLVMSectionIteratorRef SI) {
40
- ObjectFile::section_iterator UnwrappedSI = * unwrap (SI);
41
- ++UnwrappedSI ;
44
+ // We can't use unwrap() here because the argument to ++ must be an lvalue.
45
+ ++* reinterpret_cast <ObjectFile::section_iterator*>(SI) ;
42
46
}
43
47
44
48
const char *LLVMGetSectionName (LLVMSectionIteratorRef SI) {
Original file line number Diff line number Diff line change @@ -33,11 +33,13 @@ typedef struct LLVMOpaqueObjectFile *LLVMObjectFileRef;
33
33
34
34
typedef struct LLVMOpaqueSectionIterator *LLVMSectionIteratorRef;
35
35
36
- LLVMObjectFileRef LLVMCreateObjectFile (const char *ObjectPath );
36
+ LLVMObjectFileRef LLVMCreateObjectFile (LLVMMemoryBufferRef MemBuf );
37
37
void LLVMDisposeObjectFile (LLVMObjectFileRef ObjectFile);
38
38
39
39
LLVMSectionIteratorRef LLVMGetSections (LLVMObjectFileRef ObjectFile);
40
40
void LLVMDisposeSectionIterator (LLVMSectionIteratorRef SI);
41
+ bool LLVMIsSectionIteratorAtEnd (LLVMObjectFileRef ObjectFile,
42
+ LLVMSectionIteratorRef SI);
41
43
void LLVMMoveToNextSection (LLVMSectionIteratorRef SI);
42
44
const char *LLVMGetSectionName (LLVMSectionIteratorRef SI);
43
45
uint64_t LLVMGetSectionSize (LLVMSectionIteratorRef SI);
You can’t perform that action at this time.
0 commit comments