diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-09-12 05:19:24 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-09-12 05:19:24 +0000 |
commit | be25030137581596ed289dc7955f5b69dbadcf63 (patch) | |
tree | 80b6017de73ca835ae13b5b68a654681be045e37 /clang/lib/Lex/Pragma.cpp | |
parent | fec61ef3911abde1ee4967a8b7ebb6d9799e8742 (diff) | |
download | bcm5719-llvm-be25030137581596ed289dc7955f5b69dbadcf63.tar.gz bcm5719-llvm-be25030137581596ed289dc7955f5b69dbadcf63.zip |
Use unique_ptr for ScratchBuf and PragmaHandlers in the preprocessor.
llvm-svn: 217656
Diffstat (limited to 'clang/lib/Lex/Pragma.cpp')
-rw-r--r-- | clang/lib/Lex/Pragma.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index af65bbfc9b1..b784c2938ed 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -728,7 +728,7 @@ void Preprocessor::HandlePragmaIncludeAlias(Token &Tok) { /// pragma line before the pragma string starts, e.g. "STDC" or "GCC". void Preprocessor::AddPragmaHandler(StringRef Namespace, PragmaHandler *Handler) { - PragmaNamespace *InsertNS = PragmaHandlers; + PragmaNamespace *InsertNS = PragmaHandlers.get(); // If this is specified to be in a namespace, step down into it. if (!Namespace.empty()) { @@ -759,7 +759,7 @@ void Preprocessor::AddPragmaHandler(StringRef Namespace, /// a handler that has not been registered. void Preprocessor::RemovePragmaHandler(StringRef Namespace, PragmaHandler *Handler) { - PragmaNamespace *NS = PragmaHandlers; + PragmaNamespace *NS = PragmaHandlers.get(); // If this is specified to be in a namespace, step down into it. if (!Namespace.empty()) { @@ -772,9 +772,8 @@ void Preprocessor::RemovePragmaHandler(StringRef Namespace, NS->RemovePragmaHandler(Handler); - // If this is a non-default namespace and it is now empty, remove - // it. - if (NS != PragmaHandlers && NS->IsEmpty()) { + // If this is a non-default namespace and it is now empty, remove it. + if (NS != PragmaHandlers.get() && NS->IsEmpty()) { PragmaHandlers->RemovePragmaHandler(NS); delete NS; } |