GlobalISel: merge invoke and call translation paths.

Well, sort of. But the lower-level code that invoke used to be using completely
botched the handling of varargs functions, which hopefully won't be possible if
they're using the same code.

llvm-svn: 293670
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 33e7085..2d6f7d2 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -23,8 +23,9 @@
 
 using namespace llvm;
 
+template<typename CallInstTy>
 bool CallLowering::lowerCall(
-    MachineIRBuilder &MIRBuilder, const CallInst &CI, unsigned ResReg,
+    MachineIRBuilder &MIRBuilder, const CallInstTy &CI, unsigned ResReg,
     ArrayRef<unsigned> ArgRegs, std::function<unsigned()> GetCalleeReg) const {
   auto &DL = CI.getParent()->getParent()->getParent()->getDataLayout();
 
@@ -55,6 +56,16 @@
   return lowerCall(MIRBuilder, Callee, OrigRet, OrigArgs);
 }
 
+template bool
+CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, const CallInst &CI,
+                        unsigned ResReg, ArrayRef<unsigned> ArgRegs,
+                        std::function<unsigned()> GetCalleeReg) const;
+
+template bool
+CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, const InvokeInst &CI,
+                        unsigned ResReg, ArrayRef<unsigned> ArgRegs,
+                        std::function<unsigned()> GetCalleeReg) const;
+
 template <typename FuncInfoTy>
 void CallLowering::setArgFlags(CallLowering::ArgInfo &Arg, unsigned OpIdx,
                                const DataLayout &DL,