[cfe-commits] r115104 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/debug-info-self.m

Devang Patel dpatel at apple.com
Wed Sep 29 16:09:21 PDT 2010


Author: dpatel
Date: Wed Sep 29 18:09:21 2010
New Revision: 115104

URL: http://llvm.org/viewvc/llvm-project?rev=115104&view=rev
Log:
Attach aritifical attribute with implicit parameters.
Radar 8493141.

Added:
    cfe/trunk/test/CodeGenObjC/debug-info-self.m
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=115104&r1=115103&r2=115104&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Sep 29 18:09:21 2010
@@ -1729,12 +1729,15 @@
   // Get location information.
   unsigned Line = getLineNumber(VD->getLocation());
   unsigned Column = getColumnNumber(VD->getLocation());
-
+  unsigned Flags = 0;
+  if (VD->isImplicit())
+    Flags |= llvm::DIDescriptor::FlagArtificial;
   // Create the descriptor for the variable.
   llvm::DIVariable D =
     DebugFactory.CreateVariable(Tag, llvm::DIDescriptor(RegionStack.back()),
-                                VD->getName(),
-                                Unit, Line, Ty, CGM.getLangOptions().Optimize);
+                                VD->getName(), Unit, Line, Ty, 
+                                CGM.getLangOptions().Optimize, Flags);
+
   // Insert an llvm.dbg.declare into the current block.
   llvm::Instruction *Call =
     DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());

Added: cfe/trunk/test/CodeGenObjC/debug-info-self.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-self.m?rev=115104&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-self.m (added)
+++ cfe/trunk/test/CodeGenObjC/debug-info-self.m Wed Sep 29 18:09:21 2010
@@ -0,0 +1,16 @@
+// RUN: %clang -fverbose-asm -g -S %s -o - | grep DW_AT_artificial | count 3
+// self and _cmd are marked as DW_AT_artificial. 
+// abbrev code emits another DT_artificial comment.
+// myarg is not marked as DW_AT_artificial.
+
+ at interface MyClass {
+}
+- (id)init:(int) myarg;
+ at end
+
+ at implementation MyClass
+- (id) init:(int) myarg
+{
+    return self;
+}
+ at end





More information about the cfe-commits mailing list