[clang] edeb0f4 - [clang][Interp][NFC] Clean up InterpState.cpp

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 07:36:26 PST 2023


Author: Timm Bäder
Date: 2023-02-28T16:36:16+01:00
New Revision: edeb0f49794c63d22a4c7fd6d2672c8544038dca

URL: https://github.com/llvm/llvm-project/commit/edeb0f49794c63d22a4c7fd6d2672c8544038dca
DIFF: https://github.com/llvm/llvm-project/commit/edeb0f49794c63d22a4c7fd6d2672c8544038dca.diff

LOG: [clang][Interp][NFC] Clean up InterpState.cpp

Remove unused includes, an unused using alias and braces in single-line
if statements.

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpState.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpState.cpp b/clang/lib/AST/Interp/InterpState.cpp
index 25684f3c0939..6ae4ecd78c0f 100644
--- a/clang/lib/AST/Interp/InterpState.cpp
+++ b/clang/lib/AST/Interp/InterpState.cpp
@@ -7,20 +7,14 @@
 //===----------------------------------------------------------------------===//
 
 #include "InterpState.h"
-#include <limits>
-#include "Function.h"
 #include "InterpFrame.h"
 #include "InterpStack.h"
-#include "Opcode.h"
-#include "PrimType.h"
 #include "Program.h"
 #include "State.h"
 
 using namespace clang;
 using namespace clang::interp;
 
-using APSInt = llvm::APSInt;
-
 InterpState::InterpState(State &Parent, Program &P, InterpStack &Stk,
                          Context &Ctx, SourceMapper *M)
     : Parent(Parent), M(M), P(P), Stk(Stk), Ctx(Ctx), Current(nullptr),
@@ -41,11 +35,9 @@ InterpState::~InterpState() {
 }
 
 Frame *InterpState::getCurrentFrame() {
-  if (Current && Current->Caller) {
+  if (Current && Current->Caller)
     return Current;
-  } else {
-    return Parent.getCurrentFrame();
-  }
+  return Parent.getCurrentFrame();
 }
 
 bool InterpState::reportOverflow(const Expr *E, const llvm::APSInt &Value) {


        


More information about the cfe-commits mailing list