Apply most suggestions of clang-tidy's performance-unnecessary-value-param

Avoids unnecessary copies. All changes audited & pass tests with asan.
No functional change intended.

llvm-svn: 272190
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index 7e82677..fca6ca8 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -108,7 +108,7 @@
 
 ErrorOr<std::unique_ptr<LTOModule>>
 LTOModule::createFromFile(LLVMContext &Context, const char *path,
-                          TargetOptions options) {
+                          const TargetOptions &options) {
   ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
       MemoryBuffer::getFile(path);
   if (std::error_code EC = BufferOrErr.getError()) {
@@ -122,14 +122,14 @@
 
 ErrorOr<std::unique_ptr<LTOModule>>
 LTOModule::createFromOpenFile(LLVMContext &Context, int fd, const char *path,
-                              size_t size, TargetOptions options) {
+                              size_t size, const TargetOptions &options) {
   return createFromOpenFileSlice(Context, fd, path, size, 0, options);
 }
 
 ErrorOr<std::unique_ptr<LTOModule>>
 LTOModule::createFromOpenFileSlice(LLVMContext &Context, int fd,
                                    const char *path, size_t map_size,
-                                   off_t offset, TargetOptions options) {
+                                   off_t offset, const TargetOptions &options) {
   ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
       MemoryBuffer::getOpenFileSlice(fd, path, map_size, offset);
   if (std::error_code EC = BufferOrErr.getError()) {
@@ -143,7 +143,7 @@
 
 ErrorOr<std::unique_ptr<LTOModule>>
 LTOModule::createFromBuffer(LLVMContext &Context, const void *mem,
-                            size_t length, TargetOptions options,
+                            size_t length, const TargetOptions &options,
                             StringRef path) {
   StringRef Data((const char *)mem, length);
   MemoryBufferRef Buffer(Data, path);
@@ -153,7 +153,7 @@
 ErrorOr<std::unique_ptr<LTOModule>>
 LTOModule::createInLocalContext(std::unique_ptr<LLVMContext> Context,
                                 const void *mem, size_t length,
-                                TargetOptions options, StringRef path) {
+                                const TargetOptions &options, StringRef path) {
   StringRef Data((const char *)mem, length);
   MemoryBufferRef Buffer(Data, path);
   // If we own a context, we know this is being used only for symbol extraction,
@@ -196,7 +196,7 @@
 }
 
 ErrorOr<std::unique_ptr<LTOModule>>
-LTOModule::makeLTOModule(MemoryBufferRef Buffer, TargetOptions options,
+LTOModule::makeLTOModule(MemoryBufferRef Buffer, const TargetOptions &options,
                          LLVMContext &Context, bool ShouldBeLazy) {
   ErrorOr<std::unique_ptr<Module>> MOrErr =
       parseBitcodeFileImpl(Buffer, Context, ShouldBeLazy);