Files
revng-revng/include/revng-c/RemoveExtractValues/RemoveExtractValuesPass.h
T
Pietro Fezzardi 08939f2ae8 OpaqueExtractValues: set name for struct type
This commit sets a name for types we use in OpaqueExtractValues.
These are StructTypes that can only be returned from isolated functions
with RawFunctionType prototype on the model, or from helpers that do not
represent isolated functions.

The name is required because when we will converto to MLIR LLVM Dialect,
there are checks in place that forbid unnamed types.
The code re-uses code that is used to print C code, in order to make
sure that the struct names we use for this are the same as those we emit
in C, to ease debugging.

This commit also cleans up the unittest to make it more concise, while
still testing the same things.
2023-10-02 17:13:55 +02:00

19 lines
364 B
C++

#pragma once
//
// Copyright rev.ng Labs Srl. See LICENSE.md for details.
//
#include "llvm/Pass.h"
class RemoveExtractValues : public llvm::FunctionPass {
public:
static char ID;
public:
RemoveExtractValues() : llvm::FunctionPass(ID) {}
bool runOnFunction(llvm::Function &) override;
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override;
};