llvm.org GIT mirror llvm / 3987976
Replace &vector[0] with vector.data() to avoid invalid dereference caught by debug STL. Also move a '*' for consistency and fix an 80-col violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244134 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 5 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
102102 // use only and will not be passed.
103103 static std::vector extra;
104104
105 static void process_plugin_option(const char* opt_)
105 static void process_plugin_option(const char *opt_)
106106 {
107107 if (opt_ == nullptr)
108108 return;
321321 message(LDPL_ERROR, "Failed to get a view of %s", file->name);
322322 return LDPS_ERR;
323323 }
324 BufferRef = MemoryBufferRef(StringRef((const char *)view, file->filesize), "");
324 BufferRef =
325 MemoryBufferRef(StringRef((const char *)view, file->filesize), "");
325326 } else {
326327 int64_t offset = 0;
327328 // Gold has found what might be IR part-way inside of a file, such as
428429 }
429430
430431 if (!cf.syms.empty()) {
431 if (add_symbols(cf.handle, cf.syms.size(), &cf.syms[0]) != LDPS_OK) {
432 if (add_symbols(cf.handle, cf.syms.size(), cf.syms.data()) != LDPS_OK) {
432433 message(LDPL_ERROR, "Unable to add symbols!");
433434 return LDPS_ERR;
434435 }
582583 ld_plugin_input_file &Info, raw_fd_ostream *ApiFile,
583584 StringSet<> &Internalize, StringSet<> &Maybe) {
584585
585 if (get_symbols(F.handle, F.syms.size(), &F.syms[0]) != LDPS_OK)
586 if (get_symbols(F.handle, F.syms.size(), F.syms.data()) != LDPS_OK)
586587 message(LDPL_FATAL, "Failed to get symbol information");
587588
588589 const void *View;