forked from OSchip/llvm-project
- Improve comment for Type::getPointeeType().
- Remove a couple redundant casts/returns. - Fix 80 column violations for all getAsStringInternal() methods. llvm-svn: 75485
This commit is contained in:
parent
0a860df8ef
commit
2efbbe3531
|
@ -467,8 +467,8 @@ public:
|
|||
/// This method should never be used when type qualifiers are meaningful.
|
||||
const Type *getArrayElementTypeNoTypeQual() const;
|
||||
|
||||
/// getPointeeType - If this is a pointer or ObjC object pointer, this
|
||||
/// returns the respective pointee.
|
||||
/// getPointeeType - If this is a pointer, ObjC object pointer, or block
|
||||
/// pointer, this returns the respective pointee.
|
||||
QualType getPointeeType() const;
|
||||
|
||||
/// getDesugaredType - Return the specified type with any "sugar" removed from
|
||||
|
@ -505,7 +505,8 @@ public:
|
|||
|
||||
QualType getCanonicalTypeInternal() const { return CanonicalType; }
|
||||
void dump() const;
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const = 0;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const = 0;
|
||||
static bool classof(const Type *) { return true; }
|
||||
};
|
||||
|
||||
|
@ -538,7 +539,8 @@ public:
|
|||
QualType::GCAttrTypes getObjCGCAttr() const { return GCAttrType; }
|
||||
unsigned getAddressSpace() const { return AddressSpace; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getBaseType(), AddressSpace, GCAttrType);
|
||||
|
@ -600,7 +602,8 @@ public:
|
|||
Kind getKind() const { return TypeKind; }
|
||||
const char *getName(const LangOptions &LO) const;
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) { return T->getTypeClass() == Builtin; }
|
||||
static bool classof(const BuiltinType *) { return true; }
|
||||
|
@ -621,7 +624,8 @@ public:
|
|||
bool isSigned() const { return Signed; }
|
||||
const char *getName() const;
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) { return T->getTypeClass() == FixedWidthInt; }
|
||||
static bool classof(const FixedWidthIntType *) { return true; }
|
||||
|
@ -640,7 +644,8 @@ class ComplexType : public Type, public llvm::FoldingSetNode {
|
|||
public:
|
||||
QualType getElementType() const { return ElementType; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getElementType());
|
||||
|
@ -664,7 +669,8 @@ class PointerType : public Type, public llvm::FoldingSetNode {
|
|||
friend class ASTContext; // ASTContext creates these.
|
||||
public:
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
QualType getPointeeType() const { return PointeeType; }
|
||||
|
||||
|
@ -695,7 +701,8 @@ public:
|
|||
// Get the pointee type. Pointee is required to always be a function type.
|
||||
QualType getPointeeType() const { return PointeeType; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getPointeeType());
|
||||
|
@ -745,7 +752,8 @@ class LValueReferenceType : public ReferenceType {
|
|||
}
|
||||
friend class ASTContext; // ASTContext creates these
|
||||
public:
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == LValueReference;
|
||||
|
@ -761,7 +769,8 @@ class RValueReferenceType : public ReferenceType {
|
|||
}
|
||||
friend class ASTContext; // ASTContext creates these
|
||||
public:
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == RValueReference;
|
||||
|
@ -789,7 +798,8 @@ public:
|
|||
|
||||
const Type *getClass() const { return Class; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getPointeeType(), getClass());
|
||||
|
@ -877,7 +887,8 @@ protected:
|
|||
friend class ASTContext; // ASTContext creates these.
|
||||
public:
|
||||
const llvm::APInt &getSize() const { return Size; }
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getElementType(), getSize(),
|
||||
|
@ -976,7 +987,8 @@ class IncompleteArrayType : public ArrayType {
|
|||
: ArrayType(IncompleteArray, et, can, sm, tq) {}
|
||||
friend class ASTContext; // ASTContext creates these.
|
||||
public:
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == IncompleteArray;
|
||||
|
@ -1037,7 +1049,8 @@ public:
|
|||
SourceLocation getLBracketLoc() const { return Brackets.getBegin(); }
|
||||
SourceLocation getRBracketLoc() const { return Brackets.getEnd(); }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == VariableArray;
|
||||
|
@ -1087,7 +1100,8 @@ public:
|
|||
SourceLocation getLBracketLoc() const { return Brackets.getBegin(); }
|
||||
SourceLocation getRBracketLoc() const { return Brackets.getEnd(); }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == DependentSizedArray;
|
||||
|
@ -1127,7 +1141,8 @@ public:
|
|||
QualType getElementType() const { return ElementType; }
|
||||
SourceLocation getAttributeLoc() const { return loc; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == DependentSizedExtVector;
|
||||
|
@ -1161,7 +1176,8 @@ public:
|
|||
QualType getElementType() const { return ElementType; }
|
||||
unsigned getNumElements() const { return NumElements; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getElementType(), getNumElements(), getTypeClass());
|
||||
|
@ -1235,7 +1251,8 @@ public:
|
|||
return unsigned(idx-1) < NumElements;
|
||||
return false;
|
||||
}
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == ExtVector;
|
||||
|
@ -1291,7 +1308,8 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode {
|
|||
public:
|
||||
// No additional state past what FunctionType provides.
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getResultType());
|
||||
|
@ -1398,7 +1416,8 @@ public:
|
|||
return exception_begin() + NumExceptions;
|
||||
}
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == FunctionProto;
|
||||
|
@ -1434,7 +1453,8 @@ public:
|
|||
/// looking through the typedefs for B will give you "const volatile A".
|
||||
QualType LookThroughTypedefs() const;
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) { return T->getTypeClass() == Typedef; }
|
||||
static bool classof(const TypedefType *) { return true; }
|
||||
|
@ -1448,7 +1468,8 @@ class TypeOfExprType : public Type {
|
|||
public:
|
||||
Expr *getUnderlyingExpr() const { return TOExpr; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) { return T->getTypeClass() == TypeOfExpr; }
|
||||
static bool classof(const TypeOfExprType *) { return true; }
|
||||
|
@ -1465,7 +1486,8 @@ class TypeOfType : public Type {
|
|||
public:
|
||||
QualType getUnderlyingType() const { return TOType; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) { return T->getTypeClass() == TypeOf; }
|
||||
static bool classof(const TypeOfType *) { return true; }
|
||||
|
@ -1514,7 +1536,8 @@ public:
|
|||
bool isBeingDefined() const { return decl.getInt(); }
|
||||
void setBeingDefined(bool Def) { decl.setInt(Def? 1 : 0); }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() >= TagFirst && T->getTypeClass() <= TagLast;
|
||||
|
@ -1597,7 +1620,8 @@ public:
|
|||
bool isParameterPack() const { return ParameterPack; }
|
||||
IdentifierInfo *getName() const { return Name; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, Depth, Index, ParameterPack, Name);
|
||||
|
@ -1683,7 +1707,8 @@ public:
|
|||
/// \precondition @c isArgType(Arg)
|
||||
const TemplateArgument &getArg(unsigned Idx) const;
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, Template, getArgs(), NumArgs);
|
||||
|
@ -1726,7 +1751,8 @@ public:
|
|||
/// \brief Retrieve the type named by the qualified-id.
|
||||
QualType getNamedType() const { return NamedType; }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, NNS, NamedType);
|
||||
|
@ -1802,7 +1828,8 @@ public:
|
|||
return Name.dyn_cast<const TemplateSpecializationType *>();
|
||||
}
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, NNS, Name);
|
||||
|
@ -1854,7 +1881,8 @@ public:
|
|||
/// interface type, or 0 if there are none.
|
||||
inline unsigned getNumProtocols() const;
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
static bool classof(const Type *T) {
|
||||
return T->getTypeClass() == ObjCInterface ||
|
||||
T->getTypeClass() == ObjCQualifiedInterface;
|
||||
|
@ -1962,7 +1990,8 @@ public:
|
|||
qual_iterator qual_begin() const { return Protocols.begin(); }
|
||||
qual_iterator qual_end() const { return Protocols.end(); }
|
||||
|
||||
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const;
|
||||
virtual void getAsStringInternal(std::string &InnerString,
|
||||
const PrintingPolicy &Policy) const;
|
||||
|
||||
void Profile(llvm::FoldingSetNodeID &ID);
|
||||
static void Profile(llvm::FoldingSetNodeID &ID,
|
||||
|
|
|
@ -4278,8 +4278,6 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
|
|||
!Context.typesAreCompatible(lType, rType)) {
|
||||
Diag(Loc, diag::ext_typecheck_comparison_of_distinct_pointers)
|
||||
<< lType << rType << lex->getSourceRange() << rex->getSourceRange();
|
||||
ImpCastExprToType(rex, lType);
|
||||
return ResultTy;
|
||||
}
|
||||
ImpCastExprToType(rex, lType);
|
||||
return ResultTy;
|
||||
|
@ -4293,8 +4291,6 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
|
|||
if (!ObjCQualifiedIdTypesAreCompatible(lType, rType, true))
|
||||
Diag(Loc, diag::warn_incompatible_qualified_id_operands)
|
||||
<< lType << rType << lex->getSourceRange() << rex->getSourceRange();
|
||||
ImpCastExprToType(rex, lType);
|
||||
return ResultTy;
|
||||
}
|
||||
ImpCastExprToType(rex, lType);
|
||||
return ResultTy;
|
||||
|
|
Loading…
Reference in New Issue