mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 00:46:45 +08:00
[TableGen] Use ArrayRef instead of SmallVectorImpl for suitable method
PiperOrigin-RevId: 235577399
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
||||
std::string getQualCppClassName() const;
|
||||
|
||||
// Returns the TableGen definition name split around '_'.
|
||||
const SmallVectorImpl<StringRef> &getSplitDefName() const;
|
||||
ArrayRef<StringRef> getSplitDefName() const;
|
||||
|
||||
// Returns the number of results this op produces.
|
||||
int getNumResults() const;
|
||||
|
||||
@@ -39,7 +39,7 @@ tblgen::Operator::Operator(const llvm::Record &def) : def(def) {
|
||||
populateOpStructure();
|
||||
}
|
||||
|
||||
const SmallVectorImpl<StringRef> &tblgen::Operator::getSplitDefName() const {
|
||||
ArrayRef<StringRef> tblgen::Operator::getSplitDefName() const {
|
||||
return splittedDefName;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,10 +145,10 @@ OpEmitter::OpEmitter(const Record &def, raw_ostream &os)
|
||||
: def(def), op(def), os(os) {}
|
||||
|
||||
void OpEmitter::mapOverClassNamespaces(function_ref<void(StringRef)> fn) {
|
||||
auto &splittedDefName = op.getSplitDefName();
|
||||
for (auto it = splittedDefName.begin(), e = std::prev(splittedDefName.end());
|
||||
it != e; ++it)
|
||||
fn(*it);
|
||||
// We only care about namespaces, so drop the class name here
|
||||
auto splittedDefName = op.getSplitDefName().drop_back();
|
||||
for (auto ns : splittedDefName)
|
||||
fn(ns);
|
||||
}
|
||||
|
||||
void OpEmitter::emit(const Record &def, raw_ostream &os) {
|
||||
|
||||
Reference in New Issue
Block a user