[clang] e8ad133 - [clang][Interp][NFC] Remove unused function

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 03:51:43 PDT 2022


Author: Timm Bäder
Date: 2022-09-29T12:50:57+02:00
New Revision: e8ad1339d441931326554bdc4ec6b7198f289028

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

LOG: [clang][Interp][NFC] Remove unused function

Added: 
    

Modified: 
    clang/lib/AST/Interp/Program.cpp
    clang/lib/AST/Interp/Program.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Program.cpp b/clang/lib/AST/Interp/Program.cpp
index e0dbdaa9a118..cca59bee1f20 100644
--- a/clang/lib/AST/Interp/Program.cpp
+++ b/clang/lib/AST/Interp/Program.cpp
@@ -208,19 +208,6 @@ Function *Program::getFunction(const FunctionDecl *F) {
   return It == Funcs.end() ? nullptr : It->second.get();
 }
 
-llvm::Expected<Function *> Program::getOrCreateFunction(const FunctionDecl *F) {
-  if (Function *Func = getFunction(F)) {
-    return Func;
-  }
-
-  // Try to compile the function if it wasn't compiled yet.
-  if (const FunctionDecl *FD = F->getDefinition())
-    return ByteCodeStmtGen<ByteCodeEmitter>(Ctx, *this).compileFunc(FD);
-
-  // A relocation which traps if not resolved.
-  return nullptr;
-}
-
 Record *Program::getOrCreateRecord(const RecordDecl *RD) {
   // Use the actual definition as a key.
   RD = RD->getDefinition();

diff  --git a/clang/lib/AST/Interp/Program.h b/clang/lib/AST/Interp/Program.h
index 6a0024664417..1a175d8b0f20 100644
--- a/clang/lib/AST/Interp/Program.h
+++ b/clang/lib/AST/Interp/Program.h
@@ -100,11 +100,6 @@ class Program final {
   /// Returns a function.
   Function *getFunction(const FunctionDecl *F);
 
-  /// Returns a pointer to a function if it exists and can be compiled.
-  /// If a function couldn't be compiled, an error is returned.
-  /// If a function was not yet defined, a null pointer is returned.
-  llvm::Expected<Function *> getOrCreateFunction(const FunctionDecl *F);
-
   /// Returns a record or creates one if it does not exist.
   Record *getOrCreateRecord(const RecordDecl *RD);
 


        


More information about the cfe-commits mailing list