Skip to content

Commit 81daa48

Browse files
Change LLVMRustGetThinLTOModuleImports() so it also works with LLVM 4.
1 parent 7822623 commit 81daa48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rustllvm/PassWrapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ LLVMRustGetThinLTOModuleImports(const LLVMRustThinLTOData *Data) {
11171117
new LLVMRustThinLTOModuleImports[Data->ImportLists.size() + 1];
11181118
size_t module_index = 0;
11191119

1120-
for (const auto & module : Data->ImportLists) {
1120+
for (const auto& module : Data->ImportLists) {
11211121
StringRef module_id = module.getKey();
11221122
const auto& imports = module.getValue();
11231123

@@ -1130,7 +1130,8 @@ LLVMRustGetThinLTOModuleImports(const LLVMRustThinLTOData *Data) {
11301130
imports_array[0] = strndup(module_id.data(), module_id.size());
11311131

11321132
size_t imports_array_index = 1;
1133-
for (const auto imported_module_id : imports.keys()) {
1133+
for (const auto& imported_module : imports) {
1134+
StringRef imported_module_id = imported_module.getKey();
11341135
// The following values are the names of the imported modules.
11351136
imports_array[imports_array_index] = strndup(imported_module_id.data(),
11361137
imported_module_id.size());

0 commit comments

Comments
 (0)