diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-08 20:05:47 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-08 20:05:47 +0000 |
commit | 6f0200e9ebf7f65df74b3cf55b4319b075b244a2 (patch) | |
tree | 6f6f3299166d4918242defde2c9f30c55a827077 /lib/Sema/SemaDecl.cpp | |
parent | 3e98e513d6550c709083082c6c5eb5dc47f0b209 (diff) |
Add ThreadSpecified bit to Decl.
- Patch from Kevin Tew.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 75fcc5173e..cf84bcc5e1 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -743,6 +743,7 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { D.getIdentifierLoc(), II, R, LastDeclarator); } else { + bool ThreadSpecified = D.getDeclSpec().isThreadSpecified(); if (S->getFnParent() == 0) { // C99 6.9p2: The storage-class specifiers auto and register shall not // appear in the declaration specifiers in an external declaration. @@ -751,12 +752,10 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { R.getAsString()); InvalidDecl = true; } - NewVD = VarDecl::Create(Context, CurContext, D.getIdentifierLoc(), - II, R, SC, LastDeclarator); - } else { - NewVD = VarDecl::Create(Context, CurContext, D.getIdentifierLoc(), - II, R, SC, LastDeclarator); } + NewVD = VarDecl::Create(Context, CurContext, D.getIdentifierLoc(), + II, R, SC, LastDeclarator); + NewVD->setThreadSpecified(ThreadSpecified); } // Handle attributes prior to checking for duplicates in MergeVarDecl ProcessDeclAttributes(NewVD, D); |