Use nullptr in cling

Avoid warnings when -Wzero-as-null-pointer-constant is specified
This commit is contained in:
Sergey Linev 2022-09-13 08:34:32 +02:00 committed by jenkins
parent 9cdbf1d0eb
commit 0525bca060
25 changed files with 241 additions and 241 deletions

View File

@ -79,7 +79,7 @@ namespace cling {
///
bool differentContent(const std::string& file1, const std::string& file2,
const char* type = nullptr, bool verbose = false,
const llvm::SmallVectorImpl<llvm::StringRef>* ignores = 0) const;
const llvm::SmallVectorImpl<llvm::StringRef>* ignores = nullptr) const;
///\brief Return the llvm::Module this state is bound too.
///
@ -95,7 +95,7 @@ namespace cling {
const clang::Preprocessor& PP);
private:
llvm::raw_fd_ostream* createOutputFile(llvm::StringRef OutFile,
std::string* TempPathName = 0,
std::string* TempPathName = nullptr,
bool RemoveFileOnSignal = true);
};
} // end namespace cling

View File

@ -208,7 +208,7 @@ namespace cling {
///\param[out] exists - sets if the file exists. Useful to distinguish if it
/// is a library but of incompatible file format.
///
static bool isSharedLibrary(llvm::StringRef libFullPath, bool* exists = 0);
static bool isSharedLibrary(llvm::StringRef libFullPath, bool *exists = nullptr);
};
} // end namespace cling
#endif // CLING_DYNAMIC_LIBRARY_MANAGER_H

View File

