inline bool
FTIHasSingleVoidParameter(const DeclaratorChunk::FunctionTypeInfo &FTI) {
- return FTI.NumParams == 1 && !FTI.isVariadic && FTI.Params[0].Ident == 0 &&
- FTI.Params[0].Param &&
+ return FTI.NumParams == 1 && !FTI.isVariadic &&
+ FTI.Params[0].Ident == nullptr && FTI.Params[0].Param &&
cast<ParmVarDecl>(FTI.Params[0].Param)->getType()->isVoidType();
}
// If this isn't just an array->pointer decay, bail out.
const auto *CE = dyn_cast<CastExpr>(E);
if (!CE || CE->getCastKind() != CK_ArrayToPointerDecay)
- return 0;
+ return nullptr;
// If this is a decay from variable width array, bail out.
const Expr *SubExpr = CE->getSubExpr();
/// when the module is unloaded.
void CodeGenModule::AddGlobalDtor(llvm::Function *Dtor, int Priority) {
// FIXME: Type coercion of void()* types.
- GlobalDtors.push_back(Structor(Priority, Dtor, 0));
+ GlobalDtors.push_back(Structor(Priority, Dtor, nullptr));
}
void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) {
return new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy,
/*Constant=*/true,
llvm::GlobalVariable::ExternalLinkage,
- /*Initializer=*/0, MangledName);
+ /*Initializer=*/nullptr, MangledName);
}
namespace {
const CXXBaseSpecifier *Specifier) {
Flags = HasHierarchyDescriptor;
if (!Parent) {
- VirtualRoot = 0;
+ VirtualRoot = nullptr;
OffsetInVBase = 0;
} else {
if (Specifier->getAccessSpecifier() != AS_public)
// Serialize the class hierarchy and initialize the CHD Fields.
SmallVector<MSRTTIClass, 8> Classes;
serializeClassHierarchy(Classes, RD);
- Classes.front().initialize(/*Parent=*/0, /*Specifier=*/0);
+ Classes.front().initialize(/*Parent=*/nullptr, /*Specifier=*/nullptr);
detectAmbiguousBases(Classes);
int Flags = 0;
for (auto Class : Classes) {
// Forward-declare the class hierarchy descriptor
auto Type = getClassHierarchyDescriptorType(CGM);
auto CHD = new llvm::GlobalVariable(Module, Type, /*Constant=*/true, Linkage,
- /*Initializer=*/0, MangledName.c_str());
+ /*Initializer=*/nullptr,
+ MangledName.c_str());
// Initialize the base class ClassHierarchyDescriptor.
llvm::Constant *Fields[] = {
auto PtrType = getBaseClassDescriptorType(CGM)->getPointerTo();
auto ArrayType = llvm::ArrayType::get(PtrType, Classes.size() + 1);
auto BCA = new llvm::GlobalVariable(Module, ArrayType,
- /*Constant=*/true, Linkage, /*Initializer=*/0, MangledName.c_str());
+ /*Constant=*/true, Linkage, /*Initializer=*/nullptr, MangledName.c_str());
// Initialize the BaseClassArray.
SmallVector<llvm::Constant *, 8> BaseClassArrayData;
// Forward-declare the base class descriptor.
auto Type = getBaseClassDescriptorType(CGM);
auto BCD = new llvm::GlobalVariable(Module, Type, /*Constant=*/true, Linkage,
- /*Initializer=*/0, MangledName.c_str());
+ /*Initializer=*/nullptr,
+ MangledName.c_str());
// Initialize the BaseClassDescriptor.
llvm::Constant *Fields[] = {
// Forward-declare the complete object locator.
llvm::StructType *Type = getCompleteObjectLocatorType(CGM);
auto COL = new llvm::GlobalVariable(Module, Type, /*Constant=*/true, Linkage,
- /*Initializer=*/0, MangledName.c_str());
+ /*Initializer=*/nullptr, MangledName.c_str());
// Initialize the CompleteObjectLocator.
llvm::Constant *Fields[] = {
/// \brief Determine whether ')' is ending a cast.
bool rParenEndsCast(const FormatToken &Tok) {
- FormatToken *LeftOfParens = NULL;
+ FormatToken *LeftOfParens = nullptr;
if (Tok.MatchingParen)
LeftOfParens = Tok.MatchingParen->getPreviousNonComment();
bool IsCast = false;
IsCast = true;
// If there is an identifier after the (), it is likely a cast, unless
// there is also an identifier before the ().
- else if (LeftOfParens && (LeftOfParens->Tok.getIdentifierInfo() == NULL ||
- LeftOfParens->is(tok::kw_return)) &&
+ else if (LeftOfParens &&
+ (LeftOfParens->Tok.getIdentifierInfo() == nullptr ||
+ LeftOfParens->is(tok::kw_return)) &&
LeftOfParens->Type != TT_OverloadedOperator &&
LeftOfParens->isNot(tok::at) &&
LeftOfParens->Type != TT_TemplateCloser && Tok.Next) {
ModuleLoader &TheModuleLoader,
IdentifierInfoLookup *IILookup, bool OwnsHeaders,
TranslationUnitKind TUKind)
- : PPOpts(PPOpts), Diags(&diags), LangOpts(opts), Target(0),
+ : PPOpts(PPOpts), Diags(&diags), LangOpts(opts), Target(nullptr),
FileMgr(Headers.getFileMgr()), SourceMgr(SM), HeaderInfo(Headers),
TheModuleLoader(TheModuleLoader), ExternalSource(nullptr),
Identifiers(opts, IILookup), IncrementalProcessing(false), TUKind(TUKind),
SkipMainFilePreamble(0, true), CurPPLexer(nullptr),
CurDirLookup(nullptr), CurLexerKind(CLK_Lexer), CurSubmodule(nullptr),
Callbacks(nullptr), MacroArgCache(nullptr), Record(nullptr),
- MIChainHead(nullptr), MICache(nullptr), DeserialMIChainHead(0) {
+ MIChainHead(nullptr), MICache(nullptr), DeserialMIChainHead(nullptr) {
OwnsHeaderSearch = OwnsHeaders;
ScratchBuf = new ScratchBuffer(SourceMgr);
ArgsUnion ArgHints[] = {Hint.OptionLoc, Hint.ValueLoc,
ArgsUnion(Hint.ValueExpr)};
// FIXME: Replace AS_Keyword with Pragma spelling AS_Pragma.
- TempAttrs.addNew(Hint.LoopLoc->Ident, Hint.Range, 0, Hint.LoopLoc->Loc,
- ArgHints, 3, AttributeList::AS_Keyword);
+ TempAttrs.addNew(Hint.LoopLoc->Ident, Hint.Range, nullptr,
+ Hint.LoopLoc->Loc, ArgHints, 3, AttributeList::AS_Keyword);
}
// Get the next statement.
I.Kind = Function;
I.Loc = LocalRangeBegin;
I.EndLoc = LocalRangeEnd;
- I.Fun.AttrList = 0;
+ I.Fun.AttrList = nullptr;
I.Fun.hasPrototype = hasProto;
I.Fun.isVariadic = EllipsisLoc.isValid();
I.Fun.isAmbiguous = isAmbiguous;
I.Fun.DeleteParams = false;
I.Fun.TypeQuals = TypeQuals;
I.Fun.NumParams = NumParams;
- I.Fun.Params = 0;
+ I.Fun.Params = nullptr;
I.Fun.RefQualifierIsLValueRef = RefQualifierIsLvalueRef;
I.Fun.RefQualifierLoc = RefQualifierLoc.getRawEncoding();
I.Fun.ConstQualifierLoc = ConstQualifierLoc.getRawEncoding();
I.Fun.ExceptionSpecType = ESpecType;
I.Fun.ExceptionSpecLoc = ESpecLoc.getRawEncoding();
I.Fun.NumExceptions = 0;
- I.Fun.Exceptions = 0;
- I.Fun.NoexceptExpr = 0;
+ I.Fun.Exceptions = nullptr;
+ I.Fun.NoexceptExpr = nullptr;
I.Fun.HasTrailingReturnType = TrailingReturnType.isUsable() ||
TrailingReturnType.isInvalid();
I.Fun.TrailingReturnType = TrailingReturnType.get();
DeclRep = Rep;
TSTLoc = TagKwLoc;
TSTNameLoc = TagNameLoc;
- TypeSpecOwned = Owned && Rep != 0;
+ TypeSpecOwned = Owned && Rep != nullptr;
return false;
}
bool DeclSpec::isMissingDeclaratorOk() {
TST tst = getTypeSpecType();
- return isDeclRep(tst) && getRepAsDecl() != 0 &&
+ return isDeclRep(tst) && getRepAsDecl() != nullptr &&
StorageClassSpec != DeclSpec::SCS_typedef;
}
/// variable (which may be the loop variable) if possible.
static const VarDecl *GetInitVarDecl(const Expr *E) {
if (!E)
- return 0;
+ return nullptr;
E = E->IgnoreParenImpCasts();
if (auto *CE = dyn_cast_or_null<CXXConstructExpr>(E))
if (const CXXConstructorDecl *Ctor = CE->getConstructor())
ED = NewED;
if (ED->isFixed()) {
// If the enum has a fixed underlying type, any declaration of it will do.
- *Suggested = 0;
+ *Suggested = nullptr;
for (auto *Redecl : ED->redecls()) {
if (LookupResult::isVisible(S, Redecl))
return true;
NamedDecl *Def = nullptr;
if (!T->isIncompleteType(&Def)) {
// If we know about the definition but it is not visible, complain.
- NamedDecl *SuggestedDef = 0;
+ NamedDecl *SuggestedDef = nullptr;
if (!Diagnoser.Suppressed && Def &&
!hasVisibleDefinition(*this, Def, &SuggestedDef)) {
// Suppress this error outside of a SFINAE context if we've already