Migrate AtomicExpandPass and DwarfEHPrepare to using a Function-ized getSubtargetImpl.
authorEric Christopher <echristo@gmail.com>
Tue, 27 Jan 2015 01:04:42 +0000 (01:04 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 27 Jan 2015 01:04:42 +0000 (01:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227159 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AtomicExpandPass.cpp
lib/CodeGen/DwarfEHPrepare.cpp

index be4e6c24a8c64652d6f7997b757cf2a4b6de0a87..4b64be053dfd31fa928895369e86ff7dab515cfa 100644 (file)
@@ -68,9 +68,9 @@ FunctionPass *llvm::createAtomicExpandPass(const TargetMachine *TM) {
 }
 
 bool AtomicExpand::runOnFunction(Function &F) {
-  if (!TM || !TM->getSubtargetImpl()->enableAtomicExpand())
+  if (!TM || !TM->getSubtargetImpl(F)->enableAtomicExpand())
     return false;
-  TLI = TM->getSubtargetImpl()->getTargetLowering();
+  TLI = TM->getSubtargetImpl(F)->getTargetLowering();
 
   SmallVector<Instruction *, 1> AtomicInsts;
 
index 75b74d9a6c33243a79369f73147750e89e7e1bfb..70664207587a2f9265d8992092a42582f26a9e29 100644 (file)
@@ -124,7 +124,7 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls(Function &Fn) {
     return false;
 
   // Find the rewind function if we didn't already.
-  const TargetLowering *TLI = TM->getSubtargetImpl()->getTargetLowering();
+  const TargetLowering *TLI = TM->getSubtargetImpl(Fn)->getTargetLowering();
   if (!RewindFunction) {
     LLVMContext &Ctx = Resumes[0]->getContext();
     FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx),