Fixup key function calculations.

llvm-svn: 89412
diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index a63c832..edf19f7 100644
--- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@ -345,12 +345,8 @@
     if (MD->isPure())
       continue;
 
-    // FIXME: This doesn't work.  If we have an out of line body, that body will
-    // set the MD to have a body, what we want to know is, was the body present
-    // inside the declaration of the class.  For now, we just avoid the problem
-    // by pretending there is no key function.
-    return 0;
-    if (MD->getBody())
+    const FunctionDecl *fn;
+    if (MD->getBody(fn) && !fn->isOutOfLine())
       continue;
 
     // We found it.