diff options
| author | David Chisnall <csdavec@swan.ac.uk> | 2010-12-26 20:12:30 +0000 |
|---|---|---|
| committer | David Chisnall <csdavec@swan.ac.uk> | 2010-12-26 20:12:30 +0000 |
| commit | 6f0a7d224ba63284f17c02e8052a038b7b6105ca (patch) | |
| tree | 99b927d15b4d7981c446ccbf23c5d7d7985c8ec8 | |
| parent | 81ae3f299a07dd93aa7c49ad0b64fcf935f740e9 (diff) | |
| download | bcm5719-llvm-6f0a7d224ba63284f17c02e8052a038b7b6105ca.tar.gz bcm5719-llvm-6f0a7d224ba63284f17c02e8052a038b7b6105ca.zip | |
Fix for PR8695.
llvm-svn: 122564
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 5 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/bitfield-gnu.m | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index eb6a8217839..b1fd16fb07b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -3785,7 +3785,10 @@ static void EncodeBitField(const ASTContext *Context, std::string& S, break; } S += llvm::utostr(RL.getFieldOffset(i)); - S += ObjCEncodingForPrimitiveKind(Context, T); + if (T->isEnumeralType()) + S += 'i'; + else + S += ObjCEncodingForPrimitiveKind(Context, T); } unsigned N = E->EvaluateAsInt(*Ctx).getZExtValue(); S += llvm::utostr(N); diff --git a/clang/test/CodeGenObjC/bitfield-gnu.m b/clang/test/CodeGenObjC/bitfield-gnu.m new file mode 100644 index 00000000000..7935bdaacf0 --- /dev/null +++ b/clang/test/CodeGenObjC/bitfield-gnu.m @@ -0,0 +1,5 @@ +// RUN: %clang -S -emit-llvm -fgnu-runtime -o %t %s +typedef enum { A1, A2 } A; +typedef struct { A a : 1; } B; +@interface Obj { B *b; } @end +@implementation Obj @end |

