Skip to content

Commit

Permalink
Remove the EnumConstantTable
Browse files Browse the repository at this point in the history
We don't need it anymore, LLVM-17 seems to have a way to get the
EnumDecl which results in the EnumConstantDecl.

Signed-off-by: Giuliano Belinassi <[email protected]>
  • Loading branch information
giulianobelinassi committed Jul 21, 2024
1 parent 6054fa3 commit 9b2dfb6
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 141 deletions.
10 changes: 2 additions & 8 deletions libcextract/Closure.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <clang/AST/RecursiveASTVisitor.h>
#include <unordered_set>

#include "EnumConstTbl.hh"
#include "LLVMMisc.hh"

using namespace clang;
Expand Down Expand Up @@ -134,8 +133,7 @@ class DeclClosureVisitor : public RecursiveASTVisitor<DeclClosureVisitor>
public:
DeclClosureVisitor(ASTUnit *ast)
: RecursiveASTVisitor(),
AST(ast),
EnumTable(ast)
AST(ast)
{
}

Expand Down Expand Up @@ -320,7 +318,7 @@ class DeclClosureVisitor : public RecursiveASTVisitor<DeclClosureVisitor>
bool VisitEnumConstantDecl(EnumConstantDecl *decl)
{
/* Add original EnumDecl it originated. */
EnumDecl *enum_decl = EnumTable.Get(decl);
EnumDecl *enum_decl = dyn_cast<EnumDecl>(decl->getLexicalDeclContext());
if (enum_decl) {
return TraverseDecl(enum_decl);
}
Expand Down Expand Up @@ -549,10 +547,6 @@ class DeclClosureVisitor : public RecursiveASTVisitor<DeclClosureVisitor>
may be (?) the ideal datastructure for this. */
ClosureSet Closure;

/** The table maping EnumConstantDecl to its original EnumDecl, used to find
out where a certain EnumConstantDecl was defined. */
EnumConstantTable EnumTable;

/** The set of all analyzed Decls. */
std::unordered_set<Decl *> AnalyzedDecls;
#undef TRY_TO
Expand Down
67 changes: 0 additions & 67 deletions libcextract/EnumConstTbl.cpp

This file was deleted.

64 changes: 0 additions & 64 deletions libcextract/EnumConstTbl.hh

This file was deleted.

1 change: 0 additions & 1 deletion libcextract/FunctionDepsFinder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#pragma once

#include "EnumConstTbl.hh"
#include "MacroWalker.hh"
#include "IncludeTree.hh"
#include "PrettyPrint.hh"
Expand Down
1 change: 0 additions & 1 deletion libcextract/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ libcextract_sources = [
'ArgvParser.cpp',
'DscFileGenerator.cpp',
'ElfCXX.cpp',
'EnumConstTbl.cpp',
'Error.cpp',
'FunctionDepsFinder.cpp',
'FunctionExternalizeFinder.cpp',
Expand Down

0 comments on commit 9b2dfb6

Please sign in to comment.