[llvm-commits] [llvm-gcc-4.2] r93620 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Devang Patel dpatel at apple.com
Fri Jan 15 17:53:44 PST 2010


Author: dpatel
Date: Fri Jan 15 19:53:43 2010
New Revision: 93620

URL: http://llvm.org/viewvc/llvm-project?rev=93620&view=rev
Log:
- There is not any reason to skip function name if its debug info is emitted.
- Update code to match comment.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=93620&r1=93619&r2=93620&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Jan 15 19:53:43 2010
@@ -263,20 +263,21 @@
     Virtuality = dwarf::DW_VIRTUALITY_virtual;
     ContainingType = getOrCreateType(DECL_CONTEXT (FnDecl));
   }
-  bool UseModuleContext = false;
+
+  bool ArtificialFnWithAbstractOrigin = false;
   // If this artificial function has abstract origin then put this function
   // at module scope. The abstract copy will be placed in appropriate region.
-  if (DECL_ABSTRACT_ORIGIN (FnDecl) != FnDecl
-      && DECL_ARTIFICIAL(FnDecl))
-    UseModuleContext = true;
-  
+  if (DECL_ARTIFICIAL (FnDecl)
+      && DECL_ABSTRACT_ORIGIN (FnDecl)
+      && DECL_ABSTRACT_ORIGIN (FnDecl) != FnDecl)
+    ArtificialFnWithAbstractOrigin = true;
+
   const char *FnName = lang_hooks.dwarf_name(FnDecl, 0);
   DISubprogram SP = 
-    DebugFactory.CreateSubprogram((UseModuleContext ?
-                                   getOrCreateCompileUnit(main_input_filename) :
-                                   findRegion(DECL_CONTEXT(FnDecl))),
-                                  (UseModuleContext ? FnName : StringRef()), 
-                                  (UseModuleContext ? FnName : StringRef()), 
+    DebugFactory.CreateSubprogram(ArtificialFnWithAbstractOrigin ?
+                                  getOrCreateCompileUnit(main_input_filename) :
+                                  findRegion (DECL_CONTEXT(FnDecl)),
+                                  FnName, FnName,
                                   LinkageName,
                                   getOrCreateCompileUnit(Loc.file), lineno,
                                   FNType,





More information about the llvm-commits mailing list