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

Devang Patel dpatel at apple.com
Thu Oct 7 15:03:49 PDT 2010


Author: dpatel
Date: Thu Oct  7 17:03:49 2010
New Revision: 115989

URL: http://llvm.org/viewvc/llvm-project?rev=115989&view=rev
Log:
Identify functions with prototype appropriately in debug info. 
This is tested by callfuncs.exp in gdb testsuite.

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=115989&r1=115988&r2=115989&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Oct  7 17:03:49 2010
@@ -746,6 +746,8 @@
     if (CXXC->isExplicit())
       Flags |= llvm::DIDescriptor::FlagExplicit;
   }
+  if (Method->hasPrototype())
+    Flags |= llvm::DIDescriptor::FlagPrototyped;
     
   llvm::DISubprogram SP =
     DebugFactory.CreateSubprogram(RecordTy , MethodName, MethodName, 
@@ -1526,6 +1528,7 @@
   FnBeginRegionCount.push_back(RegionStack.size());
 
   const Decl *D = GD.getDecl();
+  unsigned Flags = 0;
   if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
     // If there is a DISubprogram for  this function available then use it.
     llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator
@@ -1542,13 +1545,17 @@
     Name = getFunctionName(FD);
     // Use mangled name as linkage name for c/c++ functions.
     LinkageName = CGM.getMangledName(GD);
+    if (FD->hasPrototype())
+      Flags |= llvm::DIDescriptor::FlagPrototyped;
   } else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) {
     Name = getObjCMethodName(OMD);
     LinkageName = Name;
+    Flags |= llvm::DIDescriptor::FlagPrototyped;
   } else {
     // Use llvm function name as linkage name.
     Name = Fn->getName();
     LinkageName = Name;
+    Flags |= llvm::DIDescriptor::FlagPrototyped;
   }
   if (!Name.empty() && Name[0] == '\01')
     Name = Name.substr(1);
@@ -1558,7 +1565,6 @@
   // statement representing function body.
   llvm::DIFile Unit = getOrCreateFile(CurLoc);
   unsigned LineNo = getLineNumber(CurLoc);
-  unsigned Flags = 0;
   if (D->isImplicit())
     Flags |= llvm::DIDescriptor::FlagArtificial;
   llvm::DISubprogram SP =





More information about the cfe-commits mailing list