[cfe-commits] r64156 - in /cfe/trunk/lib/CodeGen: CodeGenFunction.cpp CodeGenFunction.h

Anders Carlsson andersca at mac.com
Mon Feb 9 12:20:56 PST 2009


Author: andersca
Date: Mon Feb  9 14:20:56 2009
New Revision: 64156

URL: http://llvm.org/viewvc/llvm-project?rev=64156&view=rev
Log:
Add DidCallStackSave variable to CodeGenFunction.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=64156&r1=64155&r2=64156&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Mon Feb  9 14:20:56 2009
@@ -144,6 +144,7 @@
                                     llvm::Function *Fn,
                                     const FunctionArgList &Args,
                                     SourceLocation StartLoc) {
+  DidCallStackSave = false;
   CurFuncDecl = D;
   FnRetTy = RetTy;
   CurFn = Fn;

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=64156&r1=64155&r2=64156&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Mon Feb  9 14:20:56 2009
@@ -260,6 +260,10 @@
   /// which the stack depth changes.
   llvm::Value *StackDepth;
 
+  /// DidCallStackSave - Whether llvm.stacksave has been called. Used to avoid
+  /// calling llvm.stacksave for multiple VLAs in the same scope.
+  bool DidCallStackSave;
+  
   /// StackSaveValues - A stack(!) of stack save values. When a new scope is
   /// entered, a null is pushed on this stack. If a VLA is emitted, then the
   /// return value of llvm.stacksave() is stored at the top of this stack.





More information about the cfe-commits mailing list