Skip to content

Commit

Permalink
Change LLVMRustGetThinLTOModuleImports() so it also works with LLVM 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Jul 13, 2018
1 parent 7822623 commit 81daa48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ LLVMRustGetThinLTOModuleImports(const LLVMRustThinLTOData *Data) {
new LLVMRustThinLTOModuleImports[Data->ImportLists.size() + 1];
size_t module_index = 0;

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

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

size_t imports_array_index = 1;
for (const auto imported_module_id : imports.keys()) {
for (const auto& imported_module : imports) {
StringRef imported_module_id = imported_module.getKey();
// The following values are the names of the imported modules.
imports_array[imports_array_index] = strndup(imported_module_id.data(),
imported_module_id.size());
Expand Down

0 comments on commit 81daa48

Please sign in to comment.