aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriterDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-09 09:09:27 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-09 09:09:27 +0000
commit842aef8d942a880eeb9535d40de31a86838264cb (patch)
tree389c0e27fb6c98f56bce032e96f43ba8bcd8041b /lib/Frontend/PCHWriterDecl.cpp
parent2f4a6b25a7409f6f05e8a5e6864de21a337c8958 (diff)
First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to determine which type to promote to. This type obeys C++ [conv.prom]p2 and is therefore generally signed unless the range of the enumerators forces it to be unsigned. Kills off a lot of false positives from -Wsign-compare in C++, addressing rdar://7455616 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriterDecl.cpp')
-rw-r--r--lib/Frontend/PCHWriterDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp
index 1ba113e14e..049cdb03ea 100644
--- a/lib/Frontend/PCHWriterDecl.cpp
+++ b/lib/Frontend/PCHWriterDecl.cpp
@@ -123,6 +123,7 @@ void PCHDeclWriter::VisitTagDecl(TagDecl *D) {
void PCHDeclWriter::VisitEnumDecl(EnumDecl *D) {
VisitTagDecl(D);
Writer.AddTypeRef(D->getIntegerType(), Record);
+ Writer.AddTypeRef(D->getPromotionType(), Record);
// FIXME: C++ InstantiatedFrom
Code = pch::DECL_ENUM;
}