about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-15 02:21:18 +0000
committerbors <bors@rust-lang.org>2020-11-15 02:21:18 +0000
commit75042566d1c90d912f22e4db43b6d3af98447986 (patch)
tree59ffa44ee35633cf8ff80b132e2cf0919c3dd787 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent361c4ea22486557ec50c4fc6a93d60e7476ecbea (diff)
parent96515ccc7a41cc8968ee742cb4d65205582e0fe9 (diff)
downloadrust-75042566d1c90d912f22e4db43b6d3af98447986.tar.gz
rust-75042566d1c90d912f22e4db43b6d3af98447986.zip
Auto merge of #79065 - Dylan-DPC:rollup-gag1drk, r=Dylan-DPC
Rollup of 15 pull requests

Successful merges:

 - #78352 (Do not call `unwrap` with `signatures` option enabled)
 - #78590 (refactor: removing alloc::collections::vec_deque ignore-tidy-filelength)
 - #78848 (Bump minimal supported LLVM version to 9)
 - #78856 (Explicitly checking for or-pattern before test)
 - #78948 (test: add `()=()=()=...` to weird-exprs.rs)
 - #78962 (Add a test for r# identifiers)
 - #78963 (Added some unit tests as requested)
 - #78966 (Never inline C variadics, cold functions, functions with incompatible attributes ...)
 - #78968 (Include llvm-as in llvm-tools-preview component)
 - #78969 (Normalize function type during validation)
 - #78980 (Fix rustc_ast_pretty print_qpath resulting in invalid macro input)
 - #78986 (Avoid installing external LLVM dylibs)
 - #78988 (Fix an intrinsic invocation on threaded wasm)
 - #78993 (rustc_target: Fix dash vs underscore mismatches in option names)
 - #79013 (Clean up outdated `use_once_payload` pretty printer comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index 938eb19faef..9b0c176b692 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -124,9 +124,7 @@ extern "C" LLVMValueRef LLVMRustGetOrInsertFunction(LLVMModuleRef M,
   return wrap(unwrap(M)
                   ->getOrInsertFunction(StringRef(Name, NameLen),
                                         unwrap<FunctionType>(FunctionTy))
-#if LLVM_VERSION_GE(9, 0)
                   .getCallee()
-#endif
   );
 }
 
@@ -251,11 +249,7 @@ extern "C" void LLVMRustAddDereferenceableOrNullCallSiteAttr(LLVMValueRef Instr,
 extern "C" void LLVMRustAddByValCallSiteAttr(LLVMValueRef Instr, unsigned Index,
                                              LLVMTypeRef Ty) {
   CallBase *Call = unwrap<CallBase>(Instr);
-#if LLVM_VERSION_GE(9, 0)
   Attribute Attr = Attribute::getWithByValType(Call->getContext(), unwrap(Ty));
-#else
-  Attribute Attr = Attribute::get(Call->getContext(), Attribute::ByVal);
-#endif
   Call->addAttribute(Index, Attr);
 }
 
@@ -296,11 +290,7 @@ extern "C" void LLVMRustAddDereferenceableOrNullAttr(LLVMValueRef Fn,
 extern "C" void LLVMRustAddByValAttr(LLVMValueRef Fn, unsigned Index,
                                      LLVMTypeRef Ty) {
   Function *F = unwrap<Function>(Fn);
-#if LLVM_VERSION_GE(9, 0)
   Attribute Attr = Attribute::getWithByValType(F->getContext(), unwrap(Ty));
-#else
-  Attribute Attr = Attribute::get(F->getContext(), Attribute::ByVal);
-#endif
   F->addAttribute(Index, Attr);
 }
 
@@ -616,11 +606,9 @@ static DISubprogram::DISPFlags fromRust(LLVMRustDISPFlags SPFlags) {
   if (isSet(SPFlags & LLVMRustDISPFlags::SPFlagOptimized)) {
     Result |= DISubprogram::DISPFlags::SPFlagOptimized;
   }
-#if LLVM_VERSION_GE(9, 0)
   if (isSet(SPFlags & LLVMRustDISPFlags::SPFlagMainSubprogram)) {
     Result |= DISubprogram::DISPFlags::SPFlagMainSubprogram;
   }
-#endif
 
   return Result;
 }
@@ -744,10 +732,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFunction(
       DITemplateParameterArray(unwrap<MDTuple>(TParam));
   DISubprogram::DISPFlags llvmSPFlags = fromRust(SPFlags);
   DINode::DIFlags llvmFlags = fromRust(Flags);
-#if LLVM_VERSION_LT(9, 0)
-  if (isSet(SPFlags & LLVMRustDISPFlags::SPFlagMainSubprogram))
-    llvmFlags |= DINode::DIFlags::FlagMainSubprogram;
-#endif
   DISubprogram *Sub = Builder->createFunction(
       unwrapDI<DIScope>(Scope),
       StringRef(Name, NameLen),