[dragonegg] r182105 - Don't create a volatile derived type metadatum from a function type then try to

Duncan Sands baldrick at free.fr
Fri May 17 08:06:55 PDT 2013


Author: baldrick
Date: Fri May 17 10:06:55 2013
New Revision: 182105

URL: http://llvm.org/viewvc/llvm-project?rev=182105&view=rev
Log:
Don't create a volatile derived type metadatum from a function type then try to
use it to create a subprogram metadatum.  Found by the DIBuilder checking.

Added:
    dragonegg/trunk/test/compilator/local/ada/volatile_function.adb
    dragonegg/trunk/test/compilator/local/ada/volatile_function.ads
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=182105&r1=182104&r2=182105&view=diff
==============================================================================
--- dragonegg/trunk/src/Debug.cpp (original)
+++ dragonegg/trunk/src/Debug.cpp Fri May 17 10:06:55 2013
@@ -864,7 +864,9 @@ DIType DebugInfo::createVariantType(tree
     }
   }
 
-  if (TYPE_VOLATILE(type)) {
+  // Handle volatile types.  Volatile function types are not volatile in the
+  // sense meant here.
+  if (TYPE_VOLATILE(type) && !isa<FUNCTION_TYPE>(type)) {
     Ty = CreateDerivedType(
         DW_TAG_volatile_type, findRegion(TYPE_CONTEXT(type)), StringRef(),
         getOrCreateFile(main_input_filename), 0 /*line no*/,
@@ -885,7 +887,7 @@ DIType DebugInfo::createVariantType(tree
     return Ty;
   }
 
-  // If, for some reason, main type varaint type is seen then use it.
+  // If, for some reason, main type variant type is seen then use it.
   return MainTy;
 }
 

Added: dragonegg/trunk/test/compilator/local/ada/volatile_function.adb
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/compilator/local/ada/volatile_function.adb?rev=182105&view=auto
==============================================================================
--- dragonegg/trunk/test/compilator/local/ada/volatile_function.adb (added)
+++ dragonegg/trunk/test/compilator/local/ada/volatile_function.adb Fri May 17 10:06:55 2013
@@ -0,0 +1,6 @@
+package body Volatile_Function is
+   procedure Volatile is
+   begin
+      raise Program_Error;
+   end;
+end Volatile_Function;

Added: dragonegg/trunk/test/compilator/local/ada/volatile_function.ads
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/compilator/local/ada/volatile_function.ads?rev=182105&view=auto
==============================================================================
--- dragonegg/trunk/test/compilator/local/ada/volatile_function.ads (added)
+++ dragonegg/trunk/test/compilator/local/ada/volatile_function.ads Fri May 17 10:06:55 2013
@@ -0,0 +1,4 @@
+package Volatile_Function is
+   procedure Volatile;
+   pragma No_Return (Volatile);
+end Volatile_Function;





More information about the llvm-commits mailing list