Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Dec 15, 2023
1 parent a3e1666 commit 27756ab
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 139 deletions.
2 changes: 0 additions & 2 deletions clambcc/clambc-compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,6 @@ def createInputSourceFile(clangLLVM: ClangLLVM, name: str, args: list, options:
, 'verify'
, 'clambc-remove-fshl'
, 'verify'
, 'clambc-remove-pointer-phis'
, 'verify'
, 'clambc-lowering-notfinal' # perform lowering pass
, 'verify'
, 'lowerswitch'
Expand Down
2 changes: 1 addition & 1 deletion libclambcc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_subdirectory(ClamBCPreserveABIs)
add_subdirectory(ClamBCAnalyzer)
add_subdirectory(Common)
add_subdirectory(ClamBCVerifier)
add_subdirectory(ClamBCRemovePointerPHIs)
#add_subdirectory(ClamBCRemovePointerPHIs)
add_subdirectory(ClamBCLowering)
add_subdirectory(ClamBCRemoveFreezeInsts)
add_subdirectory(ClamBCWriter)
Expand Down
22 changes: 2 additions & 20 deletions libclambcc/ClamBCRemovePointerPHIs/ClamBCRemovePointerPHIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ using namespace llvm;

namespace
{
//class ClambcRemovePointerPHIs : public FunctionPass
class ClamBCRemovePointerPHIs : public PassInfoMixin<ClamBCRemovePointerPHIs>
{
protected:
//Function *pFunc = nullptr;
llvm::Module * pMod = nullptr;

std::vector<PHINode *> gatherPHIs(llvm::Function * pFunc)
Expand Down Expand Up @@ -182,7 +180,6 @@ class ClamBCRemovePointerPHIs : public PassInfoMixin<ClamBCRemovePointerPHIs>
if (not pn->getType()->isPointerTy()) {
return false;
}
//std::vector<Value*> delLst;

Value *pBasePtr = findBasePointer(pn);
if (nullptr == pBasePtr) { /*No unique base pointer.*/
Expand Down Expand Up @@ -293,17 +290,12 @@ class ClamBCRemovePointerPHIs : public PassInfoMixin<ClamBCRemovePointerPHIs>
}

public:
// static char ID;
ClamBCRemovePointerPHIs()
/*: FunctionPass(ID)*/ {}
ClamBCRemovePointerPHIs() {}

#if 0
bool runOnFunction(Function &F) override
#else
virtual PreservedAnalyses run(Module & m, ModuleAnalysisManager & mam)
#endif
{

/*Currently unused. Will remove after the RC phase.*/
DEBUGERR << "TODO: EVALUATE WHETHER OR NOT I NEED THIS" << "<END>\n"; return PreservedAnalyses::all();

pMod = &m;
Expand Down Expand Up @@ -334,14 +326,6 @@ class ClamBCRemovePointerPHIs : public PassInfoMixin<ClamBCRemovePointerPHIs>

} // end of anonymous namespace

#if 0
char ClambcRemovePointerPHIs::ID = 0;
static RegisterPass<ClambcRemovePointerPHIs> X("clambc-remove-pointer-phis", "Remove PHI Nodes with pointers",
false /* Only looks at CFG */,
false /* Analysis Pass */);
#else


// This part is the new way of registering your pass
extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
llvmGetPassPluginInfo() {
Expand All @@ -365,6 +349,4 @@ llvmGetPassPluginInfo() {



#endif


116 changes: 0 additions & 116 deletions libclambcc/ClamBCRemoveSelectInsts/ClamBCRemoveSelectInsts.cpp

This file was deleted.

17 changes: 17 additions & 0 deletions libclambcc/ClamBCRemoveUndefs/ClamBCRemoveUndefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@
#include "Common/ClamBCUtilities.h"
using namespace llvm;



#if 0


THIS APPEARS TO NO LONGER BE NEEDED. LEAVING IN PLACE DURING THE RC PHASE, JUST IN CASE.



#endif







namespace
{
/*
Expand Down

0 comments on commit 27756ab

Please sign in to comment.