[PATCH] D52657: [LLVM-C] Fix broken build bots
Robert Widmann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 28 09:05:38 PDT 2018
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL343334: [LLVM-C] Fix broken build bots (authored by CodaFi, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52657?vs=167490&id=167492#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52657
Files:
llvm/trunk/lib/IR/Core.cpp
Index: llvm/trunk/lib/IR/Core.cpp
===================================================================
--- llvm/trunk/lib/IR/Core.cpp
+++ llvm/trunk/lib/IR/Core.cpp
@@ -872,6 +872,30 @@
unwrap<Instruction>(Inst)->setMetadata(KindID, N);
}
+struct LLVMOpaqueValueMetadataEntry {
+ unsigned Kind;
+ LLVMMetadataRef Metadata;
+};
+
+using MetadataEntries = SmallVectorImpl<std::pair<unsigned, MDNode *>>;
+static LLVMValueMetadataEntry *
+llvm_getMetadata(size_t *NumEntries,
+ llvm::function_ref<void(MetadataEntries &)> AccessMD) {
+ SmallVector<std::pair<unsigned, MDNode *>, 8> MVEs;
+ AccessMD(MVEs);
+
+ LLVMOpaqueValueMetadataEntry *Result =
+ static_cast<LLVMOpaqueValueMetadataEntry *>(
+ safe_malloc(MVEs.size() * sizeof(LLVMOpaqueValueMetadataEntry)));
+ for (unsigned i = 0; i < MVEs.size(); ++i) {
+ const auto &ModuleFlag = MVEs[i];
+ Result[i].Kind = ModuleFlag.first;
+ Result[i].Metadata = wrap(ModuleFlag.second);
+ }
+ *NumEntries = MVEs.size();
+ return Result;
+}
+
LLVMValueMetadataEntry *
LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Value,
size_t *NumEntries) {
@@ -1884,30 +1908,6 @@
"only GlobalValue, AllocaInst, LoadInst and StoreInst have alignment");
}
-struct LLVMOpaqueValueMetadataEntry {
- unsigned Kind;
- LLVMMetadataRef Metadata;
-};
-
-using MetadataEntries = SmallVectorImpl<std::pair<unsigned, MDNode *>>;
-static LLVMValueMetadataEntry *
-llvm_getMetadata(size_t *NumEntries,
- llvm::function_ref<void(MetadataEntries &)> AccessMD) {
- SmallVector<std::pair<unsigned, MDNode *>, 8> MVEs;
- AccessMD(MVEs);
-
- LLVMOpaqueValueMetadataEntry *Result =
- static_cast<LLVMOpaqueValueMetadataEntry *>(
- safe_malloc(MVEs.size() * sizeof(LLVMOpaqueValueMetadataEntry)));
- for (unsigned i = 0; i < MVEs.size(); ++i) {
- const auto &ModuleFlag = MVEs[i];
- Result[i].Kind = ModuleFlag.first;
- Result[i].Metadata = wrap(ModuleFlag.second);
- }
- *NumEntries = MVEs.size();
- return Result;
-}
-
LLVMValueMetadataEntry *LLVMGlobalCopyAllMetadata(LLVMValueRef Value,
size_t *NumEntries) {
return llvm_getMetadata(NumEntries, [&Value](MetadataEntries &Entries) {
@@ -1940,7 +1940,7 @@
void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
LLVMMetadataRef MD) {
- unwrap<GlobalObject>(Global)->setMetadata(Kind, unwrapDI<MDNode>(MD));
+ unwrap<GlobalObject>(Global)->setMetadata(Kind, unwrap<MDNode>(MD));
}
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52657.167492.patch
Type: text/x-patch
Size: 2710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180928/13519d8b/attachment.bin>
More information about the llvm-commits
mailing list