[C++11] Use 'nullptr'.

llvm-svn: 209612
This commit is contained in:
Craig Topper 2014-05-26 06:21:51 +00:00
parent ab53c91010
commit 236bde3d6f
4 changed files with 8 additions and 8 deletions

View File

@ -74,14 +74,14 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
if (it->getName() == CI.getFrontendOpts().ActionName) { if (it->getName() == CI.getFrontendOpts().ActionName) {
std::unique_ptr<PluginASTAction> P(it->instantiate()); std::unique_ptr<PluginASTAction> P(it->instantiate());
if (!P->ParseArgs(CI, CI.getFrontendOpts().PluginArgs)) if (!P->ParseArgs(CI, CI.getFrontendOpts().PluginArgs))
return 0; return nullptr;
return P.release(); return P.release();
} }
} }
CI.getDiagnostics().Report(diag::err_fe_invalid_plugin_name) CI.getDiagnostics().Report(diag::err_fe_invalid_plugin_name)
<< CI.getFrontendOpts().ActionName; << CI.getFrontendOpts().ActionName;
return 0; return nullptr;
} }
case PrintDeclContext: return new DeclContextPrintAction(); case PrintDeclContext: return new DeclContextPrintAction();
@ -133,7 +133,7 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
// Create the underlying action. // Create the underlying action.
FrontendAction *Act = CreateFrontendBaseAction(CI); FrontendAction *Act = CreateFrontendBaseAction(CI);
if (!Act) if (!Act)
return 0; return nullptr;
const FrontendOptions &FEOpts = CI.getFrontendOpts(); const FrontendOptions &FEOpts = CI.getFrontendOpts();
@ -217,7 +217,7 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
Args[0] = "clang (LLVM option parsing)"; Args[0] = "clang (LLVM option parsing)";
for (unsigned i = 0; i != NumArgs; ++i) for (unsigned i = 0; i != NumArgs; ++i)
Args[i + 1] = Clang->getFrontendOpts().LLVMArgs[i].c_str(); Args[i + 1] = Clang->getFrontendOpts().LLVMArgs[i].c_str();
Args[NumArgs + 1] = 0; Args[NumArgs + 1] = nullptr;
llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get()); llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get());
} }

View File

@ -97,7 +97,7 @@ struct FullCommentParts {
FullCommentParts::FullCommentParts(const FullComment *C, FullCommentParts::FullCommentParts(const FullComment *C,
const CommandTraits &Traits) : const CommandTraits &Traits) :
Brief(NULL), Headerfile(NULL), FirstParagraph(NULL) { Brief(nullptr), Headerfile(nullptr), FirstParagraph(nullptr) {
for (Comment::child_iterator I = C->child_begin(), E = C->child_end(); for (Comment::child_iterator I = C->child_begin(), E = C->child_end();
I != E; ++I) { I != E; ++I) {
const Comment *Child = *I; const Comment *Child = *I;
@ -1150,7 +1150,7 @@ void CommentToXMLConverter::convertCommentToHTML(const FullComment *FC,
void CommentToXMLConverter::convertHTMLTagNodeToText( void CommentToXMLConverter::convertHTMLTagNodeToText(
const comments::HTMLTagComment *HTC, SmallVectorImpl<char> &Text, const comments::HTMLTagComment *HTC, SmallVectorImpl<char> &Text,
const ASTContext &Context) { const ASTContext &Context) {
CommentASTToHTMLConverter Converter(0, Text, CommentASTToHTMLConverter Converter(nullptr, Text,
Context.getCommentCommandTraits()); Context.getCommentCommandTraits());
Converter.visit(HTC); Converter.visit(HTC);
} }

View File

@ -52,7 +52,7 @@ public:
const FileEntry *Entry = const FileEntry *Entry =
Files.getVirtualFile(Name, Source->getBufferSize(), 0); Files.getVirtualFile(Name, Source->getBufferSize(), 0);
Sources.overrideFileContents(Entry, Source); Sources.overrideFileContents(Entry, Source);
assert(Entry != NULL); assert(Entry != nullptr);
return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User); return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User);
} }

View File

@ -109,7 +109,7 @@ public:
bool ShouldGenerateLocation(const NamedDecl *D); bool ShouldGenerateLocation(const NamedDecl *D);
bool isLocal(const NamedDecl *D) { bool isLocal(const NamedDecl *D) {
return D->getParentFunctionOrMethod() != 0; return D->getParentFunctionOrMethod() != nullptr;
} }
/// Generate the string component containing the location of the /// Generate the string component containing the location of the