@ -255,7 +255,7 @@ namespace cling {
///
CompilationResult DeclareInternal(const std::string& input,
const CompilationOptions& CO,
Transaction** T = 0) const;
Transaction** T = nullptr) const;
///\brief Worker function, building block for interpreter's public
/// interfaces.
@ -272,8 +272,8 @@ namespace cling {
///
CompilationResult EvaluateInternal(const std::string& input,
CompilationOptions CO,
Value* V = 0,
Transaction** T = 0,
Value* V = nullptr,
Transaction** T = nullptr,
size_t wrapPoint = 0);
///\brief Worker function to code complete after all the mechanism
@ -312,7 +312,7 @@ namespace cling {
///\returns The result of the execution.
///
ExecutionResult RunFunction(const clang::FunctionDecl* FD,
Value* res = 0);
Value* res = nullptr);
///\brief Compile the function definition and return its Decl.
///
@ -357,7 +357,7 @@ namespace cling {
///\param[in] extraLibHandle - resolve symbols also from this dylib
///\param[in] noRuntime - flag to control the presence of runtime universe
///
Interpreter(int argc, const char* const* argv, const char* llvmdir = 0,
Interpreter(int argc, const char* const* argv, const char* llvmdir = nullptr,
const ModuleFileExtensions& moduleExtensions = {},
void *extraLibHandle = nullptr, bool noRuntime = false)
: Interpreter(argc, argv, llvmdir, moduleExtensions, extraLibHandle,
@ -374,7 +374,7 @@ namespace cling {
///\param[in] noRuntime - flag to control the presence of runtime universe
///
Interpreter(const Interpreter& parentInterpreter, int argc,
const char* const* argv, const char* llvmdir = 0,
const char* const* argv, const char* llvmdir = nullptr,
const ModuleFileExtensions& moduleExtensions = {},
void *extraLibHandle = nullptr, bool noRuntime = true);
@ -521,8 +521,8 @@ namespace cling {
///
///\returns Whether the operation was fully successful.
///
CompilationResult process(const std::string& input, Value* V = 0,
Transaction** T = 0,
CompilationResult process(const std::string& input, Value* V = nullptr,
Transaction** T = nullptr,
bool disableValuePrinting = false);
///\brief Parses input line, which doesn't contain statements. No code
@ -537,7 +537,7 @@ namespace cling {
///\returns Whether the operation was fully successful.
///
CompilationResult parse(const std::string& input,
Transaction** T = 0) const;
Transaction** T = nullptr) const;
/// Loads a C++ Module with a given name by synthesizing an Import decl.
/// This routine checks if there is a modulemap in the current directory
/// and loads it.
@ -594,7 +594,7 @@ namespace cling {
///
///\returns Whether the operation was fully successful.
///
CompilationResult declare(const std::string& input, Transaction** T = 0);
CompilationResult declare(const std::string& input, Transaction** T = nullptr);
///\brief Compiles input line, which contains only expressions.
///
@ -623,7 +623,7 @@ namespace cling {
///
///\returns Whether the operation was fully successful.
///
CompilationResult echo(const std::string& input, Value* V = 0);
CompilationResult echo(const std::string& input, Value* V = nullptr);
///\brief Compiles input line and runs.
///
@ -673,7 +673,7 @@ namespace cling {
///\returns result of the compilation.
///
CompilationResult loadHeader(const std::string& filename,
Transaction** T = 0);
Transaction** T = nullptr);
///\brief Loads header file or shared library.
///
@ -685,7 +685,7 @@ namespace cling {
///
CompilationResult loadFile(const std::string& filename,
bool allowSharedLib = true,
Transaction** T = 0);
Transaction** T = nullptr);
///\brief Unloads (forgets) a transaction from AST and JITed symbols.
///
@ -810,7 +810,7 @@ namespace cling {
///\param[in] D - the global's Decl to find
///\param[out] fromJIT - whether the symbol was JITted.
void* getAddressOfGlobal(const clang::GlobalDecl& D,
bool* fromJIT = 0) const;
bool* fromJIT = nullptr) const;
///\brief Gets the address of an existing global and whether it was JITted.
///
@ -820,7 +820,7 @@ namespace cling {
///\param[in] SymName - the name of the global to search
///\param[out] fromJIT - whether the symbol was JITted.
///
void* getAddressOfGlobal(llvm::StringRef SymName, bool* fromJIT = 0) const;
void* getAddressOfGlobal(llvm::StringRef SymName, bool* fromJIT = nullptr) const;
///\brief Get a given macro definition by name.
///
@ -860,7 +860,7 @@ namespace cling {
clang::ASTContext& Ctx,
llvm::raw_ostream& out,
bool enableMacros = false,
llvm::raw_ostream* logs = 0,
llvm::raw_ostream* logs = nullptr,
IgnoreFilesFunc_t ignoreFiles =
[](const clang::PresumedLoc&) { return false;}) const;

View File

@ -102,7 +102,7 @@ namespace cling {
///
const clang::Decl* findScope(llvm::StringRef className,
DiagSetting diagOnOff,
const clang::Type** resultType = 0,
const clang::Type** resultType = nullptr,
bool instantiateTemplate = true) const;

View File

@ -272,22 +272,22 @@ namespace cling {
const_nested_iterator nested_begin() const {
if (hasNestedTransactions())
return m_NestedTransactions->begin();
return 0;
return nullptr;
}
const_nested_iterator nested_end() const {
if (hasNestedTransactions())
return m_NestedTransactions->end();
return 0;
return nullptr;
}
const_reverse_nested_iterator rnested_begin() const {
if (hasNestedTransactions())
return m_NestedTransactions->rbegin();
return const_reverse_nested_iterator(0);
return const_reverse_nested_iterator(nullptr);
}
const_reverse_nested_iterator rnested_end() const {
if (hasNestedTransactions())
return m_NestedTransactions->rend();
return const_reverse_nested_iterator(0);
return const_reverse_nested_iterator(nullptr);
}
/// Macro iteration
@ -432,7 +432,7 @@ namespace cling {
Transaction* getLastNestedTransaction() const {
if (!hasNestedTransactions())
return 0;
return nullptr;
return m_NestedTransactions->back();
}

View File

@ -61,7 +61,7 @@ namespace cling {
///\param[out] transaction - Transaction containing the loaded file.
///
ActionResult actOnLCommand(llvm::StringRef file,
Transaction** transaction = 0);
Transaction** transaction = nullptr);
///\brief O command sets the optimization level.
///

View File

@ -77,9 +77,9 @@ namespace utils {
///\returns 0 if the operation wasn't successful.
///
clang::Expr* GetOrCreateLastExpr(clang::FunctionDecl* FD,
int* FoundAt = 0,
int* FoundAt = nullptr,
bool omitDeclStmts = true,
clang::Sema* S = 0);
clang::Sema* S = nullptr);
///\brief Return true if the class or template is declared directly in the
/// std namespace (modulo inline namespace).
@ -196,7 +196,7 @@ namespace utils {
///
clang::NamespaceDecl* Namespace(clang::Sema* S,
const char* Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a single named declaration in a given
/// declaration context.
@ -209,7 +209,7 @@ namespace utils {
///
clang::NamedDecl* Named(clang::Sema* S,
llvm::StringRef Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a single named declaration in a given
/// declaration context.
@ -222,7 +222,7 @@ namespace utils {
///
clang::NamedDecl* Named(clang::Sema* S,
const char* Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a single namespace declaration in a given
/// declaration context.
@ -236,7 +236,7 @@ namespace utils {
///
clang::NamedDecl* Named(clang::Sema* S,
const clang::DeclarationName& Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a single named tag declaration ( enums, classes,
/// structs, and unions) in a given declaration context.
@ -249,7 +249,7 @@ namespace utils {
///
clang::TagDecl* Tag(clang::Sema* S,
llvm::StringRef Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a single named tag declaration ( enums, classes,
/// structs, and unions) in a given declaration context.
@ -262,7 +262,7 @@ namespace utils {
///
clang::TagDecl* Tag(clang::Sema* S,
const char* Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a single named tag declaration ( enums, classes,
/// structs, and unions) in a given declaration context.
@ -275,7 +275,7 @@ namespace utils {
///
clang::TagDecl* Tag(clang::Sema* S,
const clang::DeclarationName& Name,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
///\brief Quick lookup for a name in possible a declaration context.
///
@ -289,7 +289,7 @@ namespace utils {
///\returns the found result if single, -1 if multiple or 0 if not found.
///
void Named(clang::Sema* S, clang::LookupResult& R,
const clang::DeclContext* Within = 0);
const clang::DeclContext* Within = nullptr);
}

View File

@ -46,7 +46,7 @@ namespace cling {
///\param[in] S - The semantic analysis object.
///
ASTTransformer(clang::Sema* S):
m_Sema(S), m_Consumer(0), m_Transaction(nullptr) {}
m_Sema(S), m_Consumer(nullptr), m_Transaction(nullptr) {}
virtual ~ASTTransformer();
///\brief Retrieves the semantic analysis object used for this transaction

View File

@ -23,7 +23,7 @@ namespace cling {
llvm::DenseSet<NamedDecl*> m_HandledDecls;
private:
public:
AutoFixer(Sema* S) : m_Sema(S), m_FoundDRE(0) {}
AutoFixer(Sema* S) : m_Sema(S), m_FoundDRE(nullptr) {}
CompoundStmt* Fix(CompoundStmt* CS) {
if (!CS->size())

View File

@ -308,7 +308,7 @@ namespace cling {
void ClangInternalState::printLLVMModule(llvm::raw_ostream& Out,
const llvm::Module& M,
CodeGenerator& CG) {
M.print(Out, /*AssemblyAnnotationWriter*/ 0);
M.print(Out, /*AssemblyAnnotationWriter*/ nullptr);
CG.print(Out);
}

View File

@ -220,7 +220,7 @@ namespace cling {
WrapperDC->addDecl(FD);
}
return hasNoErrors ? FD : 0;
return hasNoErrors ? FD != nullptr : false;
}
void DeclExtractor::createUniqueName(std::string& out) {
@ -342,7 +342,7 @@ namespace cling {
IdentifierInfo* Name = NewTD->getIdentifier();
// If this is not a definition, it must have a name.
assert((Name != 0 || NewTD->isThisDeclarationADefinition()) &&
assert((Name != nullptr || NewTD->isThisDeclarationADefinition()) &&
"Nameless record must be a definition!");
// Figure out the underlying type if this a enum declaration. We need to do
@ -369,7 +369,7 @@ namespace cling {
// integral type; any cv-qualification is ignored.
SourceLocation UnderlyingLoc;
TypeSourceInfo* TI = 0;
TypeSourceInfo* TI = nullptr;
if ((TI = ED->getIntegerTypeSourceInfo()))
UnderlyingLoc = TI->getTypeLoc().getBeginLoc();
@ -562,7 +562,7 @@ namespace cling {
Kind = PrevTagDecl->getTagKind();
else {
// Recover by making this an anonymous redefinition.
Name = 0;
Name = nullptr;
Previous.clear();
Invalid = true;
}
@ -624,7 +624,7 @@ namespace cling {
// If this is a redefinition, recover by making this
// struct be anonymous, which will make any later
// references get the previous definition.
Name = 0;
Name = nullptr;
Previous.clear();
Invalid = true;
}
@ -637,7 +637,7 @@ namespace cling {
m_Sema->Diag(NameLoc, diag::err_nested_redefinition) << Name;
m_Sema->Diag(PrevTagDecl->getLocation(),
diag::note_previous_definition);
Name = 0;
Name = nullptr;
Previous.clear();
Invalid = true;
}
@ -691,7 +691,7 @@ namespace cling {
// issue an error and recover by making this tag be anonymous.
m_Sema->Diag(NameLoc, diag::err_redefinition_different_kind) << Name;
m_Sema->Diag(PrevDecl->getLocation(), diag::note_previous_definition);
Name = 0;
Name = nullptr;
Invalid = true;
}

View File

@ -247,10 +247,10 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
for (Globals::iterator I = VisitedGlobals.begin(),
E = VisitedGlobals.end(); I != E; ++I)
if (GlobalVariable* GVar = dyn_cast<GlobalVariable>(*I)) {
GVar->setInitializer(0);
GVar->setInitializer(nullptr);
}
else if (GlobalAlias* GA = dyn_cast<GlobalAlias>(*I)) {
GA->setAliasee(0);
GA->setAliasee(nullptr);
}
else {
Function* F = cast<Function>(*I);
@ -454,7 +454,7 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
bool DeclUnloader::VisitDeclaratorDecl(DeclaratorDecl* DD) {
// VisitDeclaratorDecl: ValueDecl
auto found = std::find(m_Sema->UnusedFileScopedDecls.begin(/*ExtSource*/0,
auto found = std::find(m_Sema->UnusedFileScopedDecls.begin(/*ExtSource*/nullptr,
/*Local*/true),
m_Sema->UnusedFileScopedDecls.end(), DD);
if (found != m_Sema->UnusedFileScopedDecls.end())
@ -591,13 +591,13 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
This->getCommonPtr()->Specializations.clear();
//Readd the collected specializations.
void* InsertPos = 0;
FunctionTemplateSpecializationInfo* FTSI = 0;
void* InsertPos = nullptr;
FunctionTemplateSpecializationInfo* FTSI = nullptr;
for (size_t i = 0, e = specializations.size(); i < e; ++i) {
FTSI = specializations[i]->getTemplateSpecializationInfo();
assert(FTSI && "Must not be null.");
// Avoid assertion on add.
FTSI->SetNextInBucket(0);
FTSI->SetNextInBucket(nullptr);
This->addSpecialization(FTSI, InsertPos);
}
#ifndef NDEBUG
@ -735,7 +735,7 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
// Hopefully LSD->isExternCContext() means that it already does exist
ExternCContextDecl* ECD = m_Sema->Context.getExternCContextDecl();
StoredDeclsMap* Map = ECD ? ECD->getLookupPtr() : nullptr;
for (Decl* D : LSD->noload_decls()) {
if (NamedDecl* ND = dyn_cast<NamedDecl>(D)) {
@ -908,7 +908,7 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
const MacroInfo* MI = MD->getMacroInfo();
// If the macro is not defined, this is a noop undef, just return.
if (MI == 0)
if (!MI)
return false;
// Remove the pair from the macros
@ -982,13 +982,13 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
This->getCommonPtr()->Specializations.clear();
//Readd the collected specializations.
void* InsertPos = 0;
ClassTemplateSpecializationDecl* CTSD = 0;
void* InsertPos = nullptr;
ClassTemplateSpecializationDecl* CTSD = nullptr;
for (size_t i = 0, e = specializations.size(); i < e; ++i) {
CTSD = specializations[i];
assert(CTSD && "Must not be null.");
// Avoid assertion on add.
CTSD->SetNextInBucket(0);
CTSD->SetNextInBucket(nullptr);
This->AddSpecialization(CTSD, InsertPos);
}
}
@ -1018,13 +1018,13 @@ bool DeclUnloader::VisitRedeclarable(clang::Redeclarable<T>* R, DeclContext* DC)
This->getPartialSpecializations().clear();
//Readd the collected specializations.
void* InsertPos = 0;
ClassTemplatePartialSpecializationDecl* CTPSD = 0;
void* InsertPos = nullptr;
ClassTemplatePartialSpecializationDecl* CTPSD = nullptr;
for (size_t i = 0, e = specializations.size(); i < e; ++i) {
CTPSD = specializations[i];
assert(CTPSD && "Must not be null.");
// Avoid assertion on add.
CTPSD->SetNextInBucket(0);
CTPSD->SetNextInBucket(nullptr);
This->AddPartialSpecialization(CTPSD, InsertPos);
}
}

View File

@ -401,7 +401,7 @@ namespace cling {
if (!isLibraryLoaded(canonicalLoadedLib))
return;
DyLibHandle dyLibHandle = 0;
DyLibHandle dyLibHandle = nullptr;
for (DyLibs::const_iterator I = m_DyLibs.begin(), E = m_DyLibs.end();
I != E; ++I) {
if (I->second == canonicalLoadedLib) {

View File

@ -153,9 +153,9 @@ namespace cling {
// Constructors
EvaluateTSynthesizer::EvaluateTSynthesizer(Sema* S)
: ASTTransformer(S), m_EvalDecl(0), m_LifetimeHandlerDecl(0),
m_LHgetMemoryDecl(0), m_DynamicExprInfoDecl(0), m_DeclContextDecl(0),
m_gCling(0), m_CurDeclContext(0), m_Context(&S->getASTContext()),
: ASTTransformer(S), m_EvalDecl(nullptr), m_LifetimeHandlerDecl(nullptr),
m_LHgetMemoryDecl(nullptr), m_DynamicExprInfoDecl(nullptr), m_DeclContextDecl(nullptr),
m_gCling(nullptr), m_CurDeclContext(nullptr), m_Context(&S->getASTContext()),
m_UniqueNameCounter(0), m_NestedCompoundStmts(0)
{ }
@ -266,7 +266,7 @@ namespace cling {
D->dump();
if (NewBody.hasSingleNode())
NewBody.getAs<Expr>()->dump();
return Result(0, false); // Signal a fatal error.
return Result(nullptr, false); // Signal a fatal error.
}
FD->setBody(NewBody.getAsSingleNode());
}
@ -527,9 +527,9 @@ namespace cling {
/*IsArrow=*/false,
SS,
m_NoSLoc,
/*FirstQualifierInScope=*/0,
/*FirstQualifierInScope=*/nullptr,
MemberLookup,
/*TemplateArgs=*/0,
/*TemplateArgs=*/nullptr,
/*Scope*/nullptr).get();
// 3.3 Build the actual call
Scope* S = m_Sema->getScopeForContext(m_Sema->CurContext);
@ -719,7 +719,7 @@ namespace cling {
// 3. Build the array of addresses
QualType VarAddrTy = m_Sema->BuildArrayType(m_Context->VoidPtrTy,
ArrayType::Normal,
/*ArraySize*/0,
/*ArraySize*/nullptr,
/*IndexTypeQuals*/0,
m_NoRange,
DeclarationName() );
@ -734,7 +734,7 @@ namespace cling {
if (!UnOp) {
// Not good, return what we had.
cling::errs() << "Error while creating dynamic expression for:\n ";
SubTree->printPretty(cling::errs(), 0 /*PrinterHelper*/,
SubTree->printPretty(cling::errs(), nullptr /*PrinterHelper*/,
m_Context->getPrintingPolicy(), 2);
cling::errs() << "\n";
#ifndef NDEBUG
@ -768,7 +768,7 @@ namespace cling {
CK_ArrayToPointerDecay);
// Is the result of the expression to be printed or not
Expr* VPReq = 0;
Expr* VPReq = nullptr;
if (ValuePrinterReq)
VPReq = m_Sema->ActOnCXXBoolLiteral(m_NoSLoc, tok::kw_true).get();
else

View File

@ -217,9 +217,9 @@ namespace cling {
auto FE = PP.LookupFile(fileNameLoc, FileName, isAngled, FromDir,
FromFile,
CurDir, /*SearchPath*/ 0,
/*RelativePath*/ 0, /*suggestedModule*/ 0,
/*IsMapped*/ 0, /*IsFramework*/ nullptr,
CurDir, /*SearchPath*/ nullptr,
/*RelativePath*/ nullptr, /*suggestedModule*/ nullptr,
/*IsMapped*/ nullptr, /*IsFramework*/ nullptr,
/*SkipCache*/ false,
/*OpenFile*/ false, /*CacheFail*/ true);
// Return true if we can '#include' the given filename
@ -456,7 +456,7 @@ namespace cling {
}
if (const FunctionType *AFT = Ty->getAs<FunctionType>()) {
const FunctionProtoType *FT = 0;
const FunctionProtoType *FT = nullptr;
if (D->hasWrittenPrototype())
FT = dyn_cast<FunctionProtoType>(AFT);
@ -525,7 +525,7 @@ namespace cling {
if (isComputedNoexcept(FT->getExceptionSpecType())) {
Proto += "(";
llvm::raw_string_ostream EOut(Proto);
FT->getNoexceptExpr()->printPretty(EOut, 0, SubPolicy,
FT->getNoexceptExpr()->printPretty(EOut, nullptr, SubPolicy,
m_Indentation);
EOut.flush();
//Proto += EOut.str()
@ -570,8 +570,8 @@ namespace cling {
Init = Init->IgnoreParens();
Expr *SimpleInit = 0;
Expr **Args = 0;
Expr *SimpleInit = nullptr;
Expr **Args = nullptr;
unsigned NumArgs = 0;
if (ParenListExpr *ParenList = dyn_cast<ParenListExpr>(Init)) {
Args = ParenList->getExprs();
@ -584,7 +584,7 @@ namespace cling {
SimpleInit = Init;
if (SimpleInit)
SimpleInit->printPretty(Out(), 0, m_Policy, m_Indentation);
SimpleInit->printPretty(Out(), nullptr, m_Policy, m_Indentation);
else {
for (unsigned I = 0; I != NumArgs; ++I) {
if (isa<CXXDefaultArgExpr>(Args[I]))
@ -592,7 +592,7 @@ namespace cling {
if (I)
Out() << ", ";
Args[I]->printPretty(Out(), 0, m_Policy, m_Indentation);
Args[I]->printPretty(Out(), nullptr, m_Policy, m_Indentation);
}
}
}
@ -662,7 +662,7 @@ namespace cling {
if (D->isBitField()) {
Out() << " : ";
D->getBitWidth()->printPretty(Out(), 0, m_Policy, m_Indentation);
D->getBitWidth()->printPretty(Out(), nullptr, m_Policy, m_Indentation);
}
Expr *Init = D->getInClassInitializer();
@ -671,7 +671,7 @@ namespace cling {
Out() << " ";
else
Out() << " = ";
Init->printPretty(Out(), 0, m_Policy, m_Indentation);
Init->printPretty(Out(), nullptr, m_Policy, m_Indentation);
}
prettyPrintAttributes(D);
Out() << ';' << closeBraces << '\n';
@ -772,7 +772,7 @@ namespace cling {
}
}
if (! isEnumConst)
Init->printPretty(Out(), 0, m_Policy, m_Indentation);
Init->printPretty(Out(), nullptr, m_Policy, m_Indentation);
}
if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init))
@ -791,7 +791,7 @@ namespace cling {
std::string closeBraces = PrintEnclosingDeclContexts(Out(),
D->getDeclContext());
Out() << "__asm (";
D->getAsmString()->printPretty(Out(), 0, m_Policy, m_Indentation);
D->getAsmString()->printPretty(Out(), nullptr, m_Policy, m_Indentation);
Out() << ");" << closeBraces << '\n';
}
@ -804,9 +804,9 @@ namespace cling {
std::string closeBraces = PrintEnclosingDeclContexts(Out(),
D->getDeclContext());
Out() << "static_assert(";
D->getAssertExpr()->printPretty(Out(), 0, m_Policy, m_Indentation);
D->getAssertExpr()->printPretty(Out(), nullptr, m_Policy, m_Indentation);
Out() << ", ";
D->getMessage()->printPretty(Out(), 0, m_Policy, m_Indentation);
D->getMessage()->printPretty(Out(), nullptr, m_Policy, m_Indentation);
Out() << ");" << closeBraces << '\n';
}
@ -941,7 +941,7 @@ namespace cling {
= utils::TypeName::GetFullyQualifiedType(ArgQT, m_Ctx);
Visit(ArgFQQT);
if (m_SkipFlag) {
skipDecl(0, "type template param default failed");
skipDecl(nullptr, "type template param default failed");
return;
}
Stream << " = ";
@ -964,7 +964,7 @@ namespace cling {
if (DeclRefExpr* DRE = dyn_cast<DeclRefExpr>(DefArg)) {
Visit(DRE->getFoundDecl());
if (m_SkipFlag) {
skipDecl(0, "expression template param default failed");
skipDecl(nullptr, "expression template param default failed");
return;
}
} else if (isa<IntegerLiteral>(DefArg)
@ -974,9 +974,9 @@ namespace cling {
|| isa<FloatingLiteral>(DefArg)
|| isa<StringLiteral>(DefArg)) {
Stream << " = ";
DefArg->printPretty(Stream, 0, m_Policy, m_Indentation);
DefArg->printPretty(Stream, nullptr, m_Policy, m_Indentation);
} else {
skipDecl(0, "expression template param default not a literal");
skipDecl(nullptr, "expression template param default not a literal");
return;
}
}
@ -1013,7 +1013,7 @@ namespace cling {
PrintTemplateParameters(Stream, D->getTemplateParameters());
if (m_SkipFlag) {
skipDecl(0, "Template parameters failed");
skipDecl(nullptr, "Template parameters failed");
return;
}
@ -1302,12 +1302,12 @@ namespace cling {
case clang::NestedNameSpecifier::TypeSpec: // fall-through:
case clang::NestedNameSpecifier::TypeSpecWithTemplate:
// We cannot fwd declare nested types.
skipDecl(0, "NestedNameSpec TypeSpec/TypeSpecWithTemplate");
skipDecl(nullptr, "NestedNameSpec TypeSpec/TypeSpecWithTemplate");
break;
default:
Log() << "VisitNestedNameSpecifier: Unexpected kind "
<< NNS->getKind() << '\n';
skipDecl(0, 0);
skipDecl(nullptr, nullptr);
break;
};
}
@ -1332,7 +1332,7 @@ namespace cling {
//Implement that if important functions are marked so.
//Not important, as users do not need hints
//about using Deleted functions
if (D->getIdentifier() == 0
if (D->getIdentifier() == nullptr
|| D->getNameAsString()[0] == '_'
|| D->getStorageClass() == SC_Static
|| D->isCXXClassMember()
@ -1438,7 +1438,7 @@ namespace cling {
for(; DC && !DC->isTranslationUnit(); DC = DC->getParent()) {
if (!isa<NamespaceDecl>(DC) && !isa<LinkageSpecDecl>(DC)) {
Log() << "Skipping unhandled " << DC->getDeclKindName() << '\n';
skipDecl(0, 0);
skipDecl(nullptr, nullptr);
return "";
}
DeclCtxs.push_back(DC);

View File

@ -166,7 +166,7 @@ namespace cling {
void PrintTemplateParameters(llvm::raw_ostream& Stream,
clang::TemplateParameterList *Params,
const clang::TemplateArgumentList *Args = 0);
const clang::TemplateArgumentList *Args = nullptr);
void prettyPrintAttributes(clang::Decl *D);
bool isOperator(clang::FunctionDecl* D);
@ -270,7 +270,7 @@ namespace cling {
largestream m_Stream;
bool m_HavePopped;
public:
StreamRAII(ForwardDeclPrinter& pr, clang::PrintingPolicy* pol = 0):
StreamRAII(ForwardDeclPrinter& pr, clang::PrintingPolicy* pol = nullptr):
m_pr(pr), m_oldPol(pr.m_Policy), m_HavePopped(false) {
m_pr.m_StreamStack.push(&static_cast<llvm::raw_ostream&>(m_Stream));
if (pol)

View File

@ -277,7 +277,7 @@ IncrementalExecutor::getPointerToGlobalFromJIT(llvm::StringRef name) const {
void* addr = m_JIT->getSymbolAddress(name, false /*no dlsym*/);
if (diagnoseUnresolvedSymbols(name, "symbol"))
return 0;
return nullptr;
return addr;
}

View File

@ -183,7 +183,7 @@ namespace cling {
///\brief Runs a wrapper function.
ExecutionResult executeWrapper(llvm::StringRef function,
Value* returnValue = 0) const;
Value* returnValue = nullptr) const;
///\brief Replaces a symbol (function) to the execution engine.
///
/// Allows runtime declaration of a function passing its pointer for being
@ -216,7 +216,7 @@ namespace cling {
///\param[out] fromJIT - whether the symbol was JITted.
///
void*
getAddressOfGlobal(llvm::StringRef mangledName, bool* fromJIT = 0) const;
getAddressOfGlobal(llvm::StringRef mangledName, bool *fromJIT = nullptr) const;
///\brief Return the address of a global from the JIT (as
/// opposed to dynamic libraries). Forces the emission of the symbol if

View File

@ -360,7 +360,7 @@ namespace cling {
m_CI->createPCHExternalASTSource(PCHFileName,
DisableValidationForModuleKind::All,
true /*AllowPCHWithCompilerErrors*/,
0 /*DeserializationListener*/,
nullptr /*DeserializationListener*/,
true /*OwnsDeserializationListener*/);
result.push_back(endTransaction(PchT));
if (Trap.hasErrorOccurred()) {
@ -766,13 +766,13 @@ namespace cling {
if (Transaction* Parent = T.getParent()) {
Parent->removeNestedTransaction(&T);
T.setParent(0);
T.setParent(nullptr);
} else {
if (&T == m_Transactions.back()) {
// Remove from the queue
m_Transactions.pop_back();
if (!m_Transactions.empty())
m_Transactions.back()->setNext(0);
m_Transactions.back()->setNext(nullptr);
} else {
// If T is not the last transaction it must not be a previous
// transaction either, but a "disconnected" one, i.e. one that
@ -865,7 +865,7 @@ namespace cling {
Preprocessor& PP = m_CI->getPreprocessor();
if (!PP.getCurrentLexer()) {
PP.EnterSourceFile(m_CI->getSourceManager().getMainFileID(),
0, SourceLocation());
nullptr, SourceLocation());
}
assert(PP.isIncrementalProcessingEnabled() && "Not in incremental mode!?");
PP.enableIncrementalProcessing();
@ -910,7 +910,7 @@ namespace cling {
m_MemoryBuffers.push_back(std::make_pair(MBNonOwn, FID));
// NewLoc only used for diags.
PP.EnterSourceFile(FID, /*DirLookup*/0, NewLoc);
PP.EnterSourceFile(FID, /*DirLookup*/nullptr, NewLoc);
m_Consumer->getTransaction()->setBufferFID(FID);
DiagnosticsEngine& Diags = getCI()->getDiagnostics();

View File

@ -174,7 +174,7 @@ namespace cling {
///
const Transaction* getFirstTransaction() const {
if (m_Transactions.empty())
return 0;
return nullptr;
return m_Transactions.front();
}
@ -182,7 +182,7 @@ namespace cling {
///
Transaction* getLastTransaction() {
if (m_Transactions.empty())
return 0;
return nullptr;
return m_Transactions.back();
}
@ -190,7 +190,7 @@ namespace cling {
///
const Transaction* getLastTransaction() const {
if (m_Transactions.empty())
return 0;
return nullptr;
return m_Transactions.back();
}

View File

@ -399,7 +399,7 @@ namespace cling {
// and the ASTContext. For that to happen we shut down the IncrementalParser
// explicitly, before the implicit destruction (through the unique_ptr) of
// the callbacks.
m_IncrParser.reset(0);
m_IncrParser.reset(nullptr);
}
Transaction* Interpreter::Initialize(bool NoRuntime, bool SyntaxOnly,
@ -1267,7 +1267,7 @@ namespace cling {
clang::diag::Severity::Warning, SourceLocation());
if (CR != cling::Interpreter::kSuccess)
return 0;
return nullptr;
for (cling::Transaction::const_iterator I = T->decls_begin(),
E = T->decls_end(); I != E; ++I) {
@ -1285,7 +1285,7 @@ namespace cling {
}
}
}
return 0;
return nullptr;
}
void*
@ -1296,7 +1296,7 @@ namespace cling {
//
if (isInSyntaxOnlyMode())
return 0;
return nullptr;
if (ifUnique) {
if (void* Addr = (void*)getAddressOfGlobal(name)) {
@ -1307,7 +1307,7 @@ namespace cling {
Transaction* T = nullptr;
const FunctionDecl* FD = DeclareCFunction(name, code, withAccessControl, T);
if (!FD || !T)
return 0;
return nullptr;
// Get the wrapper function pointer from the ExecutionEngine (the JIT).
return m_Executor->getPointerToGlobalFromJIT(name);
@ -1440,16 +1440,16 @@ namespace cling {
// Clang doc says:
// "LookupFrom is set when this is a \#include_next directive, it
// specifies the file to start searching from."
const DirectoryLookup* FromDir = 0;
const FileEntry* FromFile = 0;
const DirectoryLookup* CurDir = 0;
const DirectoryLookup* FromDir = nullptr;
const FileEntry* FromFile = nullptr;
const DirectoryLookup* CurDir = nullptr;
Preprocessor& PP = getCI()->getPreprocessor();
// PP::LookupFile uses it to issue 'nice' diagnostic
SourceLocation fileNameLoc;
auto FE = PP.LookupFile(fileNameLoc, canonicalFile, isAngled, FromDir,
FromFile, CurDir, /*SearchPath*/0,
/*RelativePath*/ 0, /*suggestedModule*/0,
0 /*IsMapped*/, /*IsFrameworkFound*/ nullptr,
FromFile, CurDir, /*SearchPath*/nullptr,
/*RelativePath*/ nullptr, /*suggestedModule*/nullptr,
/*IsMapped*/ nullptr, /*IsFrameworkFound*/ nullptr,
/*SkipCache*/ false, /*OpenFile*/ false,
/*CacheFail*/ false);
if (FE)
@ -1748,7 +1748,7 @@ namespace cling {
bool* fromJIT /*=0*/) const {
// Return a symbol's address, and whether it was jitted.
if (isInSyntaxOnlyMode())
return 0;
return nullptr;
return m_Executor->getAddressOfGlobal(SymName, fromJIT);
}

View File

@ -232,7 +232,7 @@ namespace cling {
public:
InterpreterExternalSemaSource(InterpreterCallbacks* C)
: m_Callbacks(C), m_Sema(0) {}
: m_Callbacks(C), m_Sema(nullptr) {}
~InterpreterExternalSemaSource() {
// FIXME: Another gross hack due to the missing multiplexing AST external
@ -250,7 +250,7 @@ namespace cling {
}
void ForgetSema() override {
m_Sema = 0;
m_Sema = nullptr;
}
InterpreterCallbacks* getCallbacks() const { return m_Callbacks; }
@ -297,7 +297,7 @@ namespace cling {
bool enableExternalSemaSourceCallbacks/* = false*/,
bool enableDeserializationListenerCallbacks/* = false*/,
bool enablePPCallbacks/* = false*/)
: m_Interpreter(interp), m_ExternalSemaSource(0), m_PPCallbacks(0),
: m_Interpreter(interp), m_ExternalSemaSource(nullptr), m_PPCallbacks(nullptr),
m_IsRuntime(false) {
Sema& SemaRef = interp->getSema();
ASTReader* Reader = m_Interpreter->getCI()->getASTReader().get();

View File

@ -71,7 +71,7 @@ bool HasUDT(const Decl* decl)
//______________________________________________________________________________
int NumberOfElements(const ArrayType* type)
{
assert(type != 0 && "NumberOfElements, 'type' parameter is null");
assert(type != nullptr && "NumberOfElements, 'type' parameter is null");
if (const ConstantArrayType* const arrayType = dyn_cast<ConstantArrayType>(type)) {
//We can calculate only the size of constant size array.
@ -98,7 +98,7 @@ static void AppendAnyDeclLocation(const CompilerInstance* compiler,
const char* formatNull,
const char* filenameNull)
{
assert(compiler != 0 && "AppendAnyDeclLocation, 'compiler' parameter is null");
assert(compiler != nullptr && "AppendAnyDeclLocation, 'compiler' parameter is null");
llvm::raw_string_ostream rss(textLine);
llvm::formatted_raw_ostream frss(rss);
@ -130,7 +130,7 @@ static void AppendAnyDeclLocation(const CompilerInstance* compiler,
void AppendClassDeclLocation(const CompilerInstance* compiler, const CXXRecordDecl* classDecl,
std::string& textLine, bool verbose)
{
assert(classDecl != 0 && "AppendClassDeclLocation, 'classDecl' parameter is null");
assert(classDecl != nullptr && "AppendClassDeclLocation, 'classDecl' parameter is null");
//Location has a fixed format - from G__display_class.
static const char* formatShort = "%-25s%5d";
@ -148,8 +148,8 @@ void AppendMemberFunctionLocation(const CompilerInstance* compiler, const Decl*
{
//Location has a fixed format - from G__display_class.
assert(compiler != 0 && "AppendMemberFunctionLocation, 'compiler' parameter is null");
assert(decl != 0 && "AppendMemberFunctionLocation, 'decl' parameter is null");
assert(compiler != nullptr && "AppendMemberFunctionLocation, 'compiler' parameter is null");
assert(decl != nullptr && "AppendMemberFunctionLocation, 'decl' parameter is null");
llvm::raw_string_ostream rss(textLine);
llvm::formatted_raw_ostream frss(rss);
@ -171,7 +171,7 @@ void AppendDeclLocation(const CompilerInstance* compiler, const Decl* decl,
void AppendMacroLocation(const CompilerInstance* compiler, const MacroInfo* macroInfo,
std::string& textLine)
{
assert(macroInfo != 0 && "AppendMacroLocation, 'macroInfo' parameter is null");
assert(macroInfo != nullptr && "AppendMacroLocation, 'macroInfo' parameter is null");
//TODO: check what does location for macro definition really means -
//macro can be defined many times, what do we have in a TranslationUnit in this case?
@ -184,7 +184,7 @@ void AppendMacroLocation(const CompilerInstance* compiler, const MacroInfo* macr
//______________________________________________________________________________
void AppendClassKeyword(const CXXRecordDecl* classDecl, std::string& name)
{
assert(classDecl != 0 && "AppendClassKeyword, 'classDecl' parameter is null");
assert(classDecl != nullptr && "AppendClassKeyword, 'classDecl' parameter is null");
name += classDecl->getKindName();
name += ' ';
@ -193,7 +193,7 @@ void AppendClassKeyword(const CXXRecordDecl* classDecl, std::string& name)
//______________________________________________________________________________
void AppendClassName(const CXXRecordDecl* classDecl, std::string& name)
{
assert(classDecl != 0 && "AppendClassName, 'classDecl' parameter is null");
assert(classDecl != nullptr && "AppendClassName, 'classDecl' parameter is null");
const LangOptions langOpts;
PrintingPolicy printingPolicy(langOpts);
@ -211,7 +211,7 @@ void AppendClassName(const CXXRecordDecl* classDecl, std::string& name)
//______________________________________________________________________________
void AppendMemberAccessSpecifier(const Decl* memberDecl, std::string& name)
{
assert(memberDecl != 0 && "AppendMemberAccessSpecifier, 'memberDecl' parameter is 0");
assert(memberDecl != nullptr && "AppendMemberAccessSpecifier, 'memberDecl' parameter is 0");
switch (memberDecl->getAccess()) {
case AS_private:
@ -229,7 +229,7 @@ void AppendMemberAccessSpecifier(const Decl* memberDecl, std::string& name)
//______________________________________________________________________________
void AppendConstructorSignature(const CXXConstructorDecl* ctorDecl, std::string& name)
{
assert(ctorDecl != 0 && "AppendConstructorSignature, 'ctorDecl' parameter is null");
assert(ctorDecl != nullptr && "AppendConstructorSignature, 'ctorDecl' parameter is null");
const QualType type = ctorDecl->getType();
assert(isa<FunctionType>(type) == true && "AppendConstructorSignature, ctorDecl->getType is not a FunctionType");
@ -272,7 +272,7 @@ void AppendConstructorSignature(const CXXConstructorDecl* ctorDecl, std::string&
//______________________________________________________________________________
void AppendMemberFunctionSignature(const Decl* methodDecl, std::string& name)
{
assert(methodDecl != 0 && "AppendMemberFunctionSignature, 'methodDecl' parameter is null");
assert(methodDecl != nullptr && "AppendMemberFunctionSignature, 'methodDecl' parameter is null");
assert(methodDecl->getKind() != Decl::CXXConstructor && "AppendMemberFunctionSignature, called for a ctor declaration");
llvm::raw_string_ostream out(name);
@ -289,7 +289,7 @@ void AppendMemberFunctionSignature(const Decl* methodDecl, std::string& name)
void AppendObjectDeclaration(const Decl* objDecl, const PrintingPolicy& policy,
bool printInstantiation, std::string& name)
{
assert(objDecl != 0 && "AppendObjectDeclaration, 'objDecl' parameter is null");
assert(objDecl != nullptr && "AppendObjectDeclaration, 'objDecl' parameter is null");
llvm::raw_string_ostream out(name);
objDecl->print(out, policy, 0, printInstantiation);
@ -318,8 +318,8 @@ void AppendBaseClassSpecifiers(base_decl_iterator base, std::string& textLine)
void AppendClassSize(const CompilerInstance* compiler, const RecordDecl* decl,
std::string& textLine)
{
assert(compiler != 0 && "AppendClassSize, 'compiler' parameter is null");
assert(decl != 0 && "AppendClassSize, 'decl' parameter is null");
assert(compiler != nullptr && "AppendClassSize, 'compiler' parameter is null");
assert(decl != nullptr && "AppendClassSize, 'decl' parameter is null");
if (dyn_cast<ClassTemplatePartialSpecializationDecl>(decl)) {
textLine += "SIZE: (NA)";
@ -337,8 +337,8 @@ void AppendClassSize(const CompilerInstance* compiler, const RecordDecl* decl,
template<class Decl>
void AppendUDTSize(const CompilerInstance* compiler, const Decl* decl, std::string& textLine)
{
assert(compiler != 0 && "AppendUDTSize, 'compiler' parameter is null");
assert(decl != 0 && "AppendUDTSize, 'decl' parameter is null");
assert(compiler != nullptr && "AppendUDTSize, 'compiler' parameter is null");
assert(decl != nullptr && "AppendUDTSize, 'decl' parameter is null");
std::string formatted;
@ -372,9 +372,9 @@ void AppendUDTSize(const CompilerInstance* compiler, const Decl* decl, std::stri
void AppendBaseClassOffset(const CompilerInstance* compiler, const CXXRecordDecl* completeClass,
const CXXRecordDecl* baseClass, bool isVirtual, std::string& textLine)
{
assert(compiler != 0 && "AppendBaseClassOffset, 'compiler' parameter is null");
assert(completeClass != 0 && "AppendBaseClassOffset, 'completeClass' parameter is null");
assert(baseClass != 0 && "AppendBaseClassOffset, 'baseClass' parameter is null");
assert(compiler != nullptr && "AppendBaseClassOffset, 'compiler' parameter is null");
assert(completeClass != nullptr && "AppendBaseClassOffset, 'completeClass' parameter is null");
assert(baseClass != nullptr && "AppendBaseClassOffset, 'baseClass' parameter is null");
const ASTRecordLayout& layout = compiler->getASTContext().getASTRecordLayout(completeClass);
@ -391,9 +391,9 @@ void AppendBaseClassOffset(const CompilerInstance* compiler, const CXXRecordDecl
void AppendDataMemberOffset(const CompilerInstance* compiler, const CXXRecordDecl* classDecl,
const FieldDecl* fieldDecl, std::string& textLine)
{
assert(compiler != 0 && "AppendDataMemberOffset, 'compiler' parameter is null");
assert(classDecl != 0 && "AppendDataMemberOffset, 'classDecl' parameter is null");
assert(fieldDecl != 0 && "AppendDataMemberOffset, 'fieldDecl' parameter is null");
assert(compiler != nullptr && "AppendDataMemberOffset, 'compiler' parameter is null");
assert(classDecl != nullptr && "AppendDataMemberOffset, 'classDecl' parameter is null");
assert(fieldDecl != nullptr && "AppendDataMemberOffset, 'fieldDecl' parameter is null");
const ASTRecordLayout& layout = compiler->getASTContext().getASTRecordLayout(classDecl);
@ -428,7 +428,7 @@ FILEPrintHelper::FILEPrintHelper(llvm::raw_ostream& stream)
//______________________________________________________________________________
void FILEPrintHelper::Print(const char* msg)const
{
assert(msg != 0 && "Print, 'msg' parameter is null");
assert(msg != nullptr && "Print, 'msg' parameter is null");
// We want to keep stdout and fStream in sync if fStream is different.
fflush(stdout);
fStream << msg;
@ -471,7 +471,7 @@ private:
void ProcessTypeOfMember(const Decl* decl, unsigned nSpaces)const
{
//Extract the type of declaration and process it.
assert(decl != 0 && "ProcessTypeOfMember, 'decl' parameter is null");
assert(decl != nullptr && "ProcessTypeOfMember, 'decl' parameter is null");
if (const ArrayType* const arrayType = decl->getType()->getAsArrayTypeUnsafe()) {
if (const Type* const elType = arrayType->getBaseElementTypeUnsafe()) {
@ -510,7 +510,7 @@ ClassPrinter::ClassPrinter(llvm::raw_ostream& stream, const cling::Interpreter*
fInterpreter(interpreter),
fVerbose(false)
{
assert(interpreter != 0 && "ClassPrinter, 'compiler' parameter is null");
assert(interpreter != nullptr && "ClassPrinter, 'compiler' parameter is null");
}
@ -518,13 +518,13 @@ ClassPrinter::ClassPrinter(llvm::raw_ostream& stream, const cling::Interpreter*
void ClassPrinter::DisplayAllClasses()const
{
//Just in case asserts were deleted from ctor:
assert(fInterpreter != 0 && "DisplayAllClasses, fCompiler is null");
assert(fInterpreter != nullptr && "DisplayAllClasses, fCompiler is null");
const CompilerInstance* const compiler = fInterpreter->getCI();
assert(compiler != 0 && "DisplayAllClasses, compiler instance is null");
assert(compiler != nullptr && "DisplayAllClasses, compiler instance is null");
const TranslationUnitDecl* const tuDecl = compiler->getASTContext().getTranslationUnitDecl();
assert(tuDecl != 0 && "DisplayAllClasses, translation unit is empty");
assert(tuDecl != nullptr && "DisplayAllClasses, translation unit is empty");
fOut.Print("List of classes\n");
// Could trigger deserialization of decls.
@ -565,8 +565,8 @@ void ClassPrinter::SetVerbose(bool verbose)
void ClassPrinter::ProcessDecl(decl_iterator decl)const
{
//Just in case asserts were deleted from ctor:
assert(fInterpreter != 0 && "ProcessDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessDecl, 'decl' parameter is not a valid iterator");
switch (decl->getKind()) {
case Decl::Namespace:
@ -605,14 +605,14 @@ void ClassPrinter::ProcessDecl(decl_iterator decl)const
void ClassPrinter::ProcessBlockDecl(decl_iterator decl)const
{
//Just in case asserts were deleted from ctor:
assert(fInterpreter != 0 && "ProcessBlockDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessBlockDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessBlockDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessBlockDecl, 'decl' parameter is not a valid iterator");
assert(decl->getKind() == Decl::Block && "ProcessBlockDecl, decl->getKind() != BlockDecl");
//Block can contain nested (arbitrary deep) class declarations.
//Though, I'm not sure if have block in our code.
const BlockDecl* const blockDecl = dyn_cast<BlockDecl>(*decl);
assert(blockDecl != 0 && "ProcessBlockDecl, internal error - decl is not a BlockDecl");
assert(blockDecl != nullptr && "ProcessBlockDecl, internal error - decl is not a BlockDecl");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
@ -624,12 +624,12 @@ void ClassPrinter::ProcessBlockDecl(decl_iterator decl)const
void ClassPrinter::ProcessFunctionDecl(decl_iterator decl)const
{
//Just in case asserts were deleted from ctor:
assert(fInterpreter != 0 && "ProcessFunctionDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessFunctionDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessFunctionDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessFunctionDecl, 'decl' parameter is not a valid iterator");
//Function can contain class declarations, we have to check this.
const FunctionDecl* const functionDecl = dyn_cast<FunctionDecl>(*decl);
assert(functionDecl != 0 && "ProcessFunctionDecl, internal error - decl is not a FunctionDecl");
assert(functionDecl != nullptr && "ProcessFunctionDecl, internal error - decl is not a FunctionDecl");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
@ -641,13 +641,13 @@ void ClassPrinter::ProcessFunctionDecl(decl_iterator decl)const
void ClassPrinter::ProcessNamespaceDecl(decl_iterator decl)const
{
//Just in case asserts were deleted from ctor:
assert(fInterpreter != 0 && "ProcessNamespaceDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessNamespaceDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessNamespaceDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessNamespaceDecl, 'decl' parameter is not a valid iterator");
assert(decl->getKind() == Decl::Namespace && "ProcessNamespaceDecl, decl->getKind() != Namespace");
//Namespace can contain nested (arbitrary deep) class declarations.
const NamespaceDecl* const namespaceDecl = dyn_cast<NamespaceDecl>(*decl);
assert(namespaceDecl != 0 && "ProcessNamespaceDecl, 'decl' parameter is not a NamespaceDecl");
assert(namespaceDecl != nullptr && "ProcessNamespaceDecl, 'decl' parameter is not a NamespaceDecl");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
@ -659,11 +659,11 @@ void ClassPrinter::ProcessNamespaceDecl(decl_iterator decl)const
void ClassPrinter::ProcessLinkageSpecDecl(decl_iterator decl)const
{
//Just in case asserts were deleted from ctor:
assert(fInterpreter != 0 && "ProcessLinkageSpecDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessLinkageSpecDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessLinkageSpecDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessLinkageSpecDecl, 'decl' parameter is not a valid iterator");
const LinkageSpecDecl* const linkageSpec = dyn_cast<LinkageSpecDecl>(*decl);
assert(linkageSpec != 0 && "ProcessLinkageSpecDecl, decl is not a LinkageSpecDecl");
assert(linkageSpec != nullptr && "ProcessLinkageSpecDecl, decl is not a LinkageSpecDecl");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
@ -674,11 +674,11 @@ void ClassPrinter::ProcessLinkageSpecDecl(decl_iterator decl)const
//______________________________________________________________________________
void ClassPrinter::ProcessClassDecl(decl_iterator decl) const
{
assert(fInterpreter != 0 && "ProcessClassDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessClassDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessClassDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessClassDecl, 'decl' parameter is not a valid iterator");
const CXXRecordDecl* const classDecl = dyn_cast<CXXRecordDecl>(*decl);
assert(classDecl != 0 && "ProcessClassDecl, internal error, declaration is not a CXXRecordDecl");
assert(classDecl != nullptr && "ProcessClassDecl, internal error, declaration is not a CXXRecordDecl");
if (!classDecl->hasDefinition()) {
DisplayClassFwdDecl(classDecl);
@ -698,11 +698,11 @@ void ClassPrinter::ProcessClassDecl(decl_iterator decl) const
//______________________________________________________________________________
void ClassPrinter::ProcessClassTemplateDecl(decl_iterator decl)const
{
assert(fInterpreter != 0 && "ProcessClassDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessClassDecl, 'decl' parameter is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessClassDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessClassDecl, 'decl' parameter is not a valid iterator");
ClassTemplateDecl *templateDecl = dyn_cast<ClassTemplateDecl>(*decl);
assert(templateDecl != 0 && "ProcessClassTemplateDecl, internal error, declaration is not a ClassTemplateDecl");
assert(templateDecl != nullptr && "ProcessClassTemplateDecl, internal error, declaration is not a ClassTemplateDecl");
templateDecl = templateDecl->getCanonicalDecl();
@ -720,14 +720,14 @@ void ClassPrinter::ProcessClassTemplateDecl(decl_iterator decl)const
//______________________________________________________________________________
void ClassPrinter::DisplayClassDecl(const CXXRecordDecl* classDecl)const
{
assert(classDecl != 0 && "DisplayClassDecl, 'classDecl' parameter is null");
assert(fInterpreter != 0 && "DisplayClassDecl, fInterpreter is null");
assert(classDecl != nullptr && "DisplayClassDecl, 'classDecl' parameter is null");
assert(fInterpreter != nullptr && "DisplayClassDecl, fInterpreter is null");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
classDecl = classDecl->getDefinition();
assert(classDecl != 0 && "DisplayClassDecl, invalid decl - no definition");
assert(classDecl != nullptr && "DisplayClassDecl, invalid decl - no definition");
if (fSeenDecls.find(classDecl) != fSeenDecls.end())
return;
@ -787,8 +787,8 @@ void ClassPrinter::DisplayClassDecl(const CXXRecordDecl* classDecl)const
//______________________________________________________________________________
void ClassPrinter::DisplayClassFwdDecl(const CXXRecordDecl* classDecl)const
{
assert(classDecl != 0 && "DisplayClassDecl, 'classDecl' parameter is null");
assert(fInterpreter != 0 && "DisplayClassDecl, fInterpreter is null");
assert(classDecl != nullptr && "DisplayClassDecl, 'classDecl' parameter is null");
assert(fInterpreter != nullptr && "DisplayClassDecl, fInterpreter is null");
if (classDecl->isImplicit() || fSeenDecls.find(classDecl) != fSeenDecls.end())
return;
@ -830,8 +830,8 @@ void ClassPrinter::DisplayClassFwdDecl(const CXXRecordDecl* classDecl)const
//______________________________________________________________________________
void ClassPrinter::DisplayBasesAsList(const CXXRecordDecl* classDecl)const
{
assert(fInterpreter != 0 && "DisplayBasesAsList, fInterpreter is null");
assert(classDecl != 0 && "DisplayBasesAsList, 'classDecl' parameter is 0");
assert(fInterpreter != nullptr && "DisplayBasesAsList, fInterpreter is null");
assert(classDecl != nullptr && "DisplayBasesAsList, 'classDecl' parameter is 0");
assert(classDecl->hasDefinition() == true && "DisplayBasesAsList, 'classDecl' is invalid");
assert(fVerbose == false && "DisplayBasesAsList, called in a verbose output");
@ -863,10 +863,10 @@ void ClassPrinter::DisplayBasesAsList(const CXXRecordDecl* classDecl)const
//______________________________________________________________________________
void ClassPrinter::DisplayBasesAsTree(const CXXRecordDecl* classDecl, unsigned nSpaces)const
{
assert(classDecl != 0 && "DisplayBasesAsTree, 'classDecl' parameter is null");
assert(classDecl != nullptr && "DisplayBasesAsTree, 'classDecl' parameter is null");
assert(classDecl->hasDefinition() == true && "DisplayBasesAsTree, 'classDecl' is invalid");
assert(fInterpreter != 0 && "DisplayBasesAsTree, fInterpreter is null");
assert(fInterpreter != nullptr && "DisplayBasesAsTree, fInterpreter is null");
assert(fVerbose == true && "DisplayBasesAsTree, call in a simplified output");
std::string textLine;
@ -901,7 +901,7 @@ void ClassPrinter::DisplayBasesAsTree(const CXXRecordDecl* classDecl, unsigned n
//______________________________________________________________________________
void ClassPrinter::DisplayMemberFunctions(const CXXRecordDecl* classDecl)const
{
assert(classDecl != 0 && "DisplayMemberFunctions, 'classDecl' parameter is null");
assert(classDecl != nullptr && "DisplayMemberFunctions, 'classDecl' parameter is null");
typedef CXXRecordDecl::method_iterator method_iterator;
typedef CXXRecordDecl::ctor_iterator ctor_iterator;
@ -946,7 +946,7 @@ void ClassPrinter::DisplayMemberFunctions(const CXXRecordDecl* classDecl)const
for (decl_iterator decl = classDecl->decls_begin(); decl != classDecl->decls_end(); ++decl) {
if (decl->getKind() == Decl::FunctionTemplate) {
const FunctionTemplateDecl* const ftDecl = dyn_cast<FunctionTemplateDecl>(*decl);
assert(ftDecl != 0 && "DisplayMemberFunctions, decl is not a function template");
assert(ftDecl != nullptr && "DisplayMemberFunctions, decl is not a function template");
textLine.clear();
AppendMemberFunctionLocation(fInterpreter->getCI(), *decl, textLine);
@ -975,7 +975,7 @@ void ClassPrinter::DisplayMemberFunctions(const CXXRecordDecl* classDecl)const
//______________________________________________________________________________
void ClassPrinter::DisplayDataMembers(const CXXRecordDecl* classDecl, unsigned nSpaces)const
{
assert(classDecl != 0 && "DisplayDataMembers, 'classDecl' parameter is null");
assert(classDecl != nullptr && "DisplayDataMembers, 'classDecl' parameter is null");
typedef RecordDecl::field_iterator field_iterator;
typedef EnumDecl::enumerator_iterator enumerator_iterator;
@ -1018,7 +1018,7 @@ void ClassPrinter::DisplayDataMembers(const CXXRecordDecl* classDecl, unsigned n
for (decl_iterator decl = classDecl->decls_begin(); decl != classDecl->decls_end(); ++decl) {
if (decl->getKind() == Decl::Enum) {
const EnumDecl* enumDecl = dyn_cast<EnumDecl>(*decl);
assert(enumDecl != 0 && "DisplayDataMembers, decl->getKind() == Enum, but decl is not a EnumDecl");
assert(enumDecl != nullptr && "DisplayDataMembers, decl->getKind() == Enum, but decl is not a EnumDecl");
//it's not really clear, if I should really check this.
if (enumDecl->isComplete() && (enumDecl = enumDecl->getDefinition())) {
//if (fSeenDecls.find(enumDecl) == fSeenDecls.end()) {
@ -1053,7 +1053,7 @@ void ClassPrinter::DisplayDataMembers(const CXXRecordDecl* classDecl, unsigned n
}
} else if (decl->getKind() == Decl::Var) {
const VarDecl* const varDecl = dyn_cast<VarDecl>(*decl);
assert(varDecl != 0 && "DisplayDataMembers, decl->getKind() == Var, but decl is not a VarDecl");
assert(varDecl != nullptr && "DisplayDataMembers, decl->getKind() == Var, but decl is not a VarDecl");
if (varDecl->getStorageClass() == SC_Static) {
//I hope, this is a static data-member :)
textLine.clear();
@ -1106,7 +1106,7 @@ GlobalsPrinter::GlobalsPrinter(llvm::raw_ostream& stream, const cling::Interpret
: fOut(stream),
fInterpreter(interpreter)
{
assert(interpreter != 0 && "GlobalsPrinter, 'compiler' parameter is null");
assert(interpreter != nullptr && "GlobalsPrinter, 'compiler' parameter is null");
}
//______________________________________________________________________________
@ -1138,13 +1138,13 @@ void GlobalsPrinter::DisplayGlobals()const
{
typedef Preprocessor::macro_iterator macro_iterator;
assert(fInterpreter != 0 && "DisplayGlobals, fInterpreter is null");
assert(fInterpreter != nullptr && "DisplayGlobals, fInterpreter is null");
const CompilerInstance* const compiler = fInterpreter->getCI();
assert(compiler != 0 && "DisplayGlobals, compiler instance is null");
assert(compiler != nullptr && "DisplayGlobals, compiler instance is null");
const TranslationUnitDecl* const tuDecl = compiler->getASTContext().getTranslationUnitDecl();
assert(tuDecl != 0 && "DisplayGlobals, translation unit is empty");
assert(tuDecl != nullptr && "DisplayGlobals, translation unit is empty");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
@ -1174,13 +1174,13 @@ void GlobalsPrinter::DisplayGlobal(const std::string& name)const
//TODO: is it ok to compare 'name' with decl->getNameAsString() ??
assert(fInterpreter != 0 && "DisplayGlobal, fInterpreter is null");
assert(fInterpreter != nullptr && "DisplayGlobal, fInterpreter is null");
const CompilerInstance* const compiler = fInterpreter->getCI();
assert(compiler != 0 && "DisplayGlobal, compiler instance is null");
assert(compiler != nullptr && "DisplayGlobal, compiler instance is null");
const TranslationUnitDecl* const tuDecl = compiler->getASTContext().getTranslationUnitDecl();
assert(tuDecl != 0 && "DisplayGlobal, translation unit is empty");
assert(tuDecl != nullptr && "DisplayGlobal, translation unit is empty");
unsigned count = 0;
@ -1209,8 +1209,8 @@ void GlobalsPrinter::DisplayGlobal(const std::string& name)const
//______________________________________________________________________________
void GlobalsPrinter::DisplayVarDecl(const VarDecl* varDecl) const
{
assert(fInterpreter != 0 && "DisplayVarDecl, fInterpreter is null");
assert(varDecl != 0 && "DisplayVarDecl, 'varDecl' parameter is null");
assert(fInterpreter != nullptr && "DisplayVarDecl, fInterpreter is null");
assert(varDecl != nullptr && "DisplayVarDecl, 'varDecl' parameter is null");
const LangOptions langOpts;
PrintingPolicy printingPolicy(langOpts);
@ -1240,8 +1240,8 @@ void GlobalsPrinter::DisplayVarDecl(const VarDecl* varDecl) const
//______________________________________________________________________________
void GlobalsPrinter::DisplayEnumeratorDecl(const EnumConstantDecl* enumerator)const
{
assert(fInterpreter != 0 && "DisplayEnumeratorDecl, fInterpreter is null");
assert(enumerator != 0 && "DisplayEnumeratorDecl, 'enumerator' parameter is null");
assert(fInterpreter != nullptr && "DisplayEnumeratorDecl, fInterpreter is null");
assert(enumerator != nullptr && "DisplayEnumeratorDecl, 'enumerator' parameter is null");
const LangOptions langOpts;
PrintingPolicy printingPolicy(langOpts);
@ -1342,9 +1342,9 @@ void NamespacePrinter::Print()const
void NamespacePrinter::ProcessNamespaceDeclaration(decl_iterator declIt,
const std::string& enclosingNamespaceName)const
{
assert(fInterpreter != 0 &&
assert(fInterpreter != nullptr &&
"ProcessNamespaceDeclaration, fInterpreter is null");
assert(*declIt != 0 &&
assert(*declIt != nullptr &&
"ProcessNamespaceDeclaration, parameter 'decl' is not a valid iterator");
if (const auto nsDecl = dyn_cast<NamespaceDecl>(*declIt)) {
@ -1405,19 +1405,19 @@ TypedefPrinter::TypedefPrinter(llvm::raw_ostream& stream, const Interpreter* int
: fOut(stream),
fInterpreter(interpreter)
{
assert(interpreter != 0 && "TypedefPrinter, parameter 'interpreter' is null");
assert(interpreter != nullptr && "TypedefPrinter, parameter 'interpreter' is null");
}
//______________________________________________________________________________
void TypedefPrinter::DisplayTypedefs()const
{
assert(fInterpreter != 0 && "DisplayTypedefs, fInterpreter is null");
assert(fInterpreter != nullptr && "DisplayTypedefs, fInterpreter is null");
const CompilerInstance* const compiler = fInterpreter->getCI();
assert(compiler != 0 && "DisplayTypedefs, compiler instance is null");
assert(compiler != nullptr && "DisplayTypedefs, compiler instance is null");
const TranslationUnitDecl* const tuDecl = compiler->getASTContext().getTranslationUnitDecl();
assert(tuDecl != 0 && "DisplayTypedefs, translation unit is empty");
assert(tuDecl != nullptr && "DisplayTypedefs, translation unit is empty");
fOut.Print("List of typedefs\n");
ProcessNestedDeclarations(tuDecl);
@ -1450,7 +1450,7 @@ void TypedefPrinter::DisplayTypedef(const std::string& typedefName)const
//______________________________________________________________________________
void TypedefPrinter::ProcessNestedDeclarations(const DeclContext* decl)const
{
assert(decl != 0 && "ProcessNestedDeclarations, parameter 'decl' is null");
assert(decl != nullptr && "ProcessNestedDeclarations, parameter 'decl' is null");
// Could trigger deserialization of decls.
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(fInterpreter));
for (decl_iterator it = decl->decls_begin(), eIt = decl->decls_end(); it != eIt; ++it)
@ -1460,8 +1460,8 @@ void TypedefPrinter::ProcessNestedDeclarations(const DeclContext* decl)const
//______________________________________________________________________________
void TypedefPrinter::ProcessDecl(decl_iterator decl)const
{
assert(fInterpreter != 0 && "ProcessDecl, fInterpreter is null");
assert(*decl != 0 && "ProcessDecl, parameter 'decl' is not a valid iterator");
assert(fInterpreter != nullptr && "ProcessDecl, fInterpreter is null");
assert(*decl != nullptr && "ProcessDecl, parameter 'decl' is not a valid iterator");
switch (decl->getKind()) {
case Decl::Typedef:
@ -1490,9 +1490,9 @@ void TypedefPrinter::ProcessDecl(decl_iterator decl)const
//______________________________________________________________________________
void TypedefPrinter::DisplayTypedefDecl(TypedefNameDecl* typedefDecl)const
{
assert(typedefDecl != 0
assert(typedefDecl != nullptr
&& "DisplayTypedefDecl, parameter 'typedefDecl' is null");
assert(fInterpreter != 0 && "DisplayTypedefDecl, fInterpreter is null");
assert(fInterpreter != nullptr && "DisplayTypedefDecl, fInterpreter is null");
std::string textLine;
AppendDeclLocation(fInterpreter->getCI(), typedefDecl, textLine);
@ -1524,7 +1524,7 @@ void TypedefPrinter::DisplayTypedefDecl(TypedefNameDecl* typedefDecl)const
void DisplayClass(llvm::raw_ostream& stream, const Interpreter* interpreter,
const char* className, bool verbose)
{
assert(interpreter != 0 && "DisplayClass, 'interpreter' parameter is null");
assert(interpreter != nullptr && "DisplayClass, 'interpreter' parameter is null");
ClassPrinter printer(stream, interpreter);
printer.SetVerbose(verbose);
@ -1540,7 +1540,7 @@ void DisplayClass(llvm::raw_ostream& stream, const Interpreter* interpreter,
//______________________________________________________________________________
void DisplayNamespaces(llvm::raw_ostream &stream, const Interpreter *interpreter)
{
assert(interpreter != 0 && "DisplayNamespaces, parameter 'interpreter' is null");
assert(interpreter != nullptr && "DisplayNamespaces, parameter 'interpreter' is null");
Interpreter::PushTransactionRAII RAII(const_cast<Interpreter*>(interpreter));
NamespacePrinter printer(stream, interpreter);
@ -1551,7 +1551,7 @@ void DisplayNamespaces(llvm::raw_ostream &stream, const Interpreter *interpreter
//______________________________________________________________________________
void DisplayGlobals(llvm::raw_ostream& stream, const Interpreter* interpreter)
{
assert(interpreter != 0 && "DisplayGlobals, 'interpreter' parameter is null");
assert(interpreter != nullptr && "DisplayGlobals, 'interpreter' parameter is null");
GlobalsPrinter printer(stream, interpreter);
// Could trigger deserialization of decls.
@ -1563,7 +1563,7 @@ void DisplayGlobals(llvm::raw_ostream& stream, const Interpreter* interpreter)
void DisplayGlobal(llvm::raw_ostream& stream, const Interpreter* interpreter,
const std::string& name)
{
assert(interpreter != 0 && "DisplayGlobal, 'interpreter' parameter is null");
assert(interpreter != nullptr && "DisplayGlobal, 'interpreter' parameter is null");
GlobalsPrinter printer(stream, interpreter);
// Could trigger deserialization of decls.
@ -1574,7 +1574,7 @@ void DisplayGlobal(llvm::raw_ostream& stream, const Interpreter* interpreter,
//______________________________________________________________________________
void DisplayTypedefs(llvm::raw_ostream &stream, const Interpreter *interpreter)
{
assert(interpreter != 0 && "DisplayTypedefs, parameter 'interpreter' is null");
assert(interpreter != nullptr && "DisplayTypedefs, parameter 'interpreter' is null");
TypedefPrinter printer(stream, interpreter);
// Could trigger deserialization of decls.
@ -1586,7 +1586,7 @@ void DisplayTypedefs(llvm::raw_ostream &stream, const Interpreter *interpreter)
void DisplayTypedef(llvm::raw_ostream &stream, const Interpreter *interpreter,
const std::string &name)
{
assert(interpreter != 0 && "DisplayTypedef, parameter 'interpreter' is null");
assert(interpreter != nullptr && "DisplayTypedef, parameter 'interpreter' is null");
TypedefPrinter printer(stream, interpreter);
printer.DisplayTypedef(name);

View File

@ -141,7 +141,7 @@ namespace cling {
return (m_Interpreter.echo(OS.str(), ret) == Interpreter::kSuccess)
? CR_Success : CR_Failure;
};
cling::Transaction* T = nullptr;
if (actOnLCommand(file, &T) != AR_Success || !T)
return AR_Failure;
@ -193,7 +193,7 @@ namespace cling {
auto interpreterHasTransaction = [] (const Interpreter& Interp,
const Transaction* T) {
for (const Transaction* I = Interp.getFirstTransaction();
I != 0; I = I->getNext())
I != nullptr; I = I->getNext())
if (I == T)
return true;
return false;

View File

@ -30,7 +30,7 @@ namespace {
static D* LookupResult2Decl(clang::LookupResult& R)
{
if (R.empty())
return 0;
return nullptr;
R.resolveKind();
@ -112,7 +112,7 @@ namespace utils {
if (FoundAt)
*FoundAt = -1;
Expr* result = 0;
Expr* result = nullptr;
if (CompoundStmt* CS = dyn_cast<CompoundStmt>(FD->getBody())) {
ArrayRef<Stmt*> Stmts
= llvm::makeArrayRef(CS->body_begin(), CS->size());
@ -126,7 +126,7 @@ namespace utils {
*FoundAt = indexOfLastExpr;
if (indexOfLastExpr < 0)
return 0;
return nullptr;
if ( (result = dyn_cast<Expr>(Stmts[indexOfLastExpr])) )
return result;
@ -196,7 +196,7 @@ namespace utils {
GetFullyQualifiedTemplateName(const ASTContext& Ctx, TemplateName &tname) {
bool changed = false;
NestedNameSpecifier *NNS = 0;
NestedNameSpecifier *NNS = nullptr;
TemplateDecl *argtdecl = tname.getAsTemplateDecl();
QualifiedTemplateName *qtname = tname.getAsQualifiedTemplateName();
@ -208,7 +208,7 @@ namespace utils {
changed = true;
NNS = qNNS;
} else {
NNS = 0;
NNS = nullptr;
}
} else {
NNS = CreateNestedNameSpecifierForScopeOf(Ctx, argtdecl, true);
@ -362,7 +362,7 @@ namespace utils {
if (const Type *type = scope->getAsType()) {
// Find decl context.
const TagDecl* TD = 0;
const TagDecl* TD = nullptr;
if (const TagType* tagdecltype = dyn_cast<TagType>(type)) {
TD = tagdecltype->getDecl();
} else {
@ -391,7 +391,7 @@ namespace utils {
NestedNameSpecifier *original_prefix,
const Transform::Config& TypeConfig) {
// We have to also desugar the prefix.
NestedNameSpecifier* prefix = 0;
NestedNameSpecifier* prefix = nullptr;
if (declContext) {
// We had a scope prefix as input, let see if it is still
// the same as the scope of the result and if it is, then
@ -402,7 +402,7 @@ namespace utils {
const NamespaceDecl *new_ns =dyn_cast<NamespaceDecl>(declContext);
if (new_ns) {
new_ns = new_ns->getCanonicalDecl();
NamespaceDecl *old_ns = 0;
NamespaceDecl *old_ns = nullptr;
if (original_prefix) {
original_prefix->getAsNamespace();
if (NamespaceAliasDecl *alias =
@ -551,7 +551,7 @@ namespace utils {
desugared = etype->getNamedType();
} else {
Decl* decl = 0;
Decl* decl = nullptr;
const TypedefType* typedeftype =
dyn_cast_or_null<TypedefType>(&(*desugared));
if (typedeftype) {
@ -576,7 +576,7 @@ namespace utils {
outer_scope = SelectPrefix(Ctx,decl->getDeclContext(),
outer_scope,TypeConfig);
} else {
outer_scope = 0;
outer_scope = nullptr;
}
} else if (outer_scope) {
outer_scope = GetPartiallyDesugaredNNS(Ctx, outer_scope, TypeConfig);
@ -675,7 +675,7 @@ namespace utils {
if (Analyze::IsStdClass(Template)) {
static const char *stls[] = //container names
{"vector","list","deque","map","multimap","set","multiset",0};
{"vector","list","deque","map","multimap","set","multiset",nullptr};
static unsigned int values[] = //number of default arg.
{1,1,1,2,2,2,2};
StringRef name = Template.getName();
@ -1040,7 +1040,7 @@ namespace utils {
// NOTE: however we problably want to add the std::vector typedefs
// to the list of things to skip!
NestedNameSpecifier* original_prefix = 0;
NestedNameSpecifier* original_prefix = nullptr;
Qualifiers prefix_qualifiers;
const ElaboratedType* etype_input
= dyn_cast<ElaboratedType>(QT.getTypePtr());
@ -1058,7 +1058,7 @@ namespace utils {
prefix_qualifiers = QT.getLocalQualifiers();
QT = QualType(etype_input->getNamedType().getTypePtr(),0);
} else {
original_prefix = 0;
original_prefix = nullptr;
}
}
}
@ -1103,7 +1103,7 @@ namespace utils {
fullyQualifyTmpltArg);
}
NestedNameSpecifier* prefix = 0;
NestedNameSpecifier* prefix = nullptr;
const ElaboratedType* etype
= dyn_cast<ElaboratedType>(QT.getTypePtr());
if (etype) {
@ -1118,7 +1118,7 @@ namespace utils {
// in which case we want to add it ... but we can't really preserve
// the typedef in this case ...
Decl *decl = 0;
Decl *decl = nullptr;
const TypedefType* typedeftype =
dyn_cast_or_null<TypedefType>(QT.getTypePtr());
if (typedeftype) {
@ -1147,7 +1147,7 @@ namespace utils {
// Same type, use the original spelling
prefix
= GetPartiallyDesugaredNNS(Ctx, original_prefix, TypeConfig);
outer = 0; // Cancel the later creation.
outer = nullptr; // Cancel the later creation.
}
} else {
const NamespaceDecl *old_ns = original_prefix->getAsNamespace();
@ -1165,7 +1165,7 @@ namespace utils {
// This is the same namespace, use the original prefix
// as a starting point.
prefix = GetFullyQualifiedNameSpecifier(Ctx,original_prefix);
outer = 0; // Cancel the later creation.
outer = nullptr; // Cancel the later creation.
}
}
} else { // if (!original_prefix)
@ -1411,14 +1411,14 @@ namespace utils {
if (const clang::TagDecl* TD = dyn_cast<clang::TagDecl>(Within)) {
if (!TD->getDefinition()) {
// No definition, no lookup result.
return 0;
return nullptr;
}
}
S->LookupQualifiedName(R, const_cast<DeclContext*>(Within));
}
if (R.empty())
return 0;
return nullptr;
R.resolveKind();
@ -1527,7 +1527,7 @@ namespace utils {
return TypeName::CreateNestedNameSpecifier(Ctx, TD, FullyQualified);
}
}
return 0;
return nullptr;
}
static NestedNameSpecifier*
@ -1538,9 +1538,9 @@ namespace utils {
// Create a nested name specifier for the declaring context of the type.
if (!TypePtr)
return 0;
return nullptr;
Decl *decl = 0;
Decl *decl = nullptr;
if (const TypedefType* typedeftype = llvm::dyn_cast<TypedefType>(TypePtr)) {
decl = typedeftype->getDecl();
} else {
@ -1552,7 +1552,7 @@ namespace utils {
}
if (!decl)
return 0;
return nullptr;
return CreateNestedNameSpecifierForScopeOf(Ctx, decl, FullyQualified);
}
@ -1564,7 +1564,7 @@ namespace utils {
// Ignore inline namespace;
Namesp = dyn_cast_or_null<NamespaceDecl>(Namesp->getDeclContext());
}
if (!Namesp) return 0;
if (!Namesp) return nullptr;
bool FullyQualified = true; // doesn't matter, DeclContexts are namespaces
return NestedNameSpecifier::Create(Ctx, CreateOuterNNS(Ctx, Namesp,
@ -1649,7 +1649,7 @@ namespace utils {
QT = Ctx.getQualifiedType(QT, quals);
}
NestedNameSpecifier* prefix = 0;
NestedNameSpecifier* prefix = nullptr;
Qualifiers prefix_qualifiers;
if (const ElaboratedType* etype_input
= llvm::dyn_cast<ElaboratedType>(QT.getTypePtr())) {
@ -1663,9 +1663,9 @@ namespace utils {
&& !(ns && ns->isAnonymousNamespace())) {
prefix_qualifiers = QT.getLocalQualifiers();
prefix = GetFullyQualifiedNameSpecifier(Ctx, prefix);
QT = QualType(etype_input->getNamedType().getTypePtr(),0);
QT = QualType(etype_input->getNamedType().getTypePtr(), 0);
} else {
prefix = 0;
prefix = nullptr;
}
}
} else {