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

llvm-svn: 67059
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp
index 92eeb5d..d54849b 100644
--- a/clang/lib/CodeGen/Mangle.cpp
+++ b/clang/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';