diff options
author | Steve Naroff <snaroff@apple.com> | 2009-02-28 16:48:43 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-02-28 16:48:43 +0000 |
commit | d123bd05cab62bb3c641d0c2343fd94e6a96235e (patch) | |
tree | 710a9706402f096e1bed6df64d28b5e65dccab2c /clang/lib/Sema/Sema.h | |
parent | 638b836aab3e6df7a568913fad46fd70225a1d21 (diff) | |
download | bcm5719-llvm-d123bd05cab62bb3c641d0c2343fd94e6a96235e.tar.gz bcm5719-llvm-d123bd05cab62bb3c641d0c2343fd94e6a96235e.zip |
Fix <rdar://problem/6451399> problems with labels and blocks.
- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).
llvm-svn: 65694
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r-- | clang/lib/Sema/Sema.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index fe8176f62fc..1b6d6c14065 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -102,15 +102,14 @@ public: /// the active block object that represents it. BlockSemaInfo *CurBlock; + /// ActiveScope - If inside of a function, method, or block definition, + /// this contains a pointer to the active scope that represents it. + Scope *ActiveScope; + /// PackContext - Manages the stack for #pragma pack. An alignment /// of 0 indicates default alignment. void *PackContext; // Really a "PragmaPackStack*" - /// LabelMap - This is a mapping from label identifiers to the LabelStmt for - /// it (which acts like the label decl in some ways). Forward referenced - /// labels have a LabelStmt created for them with a null location & SubStmt. - llvm::DenseMap<IdentifierInfo*, LabelStmt*> LabelMap; - llvm::SmallVector<SwitchStmt*, 8> SwitchStack; /// ExtVectorDecls - This is a list all the extended vector types. This allows @@ -2070,6 +2069,10 @@ struct BlockSemaInfo { /// arguments etc. Scope *TheScope; + /// PrevFunctionScope - This is the scope for the enclosing function. + /// For global blocks, this will be null. + Scope *PrevFunctionScope; + /// ReturnType - This will get set to block result type, by looking at /// return types, if any, in the block body. Type *ReturnType; |