]> granicus.if.org Git - clang/commitdiff
Simplify. There is no need to have a method to just call another method.
authorDevang Patel <dpatel@apple.com>
Mon, 25 Apr 2011 23:43:36 +0000 (23:43 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 25 Apr 2011 23:43:36 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130175 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h

index 77e6336a60844e663994301d81c0344b28159405..a90237cb3234096db30c34582fb6e4d6b9b66894 100644 (file)
@@ -1969,17 +1969,22 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
   }
 }
 
-/// EmitDeclare - Emit local variable declaration debug info.
-void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
-                              llvm::Value *Storage, CGBuilderTy &Builder,
-                              const CGBlockInfo &blockInfo) {
-  assert(!RegionStack.empty() && "Region stack mismatch, stack empty!");
+void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD,
+                                            llvm::Value *Storage,
+                                            CGBuilderTy &Builder) {
+  EmitDeclare(VD, llvm::dwarf::DW_TAG_auto_variable, Storage, 0, Builder);
+}
 
+void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(
+  const VarDecl *VD, llvm::Value *Storage, CGBuilderTy &Builder,
+  const CGBlockInfo &blockInfo) {
+  assert(!RegionStack.empty() && "Region stack mismatch, stack empty!");
+  
   if (Builder.GetInsertBlock() == 0)
     return;
-
+  
   bool isByRef = VD->hasAttr<BlocksAttr>();
-
+  
   uint64_t XOffset = 0;
   llvm::DIFile Unit = getOrCreateFile(VD->getLocation());
   llvm::DIType Ty;
@@ -2017,7 +2022,8 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
 
   // Create the descriptor for the variable.
   llvm::DIVariable D =
-    DBuilder.createComplexVariable(Tag, llvm::DIDescriptor(RegionStack.back()),
+    DBuilder.createComplexVariable(llvm::dwarf::DW_TAG_auto_variable, 
+                                   llvm::DIDescriptor(RegionStack.back()),
                                    VD->getName(), Unit, Line, Ty, addr);
   // Insert an llvm.dbg.declare into the current block.
   llvm::Instruction *Call = 
@@ -2027,19 +2033,6 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
   Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope));
 }
 
-void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD,
-                                            llvm::Value *Storage,
-                                            CGBuilderTy &Builder) {
-  EmitDeclare(VD, llvm::dwarf::DW_TAG_auto_variable, Storage, 0, Builder);
-}
-
-void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(
-  const VarDecl *variable, llvm::Value *Storage, CGBuilderTy &Builder,
-  const CGBlockInfo &blockInfo) {
-  EmitDeclare(variable, llvm::dwarf::DW_TAG_auto_variable, Storage, Builder,
-              blockInfo);
-}
-
 /// EmitDeclareOfArgVariable - Emit call to llvm.dbg.declare for an argument
 /// variable declaration.
 void CGDebugInfo::EmitDeclareOfArgVariable(const VarDecl *VD, llvm::Value *AI,
index af00c2f84f5a26146f17ef5137ffdb1dc3874d6f..27d991bbee420acb24c3ed0f3d212e81661a4d58 100644 (file)
@@ -221,11 +221,6 @@ private:
   void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI,
                    unsigned ArgNo, CGBuilderTy &Builder);
 
-  /// EmitDeclare - Emit call to llvm.dbg.declare for a variable
-  /// declaration from an enclosing block.
-  void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI,
-                   CGBuilderTy &Builder, const CGBlockInfo &blockInfo);
-
   // EmitTypeForVarWithBlocksAttr - Build up structure info for the byref.  
   // See BuildByRefType.
   llvm::DIType EmitTypeForVarWithBlocksAttr(const ValueDecl *VD,