Implement -fshort-enums (rdar://8490496).
llvm-svn: 116020
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d0411c0..6cb2bcf 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7083,6 +7083,10 @@
QualType BestPromotionType;
bool Packed = Enum->getAttr<PackedAttr>() ? true : false;
+ // -fshort-enums is the equivalent to specifying the packed attribute on all
+ // enum definitions.
+ if (LangOpts.ShortEnums)
+ Packed = true;
if (NumNegativeBits) {
// If there is a negative value, figure out the smallest integer type (of