diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2024-10-18 16:36:18 -0700 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2024-10-18 16:36:18 -0700 |
| commit | 3f695d789826bc19057a2e758e9bebfde2678fde (patch) | |
| tree | 0a159d1148f00705fad6c03b5071f9f1cc3262cf /mlir/lib/TableGen/Predicate.cpp | |
| parent | 9a4661cf31ea41143ee1c5a926a75320f91b1783 (diff) | |
| parent | f5bd36aece8f6b12422ce30903dd78d1b5006efd (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.lsan-fix-compilation-on-android
Created using spr 1.3.4
[skip ci]
Diffstat (limited to 'mlir/lib/TableGen/Predicate.cpp')
| -rw-r--r-- | mlir/lib/TableGen/Predicate.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/mlir/lib/TableGen/Predicate.cpp b/mlir/lib/TableGen/Predicate.cpp index 0e38dab8491c..f71dd0bd35f8 100644 --- a/mlir/lib/TableGen/Predicate.cpp +++ b/mlir/lib/TableGen/Predicate.cpp @@ -20,15 +20,18 @@ using namespace mlir; using namespace tblgen; +using llvm::Init; +using llvm::Record; +using llvm::SpecificBumpPtrAllocator; // Construct a Predicate from a record. -Pred::Pred(const llvm::Record *record) : def(record) { +Pred::Pred(const Record *record) : def(record) { assert(def->isSubClassOf("Pred") && "must be a subclass of TableGen 'Pred' class"); } // Construct a Predicate from an initializer. -Pred::Pred(const llvm::Init *init) { +Pred::Pred(const Init *init) { if (const auto *defInit = dyn_cast_or_null<llvm::DefInit>(init)) def = defInit->getDef(); } @@ -48,12 +51,12 @@ bool Pred::isCombined() const { ArrayRef<SMLoc> Pred::getLoc() const { return def->getLoc(); } -CPred::CPred(const llvm::Record *record) : Pred(record) { +CPred::CPred(const Record *record) : Pred(record) { assert(def->isSubClassOf("CPred") && "must be a subclass of Tablegen 'CPred' class"); } -CPred::CPred(const llvm::Init *init) : Pred(init) { +CPred::CPred(const Init *init) : Pred(init) { assert((!def || def->isSubClassOf("CPred")) && "must be a subclass of Tablegen 'CPred' class"); } @@ -64,22 +67,22 @@ std::string CPred::getConditionImpl() const { return std::string(def->getValueAsString("predExpr")); } -CombinedPred::CombinedPred(const llvm::Record *record) : Pred(record) { +CombinedPred::CombinedPred(const Record *record) : Pred(record) { assert(def->isSubClassOf("CombinedPred") && "must be a subclass of Tablegen 'CombinedPred' class"); } -CombinedPred::CombinedPred(const llvm::Init *init) : Pred(init) { +CombinedPred::CombinedPred(const Init *init) : Pred(init) { assert((!def || def->isSubClassOf("CombinedPred")) && "must be a subclass of Tablegen 'CombinedPred' class"); } -const llvm::Record *CombinedPred::getCombinerDef() const { +const Record *CombinedPred::getCombinerDef() const { assert(def->getValue("kind") && "CombinedPred must have a value 'kind'"); return def->getValueAsDef("kind"); } -std::vector<const llvm::Record *> CombinedPred::getChildren() const { +std::vector<const Record *> CombinedPred::getChildren() const { assert(def->getValue("children") && "CombinedPred must have a value 'children'"); return def->getValueAsListOfDefs("children"); @@ -156,7 +159,7 @@ static void performSubstitutions(std::string &str, // All nodes are created within "allocator". static PredNode * buildPredicateTree(const Pred &root, - llvm::SpecificBumpPtrAllocator<PredNode> &allocator, + SpecificBumpPtrAllocator<PredNode> &allocator, ArrayRef<Subst> substitutions) { auto *rootNode = allocator.Allocate(); new (rootNode) PredNode; @@ -351,7 +354,7 @@ static std::string getCombinedCondition(const PredNode &root) { } std::string CombinedPred::getConditionImpl() const { - llvm::SpecificBumpPtrAllocator<PredNode> allocator; + SpecificBumpPtrAllocator<PredNode> allocator; auto *predicateTree = buildPredicateTree(*this, allocator, {}); predicateTree = propagateGroundTruth(predicateTree, |
