Make naked functions work on PPC.
[oota-llvm.git] / lib / CodeGen / PrologEpilogInserter.cpp
index 365a84ab5242648a4939ad75e81233206671203a..16bf6ea765f6b7d50a761888b343ce3e6e633698 100644 (file)
@@ -197,6 +197,10 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
   if (CSRegs == 0 || CSRegs[0] == 0)
     return;
 
+  // In Naked functions we aren't going to save any registers.
+  if (Fn.getFunction()->hasFnAttr(Attribute::Naked))
+    return;
+
   // Figure out which *callee saved* registers are modified by the current
   // function, thus needing to be saved and restored in the prolog/epilog.
   const TargetRegisterClass * const *CSRegClasses =