aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/ASTContext.h4
-rw-r--r--include/clang/AST/Type.h13
-rw-r--r--lib/AST/ASTContext.cpp11
3 files changed, 7 insertions, 21 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 65688619c4..9b5826b5d9 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -466,7 +466,9 @@ public:
/// getVolatileType - Returns the uniqued reference to the type for a
/// 'volatile' qualified type. The resulting type has a union of the
/// qualifiers from T and 'volatile'.
- QualType getVolatileType(QualType T);
+ QualType getVolatileType(QualType T) {
+ return T.withFastQualifiers(Qualifiers::Volatile);
+ }
/// getConstType - Returns the uniqued reference to the type for a
/// 'const' qualified type. The resulting type has a union of the
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 64cc1b1a6d..1490ae7674 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -35,7 +35,7 @@ using llvm::dyn_cast;
using llvm::dyn_cast_or_null;
namespace clang {
enum {
- TypeAlignmentInBits = 3,
+ TypeAlignmentInBits = 4,
TypeAlignment = 1 << TypeAlignmentInBits
};
class Type;
@@ -129,7 +129,7 @@ public:
MaxAddressSpace = 0xffffffu,
/// The width of the "fast" qualifier mask.
- FastWidth = 2,
+ FastWidth = 3,
/// The fast qualifier mask.
FastMask = (1 << FastWidth) - 1
@@ -380,8 +380,6 @@ public:
Qualifiers getQualifiers() const { return Quals; }
- bool hasVolatile() const { return Quals.hasVolatile(); }
-
bool hasObjCGCAttr() const { return Quals.hasObjCGCAttr(); }
Qualifiers::GC getObjCGCAttr() const { return Quals.getObjCGCAttr(); }
@@ -511,7 +509,7 @@ public:
/// "volatile" qualifier set, without looking through typedefs that may have
/// added "volatile" at a different level.
bool isLocalVolatileQualified() const {
- return (hasLocalNonFastQualifiers() && getExtQualsUnsafe()->hasVolatile());
+ return (getLocalFastQualifiers() & Qualifiers::Volatile);
}
/// \brief Determine whether this type is volatile-qualified.
@@ -552,10 +550,7 @@ public:
/// local to this particular QualType instance, not including any qualifiers
/// acquired through typedefs or other sugar.
unsigned getLocalCVRQualifiers() const {
- unsigned CVR = getLocalFastQualifiers();
- if (isLocalVolatileQualified())
- CVR |= Qualifiers::Volatile;
- return CVR;
+ return getLocalFastQualifiers();
}
/// \brief Retrieve the set of CVR (const-volatile-restrict) qualifiers
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index d7dedc6169..9e46e8765c 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1090,17 +1090,6 @@ QualType ASTContext::getExtQualType(const Type *TypeNode, Qualifiers Quals) {
return T;
}
-QualType ASTContext::getVolatileType(QualType T) {
- QualType CanT = getCanonicalType(T);
- if (CanT.isVolatileQualified()) return T;
-
- QualifierCollector Quals;
- const Type *TypeNode = Quals.strip(T);
- Quals.addVolatile();
-
- return getExtQualType(TypeNode, Quals);
-}
-
QualType ASTContext::getAddrSpaceQualType(QualType T, unsigned AddressSpace) {
QualType CanT = getCanonicalType(T);
if (CanT.getAddressSpace() == AddressSpace)