summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexCodeCompletion.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-06-08 08:38:04 +0000
committerCraig Topper <craig.topper@gmail.com>2014-06-08 08:38:04 +0000
commit69186e731ffd95c3d3c2b70d36e306d109c92630 (patch)
tree49f0a5d5ab913569e3001330c5b277687d522e04 /clang/tools/libclang/CIndexCodeCompletion.cpp
parent71e07869afdf3c8318c1a0b95a0e32ef4fee2065 (diff)
downloadbcm5719-llvm-69186e731ffd95c3d3c2b70d36e306d109c92630.tar.gz
bcm5719-llvm-69186e731ffd95c3d3c2b70d36e306d109c92630.zip
[C++11] Use 'nullptr'. Tools edition.
llvm-svn: 210422
Diffstat (limited to 'clang/tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r--clang/tools/libclang/CIndexCodeCompletion.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp
index dbf54a1a8c1..edc8368ca3e 100644
--- a/clang/tools/libclang/CIndexCodeCompletion.cpp
+++ b/clang/tools/libclang/CIndexCodeCompletion.cpp
@@ -153,7 +153,7 @@ clang_getCompletionChunkCompletionString(CXCompletionString completion_string,
unsigned chunk_number) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr || chunk_number >= CCStr->size())
- return 0;
+ return nullptr;
switch ((*CCStr)[chunk_number].Kind) {
case CodeCompletionString::CK_TypedText:
@@ -176,7 +176,7 @@ clang_getCompletionChunkCompletionString(CXCompletionString completion_string,
case CodeCompletionString::CK_Equal:
case CodeCompletionString::CK_HorizontalSpace:
case CodeCompletionString::CK_VerticalSpace:
- return 0;
+ return nullptr;
case CodeCompletionString::CK_Optional:
// Note: treated as an empty text block.
@@ -568,8 +568,8 @@ namespace {
}
QualType baseType = Context.getBaseType();
- NamedDecl *D = NULL;
-
+ NamedDecl *D = nullptr;
+
if (!baseType.isNull()) {
// Get the declaration for a class/struct/union/enum type
if (const TagType *Tag = baseType->getAs<TagType>())
@@ -587,8 +587,8 @@ namespace {
baseType->getAs<InjectedClassNameType>())
D = Injected->getDecl();
}
-
- if (D != NULL) {
+
+ if (D != nullptr) {
CXCursor cursor = cxcursor::MakeCXCursor(D, *TU);
AllocatedResults.ContainerKind = clang_getCursorKind(cursor);
@@ -598,7 +598,7 @@ namespace {
clang_disposeString(CursorUSR);
const Type *type = baseType.getTypePtrOrNull();
- if (type != NULL) {
+ if (type) {
AllocatedResults.ContainerIsIncomplete = type->isIncompleteType();
}
else {
@@ -666,7 +666,7 @@ void clang_codeCompleteAt_Impl(void *UserData) {
unsigned num_unsaved_files = CCAI->num_unsaved_files;
unsigned options = CCAI->options;
bool IncludeBriefComments = options & CXCodeComplete_IncludeBriefComments;
- CCAI->result = 0;
+ CCAI->result = nullptr;
#ifdef UDP_CODE_COMPLETION_LOGGER
#ifdef UDP_CODE_COMPLETION_LOGGER_PORT
@@ -674,7 +674,7 @@ void clang_codeCompleteAt_Impl(void *UserData) {
#endif
#endif
- bool EnableLogging = getenv("LIBCLANG_CODE_COMPLETION_LOGGING") != 0;
+ bool EnableLogging = getenv("LIBCLANG_CODE_COMPLETION_LOGGING") != nullptr;
if (cxtu::isNotUsableTU(TU)) {
LOG_BAD_TU(TU);
@@ -708,7 +708,7 @@ void clang_codeCompleteAt_Impl(void *UserData) {
// Parse the resulting source file to find code-completion results.
AllocatedCXCodeCompleteResults *Results = new AllocatedCXCodeCompleteResults(
&AST->getFileManager());
- Results->Results = 0;
+ Results->Results = nullptr;
Results->NumResults = 0;
// Create a code-completion consumer to capture the results.
@@ -825,7 +825,7 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
CodeCompleteAtInfo CCAI = { TU, complete_filename, complete_line,
complete_column, unsaved_files, num_unsaved_files,
- options, 0 };
+ options, nullptr };
if (getenv("LIBCLANG_NOTHREADS")) {
clang_codeCompleteAt_Impl(&CCAI);
@@ -837,7 +837,7 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
if (!RunSafely(CRC, clang_codeCompleteAt_Impl, &CCAI)) {
fprintf(stderr, "libclang: crash detected in code completion\n");
cxtu::getASTUnit(TU)->setUnsafeToFree(true);
- return 0;
+ return nullptr;
} else if (getenv("LIBCLANG_RESOURCE_USAGE"))
PrintLibclangResourceUsage(TU);
@@ -873,7 +873,7 @@ clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *ResultsIn,
AllocatedCXCodeCompleteResults *Results
= static_cast<AllocatedCXCodeCompleteResults*>(ResultsIn);
if (!Results || Index >= Results->Diagnostics.size())
- return 0;
+ return nullptr;
CXStoredDiagnostic *Diag = Results->DiagnosticsWrappers[Index];
if (!Diag)
@@ -899,8 +899,8 @@ enum CXCursorKind clang_codeCompleteGetContainerKind(
static_cast<AllocatedCXCodeCompleteResults *>(ResultsIn);
if (!Results)
return CXCursor_InvalidCode;
-
- if (IsIncomplete != NULL) {
+
+ if (IsIncomplete != nullptr) {
*IsIncomplete = Results->ContainerIsIncomplete;
}
OpenPOWER on IntegriCloud