summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2019-05-03 03:28:06 +0000
committerLeonard Chan <leonardchan@google.com>2019-05-03 03:28:06 +0000
commitef2dc25a962deae73f8ba723ce5a55404dda9fdb (patch)
treec5e7eb641d55ef5d673cfa907a98d18451a15e36 /clang/lib/AST
parentecc969caf9fdedb514f8a51bdeb210436a99cef1 (diff)
downloadbcm5719-llvm-ef2dc25a962deae73f8ba723ce5a55404dda9fdb.tar.gz
bcm5719-llvm-ef2dc25a962deae73f8ba723ce5a55404dda9fdb.zip
Revert "[Attribute/Diagnostics] Print macro if definition is an attribute declaration"
This reverts commit fc40cbd9d8c63e65eed3590ba925321afe782e1d. llvm-svn: 359859
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp19
-rw-r--r--clang/lib/AST/ASTDiagnostic.cpp5
-rw-r--r--clang/lib/AST/ASTStructuralEquivalence.cpp7
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp1
-rw-r--r--clang/lib/AST/Type.cpp19
-rw-r--r--clang/lib/AST/TypePrinter.cpp16
6 files changed, 1 insertions, 66 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 63488853759..d0a790cad4d 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2047,10 +2047,6 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
case Type::Paren:
return getTypeInfo(cast<ParenType>(T)->getInnerType().getTypePtr());
- case Type::MacroQualified:
- return getTypeInfo(
- cast<MacroQualifiedType>(T)->getUnderlyingType().getTypePtr());
-
case Type::ObjCTypeParam:
return getTypeInfo(cast<ObjCTypeParamType>(T)->desugar().getTypePtr());
@@ -3933,7 +3929,7 @@ QualType ASTContext::getAttributedType(attr::Kind attrKind,
QualType canon = getCanonicalType(equivalentType);
type = new (*this, TypeAlignment)
- AttributedType(canon, attrKind, modifiedType, equivalentType);
+ AttributedType(canon, attrKind, modifiedType, equivalentType);
Types.push_back(type);
AttributedTypes.InsertNode(type, insertPos);
@@ -4214,19 +4210,6 @@ ASTContext::getParenType(QualType InnerType) const {
return QualType(T, 0);
}
-QualType
-ASTContext::getMacroQualifiedType(QualType UnderlyingTy,
- const IdentifierInfo *MacroII) const {
- QualType Canon = UnderlyingTy;
- if (!Canon.isCanonical())
- Canon = getCanonicalType(UnderlyingTy);
-
- auto *newType = new (*this, TypeAlignment)
- MacroQualifiedType(UnderlyingTy, Canon, MacroII);
- Types.push_back(newType);
- return QualType(newType, 0);
-}
-
QualType ASTContext::getDependentNameType(ElaboratedTypeKeyword Keyword,
NestedNameSpecifier *NNS,
const IdentifierInfo *Name,
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index 15df8658529..61900aa4ac9 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -41,11 +41,6 @@ static QualType Desugar(ASTContext &Context, QualType QT, bool &ShouldAKA) {
QT = PT->desugar();
continue;
}
- // ... or a macro defined type ...
- if (const MacroQualifiedType *MDT = dyn_cast<MacroQualifiedType>(Ty)) {
- QT = MDT->desugar();
- continue;
- }
// ...or a substituted template type parameter ...
if (const SubstTemplateTypeParmType *ST =
dyn_cast<SubstTemplateTypeParmType>(Ty)) {
diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp
index 567945c16cd..71bbd824812 100644
--- a/clang/lib/AST/ASTStructuralEquivalence.cpp
+++ b/clang/lib/AST/ASTStructuralEquivalence.cpp
@@ -595,13 +595,6 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
return false;
break;
- case Type::MacroQualified:
- if (!IsStructurallyEquivalent(
- Context, cast<MacroQualifiedType>(T1)->getUnderlyingType(),
- cast<MacroQualifiedType>(T2)->getUnderlyingType()))
- return false;
- break;
-
case Type::Typedef:
if (!IsStructurallyEquivalent(Context, cast<TypedefType>(T1)->getDecl(),
cast<TypedefType>(T2)->getDecl()))
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index 930537a9343..3357756466f 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -1941,7 +1941,6 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty,
case Type::ObjCTypeParam:
case Type::Atomic:
case Type::Pipe:
- case Type::MacroQualified:
llvm_unreachable("type is illegal as a nested name specifier");
case Type::SubstTemplateTypeParmPack:
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 590e534fbdf..adffe92f95f 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -973,7 +973,6 @@ public:
SUGARED_TYPE_CLASS(Typedef)
SUGARED_TYPE_CLASS(ObjCTypeParam)
- SUGARED_TYPE_CLASS(MacroQualified)
QualType VisitAdjustedType(const AdjustedType *T) {
QualType originalType = recurse(T->getOriginalType());
@@ -1736,10 +1735,6 @@ namespace {
return Visit(T->getModifiedType());
}
- Type *VisitMacroQualifiedType(const MacroQualifiedType *T) {
- return Visit(T->getUnderlyingType());
- }
-
Type *VisitAdjustedType(const AdjustedType *T) {
return Visit(T->getOriginalType());
}
@@ -3165,20 +3160,6 @@ QualType TypedefType::desugar() const {
return getDecl()->getUnderlyingType();
}
-QualType MacroQualifiedType::desugar() const { return getUnderlyingType(); }
-
-QualType MacroQualifiedType::getModifiedType() const {
- // Step over MacroQualifiedTypes from the same macro to find the type
- // ultimately qualified by the macro qualifier.
- QualType Inner = cast<AttributedType>(getUnderlyingType())->getModifiedType();
- while (auto *InnerMQT = dyn_cast<MacroQualifiedType>(Inner)) {
- if (InnerMQT->getMacroIdentifier() != getMacroIdentifier())
- break;
- Inner = InnerMQT->getModifiedType();
- }
- return Inner;
-}
-
TypeOfExprType::TypeOfExprType(Expr *E, QualType can)
: Type(TypeOfExpr, can, E->isTypeDependent(),
E->isInstantiationDependent(),
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index fed39cadcb9..82a2fa09c76 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -259,7 +259,6 @@ bool TypePrinter::canPrefixQualifiers(const Type *T,
case Type::Paren:
case Type::PackExpansion:
case Type::SubstTemplateTypeParm:
- case Type::MacroQualified:
CanPrefixQualifiers = false;
break;
@@ -964,21 +963,6 @@ void TypePrinter::printTypedefBefore(const TypedefType *T, raw_ostream &OS) {
printTypeSpec(T->getDecl(), OS);
}
-void TypePrinter::printMacroQualifiedBefore(const MacroQualifiedType *T,
- raw_ostream &OS) {
- StringRef MacroName = T->getMacroIdentifier()->getName();
- OS << MacroName << " ";
-
- // Since this type is meant to print the macro instead of the whole attribute,
- // we trim any attributes and go directly to the original modified type.
- printBefore(T->getModifiedType(), OS);
-}
-
-void TypePrinter::printMacroQualifiedAfter(const MacroQualifiedType *T,
- raw_ostream &OS) {
- printAfter(T->getModifiedType(), OS);
-}
-
void TypePrinter::printTypedefAfter(const TypedefType *T, raw_ostream &OS) {}
void TypePrinter::printTypeOfExprBefore(const TypeOfExprType *T,
OpenPOWER on IntegriCloud