[cfe-commits] r59032 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Chris Lattner sabre at nondot.org
Mon Nov 10 23:01:36 PST 2008


Author: lattner
Date: Tue Nov 11 01:01:36 2008
New Revision: 59032

URL: http://llvm.org/viewvc/llvm-project?rev=59032&view=rev
Log:
implement debug info for typeof()


Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=59032&r1=59031&r2=59032&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Nov 11 01:01:36 2008
@@ -15,6 +15,7 @@
 #include "CodeGenModule.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/FileManager.h"
@@ -382,8 +383,6 @@
   case Type::ObjCInterface:
   case Type::ObjCQualifiedInterface:
   case Type::ObjCQualifiedId:
-  case Type::TypeOfExp:
-  case Type::TypeOfTyp:
   default:
     return llvm::DIType();
 
@@ -393,14 +392,18 @@
   case Type::Tagged: Slot = CreateType(cast<TagType>(Ty), Unit); break;
   case Type::FunctionProto:
   case Type::FunctionNoProto:
-    Slot = CreateType(cast<FunctionType>(Ty), Unit);
-    break;
+    return Slot = CreateType(cast<FunctionType>(Ty), Unit);
     
   case Type::ConstantArray:
   case Type::VariableArray:
   case Type::IncompleteArray:
-    Slot = CreateType(cast<ArrayType>(Ty), Unit);
-    break;
+    return Slot = CreateType(cast<ArrayType>(Ty), Unit);
+  case Type::TypeOfExp:
+    return Slot = getOrCreateType(cast<TypeOfExpr>(Ty)->getUnderlyingExpr()
+                                  ->getType(), Unit);
+  case Type::TypeOfTyp:
+    return Slot = getOrCreateType(cast<TypeOfType>(Ty)->getUnderlyingType(),
+                                  Unit);
   }
   
   return Slot;





More information about the cfe-commits mailing list