[dragonegg] r182192 - When creating subprogram metadata, DIBuilder doesn't want a derived type of any

Duncan Sands baldrick at free.fr
Sat May 18 03:35:28 PDT 2013


Author: baldrick
Date: Sat May 18 05:35:28 2013
New Revision: 182192

URL: http://llvm.org/viewvc/llvm-project?rev=182192&view=rev
Log:
When creating subprogram metadata, DIBuilder doesn't want a derived type of any
kind, so just use the main variant here.

Added:
    dragonegg/trunk/test/compilator/local/c/typedef.c
Modified:
    dragonegg/trunk/src/Debug.cpp

Modified: dragonegg/trunk/src/Debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Debug.cpp?rev=182192&r1=182191&r2=182192&view=diff
==============================================================================
--- dragonegg/trunk/src/Debug.cpp (original)
+++ dragonegg/trunk/src/Debug.cpp Sat May 18 05:35:28 2013
@@ -231,7 +231,7 @@ StringRef DebugInfo::getFunctionName(tre
 
 /// EmitFunctionStart - Constructs the debug code for entering a function.
 void DebugInfo::EmitFunctionStart(tree FnDecl, Function *Fn) {
-  DIType FNType = getOrCreateType(TREE_TYPE(FnDecl));
+  DIType FNType = getOrCreateType(TYPE_MAIN_VARIANT(TREE_TYPE(FnDecl)));
 
   unsigned lineno = CurLineNo;
 
@@ -844,7 +844,7 @@ DIType DebugInfo::createStructType(tree
   return RealDecl;
 }
 
-/// createVarinatType - Create variant type or return MainTy.
+/// createVariantType - Create variant type or return MainTy.
 DIType DebugInfo::createVariantType(tree type, DIType MainTy) {
 
   DIType Ty;
@@ -864,9 +864,7 @@ DIType DebugInfo::createVariantType(tree
     }
   }
 
-  // Handle volatile types.  Volatile function types are not volatile in the
-  // sense meant here.
-  if (TYPE_VOLATILE(type) && !isa<FUNCTION_TYPE>(type)) {
+  if (TYPE_VOLATILE(type)) {
     Ty = CreateDerivedType(
         DW_TAG_volatile_type, findRegion(TYPE_CONTEXT(type)), StringRef(),
         getOrCreateFile(main_input_filename), 0 /*line no*/,

Added: dragonegg/trunk/test/compilator/local/c/typedef.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/compilator/local/c/typedef.c?rev=182192&view=auto
==============================================================================
--- dragonegg/trunk/test/compilator/local/c/typedef.c (added)
+++ dragonegg/trunk/test/compilator/local/c/typedef.c Sat May 18 05:35:28 2013
@@ -0,0 +1,4 @@
+/* Do not pass a typedef when creating debug info for the function definition */
+typedef void fn_t();
+fn_t b;
+void b() {}





More information about the llvm-commits mailing list