diff options
author | Ahmed Charles <ahmedcharles@gmail.com> | 2014-03-05 10:19:29 +0000 |
---|---|---|
committer | Ahmed Charles <ahmedcharles@gmail.com> | 2014-03-05 10:19:29 +0000 |
commit | 1a6eca243f9274b9b371b7306fa939568ce5c37f (patch) | |
tree | e08f8984bc44b63a79a4e1737a47dd66e86c1850 /utils | |
parent | 7b62be28cbc6cce31852831570a87d9699fbcecd (diff) | |
download | llvm-1a6eca243f9274b9b371b7306fa939568ce5c37f.tar.gz llvm-1a6eca243f9274b9b371b7306fa939568ce5c37f.tar.bz2 llvm-1a6eca243f9274b9b371b7306fa939568ce5c37f.tar.xz |
[C++11] Replace OwningPtr::take() with OwningPtr::release().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/FileCheck/FileCheck.cpp | 4 | ||||
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 6 | ||||
-rw-r--r-- | utils/TableGen/DAGISelMatcher.h | 2 | ||||
-rw-r--r-- | utils/TableGen/DAGISelMatcherOpt.cpp | 16 |
4 files changed, 14 insertions, 14 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index d33db18cb8..b0196f7fa8 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/utils/FileCheck/FileCheck.cpp @@ -832,7 +832,7 @@ static bool ReadCheckFile(SourceMgr &SM, // If we want to canonicalize whitespace, strip excess whitespace from the // buffer containing the CHECK lines. Remove DOS style line endings. MemoryBuffer *F = - CanonicalizeInputFile(File.take(), NoCanonicalizeWhiteSpace); + CanonicalizeInputFile(File.release(), NoCanonicalizeWhiteSpace); SM.AddNewSourceBuffer(F, SMLoc()); @@ -1234,7 +1234,7 @@ int main(int argc, char **argv) { // Remove duplicate spaces in the input file if requested. // Remove DOS style line endings. MemoryBuffer *F = - CanonicalizeInputFile(File.take(), NoCanonicalizeWhiteSpace); + CanonicalizeInputFile(File.release(), NoCanonicalizeWhiteSpace); SM.AddNewSourceBuffer(F, SMLoc()); diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index cf4580f659..e9760625f6 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -1366,7 +1366,7 @@ void AsmMatcherInfo::buildInfo() { StringRef(II->TheDef->getName()).endswith("_Int")) continue; - Matchables.push_back(II.take()); + Matchables.push_back(II.release()); } // Parse all of the InstAlias definitions and stick them in the list of @@ -1390,7 +1390,7 @@ void AsmMatcherInfo::buildInfo() { // Validate the alias definitions. II->validate(CommentDelimiter, false); - Matchables.push_back(II.take()); + Matchables.push_back(II.release()); } } @@ -1461,7 +1461,7 @@ void AsmMatcherInfo::buildInfo() { AliasII->formTwoOperandAlias(Constraint); // Add the alias to the matchables list. - NewMatchables.push_back(AliasII.take()); + NewMatchables.push_back(AliasII.release()); } } else II->buildAliasResultOperands(); diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h index bf760d5034..441acd56b2 100644 --- a/utils/TableGen/DAGISelMatcher.h +++ b/utils/TableGen/DAGISelMatcher.h @@ -98,7 +98,7 @@ public: Matcher *getNext() { return Next.get(); } const Matcher *getNext() const { return Next.get(); } void setNext(Matcher *C) { Next.reset(C); } - Matcher *takeNext() { return Next.take(); } + Matcher *takeNext() { return Next.release(); } OwningPtr<Matcher> &getNextPtr() { return Next; } diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp index 682b27c097..bde864aa0f 100644 --- a/utils/TableGen/DAGISelMatcherOpt.cpp +++ b/utils/TableGen/DAGISelMatcherOpt.cpp @@ -33,7 +33,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) { OwningPtr<Matcher> Child(Scope->takeChild(i)); ContractNodes(Child, CGP); - Scope->resetChild(i, Child.take()); + Scope->resetChild(i, Child.release()); } return; } @@ -62,7 +62,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, if (New) { // Insert the new node. - New->setNext(MatcherPtr.take()); + New->setNext(MatcherPtr.release()); MatcherPtr.reset(New); // Remove the old one. MC->setNext(MC->getNext()->takeNext()); @@ -85,7 +85,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, if (isa<EmitNodeMatcher>(N) && isa<MarkGlueResultsMatcher>(N->getNext()) && isa<CompleteMatchMatcher>(N->getNext()->getNext())) { // Unlink the two nodes from the list. - Matcher *EmitNode = MatcherPtr.take(); + Matcher *EmitNode = MatcherPtr.release(); Matcher *MFR = EmitNode->takeNext(); Matcher *Tail = MFR->takeNext(); @@ -164,7 +164,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, isa<RecordMatcher>(N)) && isa<CheckOpcodeMatcher>(N->getNext())) { // Unlink the two nodes from the list. - Matcher *CheckType = MatcherPtr.take(); + Matcher *CheckType = MatcherPtr.release(); Matcher *CheckOpcode = CheckType->takeNext(); Matcher *Tail = CheckOpcode->takeNext(); @@ -198,7 +198,7 @@ static void SinkPatternPredicates(OwningPtr<Matcher> &MatcherPtr) { for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) { OwningPtr<Matcher> Child(Scope->takeChild(i)); SinkPatternPredicates(Child); - Scope->resetChild(i, Child.take()); + Scope->resetChild(i, Child.release()); } return; } @@ -217,7 +217,7 @@ static void SinkPatternPredicates(OwningPtr<Matcher> &MatcherPtr) { // Okay, we know we can sink it past at least one node. Unlink it from the // chain and scan for the new insertion point. - MatcherPtr.take(); // Don't delete CPPM. + MatcherPtr.release(); // Don't delete CPPM. MatcherPtr.reset(CPPM->takeNext()); N = MatcherPtr.get(); @@ -272,7 +272,7 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) { OwningPtr<Matcher> Child(Scope->takeChild(i)); FactorNodes(Child); - if (Matcher *N = Child.take()) + if (Matcher *N = Child.release()) OptionsToMatch.push_back(N); } @@ -516,5 +516,5 @@ Matcher *llvm::OptimizeMatcher(Matcher *TheMatcher, ContractNodes(MatcherPtr, CGP); SinkPatternPredicates(MatcherPtr); FactorNodes(MatcherPtr); - return MatcherPtr.take(); + return MatcherPtr.release(); } |