@@ -131,7 +131,7 @@ namespace xcpp
131131
132132 // Generate relocations suitable for dynamic linking.
133133 auto CodeGenOpts = CI->getCodeGenOpts ();
134- CodeGenOpts.RelocationModel = " pic " ;
134+ CodeGenOpts.RelocationModel = llvm::Reloc::Model::PIC_ ;
135135
136136 // Enable debug information if requested.
137137 if (EnableDebugInfo)
@@ -187,7 +187,7 @@ namespace xcpp
187187 llvm::sys::path::append (Compiler, " bin" , " clang++" );
188188
189189 // Construct arguments to linker command.
190- llvm::SmallVector<const char * , 16 > Args;
190+ llvm::SmallVector<llvm::StringRef , 16 > Args;
191191 Args.push_back (Compiler.c_str ());
192192 Args.push_back (ObjectFile.c_str ());
193193 for (auto & O : LinkerOptions)
@@ -196,7 +196,6 @@ namespace xcpp
196196 }
197197 Args.push_back (" -o" );
198198 Args.push_back (ExeFile.c_str ());
199- Args.push_back (NULL );
200199
201200 // Redirect output and error streams from linker.
202201 llvm::SmallString<64 > OutputFile, ErrorFile;
@@ -207,11 +206,10 @@ namespace xcpp
207206
208207 llvm::StringRef OutputFileStr (OutputFile);
209208 llvm::StringRef ErrorFileStr (ErrorFile);
210- const llvm::StringRef* Redirects[] = {nullptr , &OutputFileStr,
211- &ErrorFileStr};
209+ llvm::SmallVector<llvm::Optional<llvm::StringRef>, 16 > Redirects = {llvm::NoneType::None, OutputFileStr, ErrorFileStr};
212210
213211 // Finally run the linker.
214- int ret = llvm::sys::ExecuteAndWait (Compiler, Args. data (), nullptr ,
212+ int ret = llvm::sys::ExecuteAndWait (Compiler, Args, llvm::NoneType::None ,
215213 Redirects);
216214
217215 // Read back output and error streams.
0 commit comments