diff --git a/clang/include/clang/AST/Attr.h b/clang/include/clang/AST/Attr.h --- a/clang/include/clang/AST/Attr.h +++ b/clang/include/clang/AST/Attr.h @@ -374,8 +374,7 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, const Attr *At) { - DB.AddTaggedVal(reinterpret_cast(At), - DiagnosticsEngine::ak_attr); + DB.AddTaggedVal(reinterpret_cast(At), DiagnosticsEngine::ak_attr); return DB; } } // end namespace clang diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -4589,7 +4589,7 @@ /// into a diagnostic with <<. inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD, const NamedDecl *ND) { - PD.AddTaggedVal(reinterpret_cast(ND), + PD.AddTaggedVal(reinterpret_cast(ND), DiagnosticsEngine::ak_nameddecl); return PD; } diff --git a/clang/include/clang/AST/NestedNameSpecifier.h b/clang/include/clang/AST/NestedNameSpecifier.h --- a/clang/include/clang/AST/NestedNameSpecifier.h +++ b/clang/include/clang/AST/NestedNameSpecifier.h @@ -521,7 +521,7 @@ /// NestedNameSpecifiers into a diagnostic with <<. inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, NestedNameSpecifier *NNS) { - DB.AddTaggedVal(reinterpret_cast(NNS), + DB.AddTaggedVal(reinterpret_cast(NNS), DiagnosticsEngine::ak_nestednamespec); return DB; } diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -7146,7 +7146,7 @@ /// into a diagnostic with <<. inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD, QualType T) { - PD.AddTaggedVal(reinterpret_cast(T.getAsOpaquePtr()), + PD.AddTaggedVal(reinterpret_cast(T.getAsOpaquePtr()), DiagnosticsEngine::ak_qualtype); return PD; } diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h --- a/clang/include/clang/Basic/Diagnostic.h +++ b/clang/include/clang/Basic/Diagnostic.h @@ -164,9 +164,9 @@ /// The values for the various substitution positions. /// /// This is used when the argument is not an std::string. The specific value - /// is mangled into an intptr_t and the interpretation depends on exactly + /// is mangled into an uint64_t and the interpretation depends on exactly /// what sort of argument kind it is. - intptr_t DiagArgumentsVal[MaxArguments]; + uint64_t DiagArgumentsVal[MaxArguments]; /// The values for the various substitution positions that have /// string arguments. @@ -1179,7 +1179,7 @@ DiagStorage = nullptr; } - void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const { + void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const { if (!DiagStorage) DiagStorage = getStorage(); @@ -1580,18 +1580,18 @@ /// Return the specified signed integer argument. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_sint - int getArgSInt(unsigned Idx) const { + int64_t getArgSInt(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_sint && "invalid argument accessor!"); - return (int)DiagObj->DiagStorage.DiagArgumentsVal[Idx]; + return (int64_t)DiagObj->DiagStorage.DiagArgumentsVal[Idx]; } /// Return the specified unsigned integer argument. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_uint - unsigned getArgUInt(unsigned Idx) const { + uint64_t getArgUInt(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_uint && "invalid argument accessor!"); - return (unsigned)DiagObj->DiagStorage.DiagArgumentsVal[Idx]; + return DiagObj->DiagStorage.DiagArgumentsVal[Idx]; } /// Return the specified IdentifierInfo argument. @@ -1605,7 +1605,7 @@ /// Return the specified non-string argument in an opaque form. /// \pre getArgKind(Idx) != DiagnosticsEngine::ak_std_string - intptr_t getRawArg(unsigned Idx) const { + uint64_t getRawArg(unsigned Idx) const { assert(getArgKind(Idx) != DiagnosticsEngine::ak_std_string && "invalid argument accessor!"); return DiagObj->DiagStorage.DiagArgumentsVal[Idx]; diff --git a/clang/include/clang/Sema/ParsedAttr.h b/clang/include/clang/Sema/ParsedAttr.h --- a/clang/include/clang/Sema/ParsedAttr.h +++ b/clang/include/clang/Sema/ParsedAttr.h @@ -1119,14 +1119,14 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, const ParsedAttr &At) { - DB.AddTaggedVal(reinterpret_cast(At.getAttrName()), + DB.AddTaggedVal(reinterpret_cast(At.getAttrName()), DiagnosticsEngine::ak_identifierinfo); return DB; } inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, const ParsedAttr *At) { - DB.AddTaggedVal(reinterpret_cast(At->getAttrName()), + DB.AddTaggedVal(reinterpret_cast(At->getAttrName()), DiagnosticsEngine::ak_identifierinfo); return DB; } @@ -1141,7 +1141,7 @@ std::is_same::value, int> = 0> inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, const ACI &CI) { - DB.AddTaggedVal(reinterpret_cast(CI.getAttrName()), + DB.AddTaggedVal(reinterpret_cast(CI.getAttrName()), DiagnosticsEngine::ak_identifierinfo); return DB; } @@ -1151,7 +1151,7 @@ std::is_same::value, int> = 0> inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, const ACI* CI) { - DB.AddTaggedVal(reinterpret_cast(CI->getAttrName()), + DB.AddTaggedVal(reinterpret_cast(CI->getAttrName()), DiagnosticsEngine::ak_identifierinfo); return DB; } diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -932,7 +932,7 @@ } // ---- INTEGERS ---- case DiagnosticsEngine::ak_sint: { - int Val = getArgSInt(ArgNo); + int64_t Val = getArgSInt(ArgNo); if (ModifierIs(Modifier, ModifierLen, "select")) { HandleSelectModifier(*this, (unsigned)Val, Argument, ArgumentLen, @@ -951,7 +951,7 @@ break; } case DiagnosticsEngine::ak_uint: { - unsigned Val = getArgUInt(ArgNo); + uint64_t Val = getArgUInt(ArgNo); if (ModifierIs(Modifier, ModifierLen, "select")) { HandleSelectModifier(*this, Val, Argument, ArgumentLen, OutStr);