summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-09-12 05:19:24 +0000
committerCraig Topper <craig.topper@gmail.com>2014-09-12 05:19:24 +0000
commitbe25030137581596ed289dc7955f5b69dbadcf63 (patch)
tree80b6017de73ca835ae13b5b68a654681be045e37 /clang/lib/Lex/Pragma.cpp
parentfec61ef3911abde1ee4967a8b7ebb6d9799e8742 (diff)
downloadbcm5719-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.cpp9
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;
}
OpenPOWER on IntegriCloud