diff options
| author | Michael J. Spencer <bigcheesegs@gmail.com> | 2012-06-18 07:00:48 +0000 |
|---|---|---|
| committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2012-06-18 07:00:48 +0000 |
| commit | f97bd8c9cbebda523df6dfecd32283f23985ee84 (patch) | |
| tree | e6c279bbb950570d415c10d335beb47466f0e317 /clang/lib/Sema | |
| parent | 7b3f322517c2e026d2326e49ecf9bef1edb6e59d (diff) | |
| download | bcm5719-llvm-f97bd8c9cbebda523df6dfecd32283f23985ee84.tar.gz bcm5719-llvm-f97bd8c9cbebda523df6dfecd32283f23985ee84.zip | |
[MSExtensions] Add support for __forceinline.
__forceinline is a combination of the inline keyword and __attribute__((always_inline))
llvm-svn: 158653
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 516f6976522..b8df752b38d 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3888,6 +3888,13 @@ static void handlePortabilityAttr(Sema &S, Decl *D, const AttributeList &Attr) { S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); } +static void handleForceInlineAttr(Sema &S, Decl *D, const AttributeList &Attr) { + if (S.LangOpts.MicrosoftExt) + D->addAttr(::new (S.Context) ForceInlineAttr(Attr.getRange(), S.Context)); + else + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); +} + //===----------------------------------------------------------------------===// // Top Level Sema Entry Points //===----------------------------------------------------------------------===// @@ -4082,6 +4089,9 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_ptr64: handlePortabilityAttr(S, D, Attr); break; + case AttributeList::AT_forceinline: + handleForceInlineAttr(S, D, Attr); + break; // Thread safety attributes: case AttributeList::AT_guarded_var: |

