[llvm] r343334 - [LLVM-C] Fix broken build bots
Robert Widmann via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 28 09:02:26 PDT 2018
Author: codafi
Date: Fri Sep 28 09:02:26 2018
New Revision: 343334
URL: http://llvm.org/viewvc/llvm-project?rev=343334&view=rev
Log:
[LLVM-C] Fix broken build bots
Summary: Fix broken bots caused by the merge of D51522.
Reviewers: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52657
Modified:
llvm/trunk/lib/IR/Core.cpp
Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=343334&r1=343333&r2=343334&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Fri Sep 28 09:02:26 2018
@@ -872,6 +872,30 @@ void LLVMSetMetadata(LLVMValueRef Inst,
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 @@ void LLVMSetAlignment(LLVMValueRef V, un
"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 LLVMDisposeValueMetadataEntries(LLV
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) {
More information about the llvm-commits
mailing list