From 450f79340808e54cd4b39738f943217f6fc0c2be Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 28 May 2010 19:43:33 +0000 Subject: [PATCH] Sema: Just ignore '#pragma options align=power' for now, this is no worse than what we used to be doing, and makes sure that paired '#pragma options align=reset' won't fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104998 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaAttr.cpp | 7 ++++++- test/Parser/pragma-options.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp index fcf5bfd669..df68f53da6 100644 --- a/lib/Sema/SemaAttr.cpp +++ b/lib/Sema/SemaAttr.cpp @@ -135,7 +135,6 @@ void Sema::ActOnPragmaOptionsAlign(PragmaOptionsAlignKind Kind, return; } - // We don't support #pragma options align=power. switch (Kind) { // For all targets we support native and natural are the same. // @@ -146,6 +145,12 @@ void Sema::ActOnPragmaOptionsAlign(PragmaOptionsAlignKind Kind, Context->setAlignment(0); break; + // FIXME: We just ignore #pragma options align=power for now. + case POAK_Power: + Context->push(0); + Context->setAlignment(0); + break; + // Note that '#pragma options align=packed' is not equivalent to attribute // packed, it has a different precedence relative to attribute aligned. case POAK_Packed: diff --git a/test/Parser/pragma-options.c b/test/Parser/pragma-options.c index 332249fdcf..daf385dddb 100644 --- a/test/Parser/pragma-options.c +++ b/test/Parser/pragma-options.c @@ -9,4 +9,4 @@ #pragma options align=natural #pragma options align=reset #pragma options align=mac68k -/* expected-warning {{unsupported alignment option}} */ #pragma options align=power +#pragma options align=power -- 2.40.0