aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-08 00:25:19 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-08 00:25:19 +0000
commit9a2b9d794bdf349b517ff799170f4409f45d147c (patch)
tree53c1d045b2f2bed194ed6d02deb38c810752f24d /lib/Sema/SemaDecl.cpp
parent3951e7106c849db72301a1ef05f99511e4818ef0 (diff)
Implement -fshort-enums (rdar://8490496).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index d0411c035a..6cb2bcf512 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -7083,6 +7083,10 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
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