Almost complete implementation of rvalue references. One bug, and a few unclear areas. Maybe Doug can shed some light on some of the fixmes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67059 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 92eeb5d..d54849b 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -365,12 +365,17 @@
     mangleType(PT->getPointeeType());
   }
   //         ::= R <type>   # reference-to
-  //         ::= O <type>   # rvalue reference-to (C++0x)
-  else if (const ReferenceType *RT = dyn_cast<ReferenceType>(T.getTypePtr())) {
-    // FIXME: rvalue references
+  else if (const LValueReferenceType *RT =
+           dyn_cast<LValueReferenceType>(T.getTypePtr())) {
     Out << 'R';
     mangleType(RT->getPointeeType());
   }
+  //         ::= O <type>   # rvalue reference-to (C++0x)
+  else if (const RValueReferenceType *RT =
+           dyn_cast<RValueReferenceType>(T.getTypePtr())) {
+    Out << 'O';
+    mangleType(RT->getPointeeType());
+  }
   //         ::= C <type>   # complex pair (C 2000)
   else if (const ComplexType *CT = dyn_cast<ComplexType>(T.getTypePtr())) {
     Out << 'C';