[PATCH] D23901: Minor cleanup of the class CallStackFrame

Alexander Shaposhnikov via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 25 18:33:37 PDT 2016


alexshap created this revision.
alexshap added reviewers: rsmith, gbiv, bkramer.
alexshap added a subscriber: cfe-commits.
alexshap set the repository for this revision to rL LLVM.
alexshap changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users".

The struct CallStackFrame is in lib/AST/ExprConstant.cpp
inside anonymous namespace.
This diff reorders the fields and removes excessive padding.
Test plan: make -j8 check-clang

Repository:
  rL LLVM

https://reviews.llvm.org/D23901

Files:
  lib/AST/ExprConstant.cpp

Index: lib/AST/ExprConstant.cpp
===================================================================
--- lib/AST/ExprConstant.cpp
+++ lib/AST/ExprConstant.cpp
@@ -310,15 +310,9 @@
     /// Parent - The caller of this stack frame.
     CallStackFrame *Caller;
 
-    /// CallLoc - The location of the call expression for this call.
-    SourceLocation CallLoc;
-
     /// Callee - The function which was called.
     const FunctionDecl *Callee;
 
-    /// Index - The call index of this call.
-    unsigned Index;
-
     /// This - The binding for the this pointer in this call, if any.
     const LValue *This;
 
@@ -333,6 +327,12 @@
     /// Temporaries - Temporary lvalues materialized within this stack frame.
     MapTy Temporaries;
 
+    /// CallLoc - The location of the call expression for this call.
+    SourceLocation CallLoc;
+
+    /// Index - The call index of this call.
+    unsigned Index;
+
     CallStackFrame(EvalInfo &Info, SourceLocation CallLoc,
                    const FunctionDecl *Callee, const LValue *This,
                    APValue *Arguments);
@@ -961,8 +961,8 @@
 CallStackFrame::CallStackFrame(EvalInfo &Info, SourceLocation CallLoc,
                                const FunctionDecl *Callee, const LValue *This,
                                APValue *Arguments)
-    : Info(Info), Caller(Info.CurrentCall), CallLoc(CallLoc), Callee(Callee),
-      Index(Info.NextCallIndex++), This(This), Arguments(Arguments) {
+    : Info(Info), Caller(Info.CurrentCall), Callee(Callee), This(This),
+      Arguments(Arguments), CallLoc(CallLoc), Index(Info.NextCallIndex++) {
   Info.CurrentCall = this;
   ++Info.CallStackDepth;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23901.69310.patch
Type: text/x-patch
Size: 1658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160826/ef4b25fb/attachment.bin>


More information about the cfe-commits mailing list