summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-17 07:39:24 +0000
committerChris Lattner <sabre@nondot.org>2011-02-17 07:39:24 +0000
commitc8e630e4db137cbe4bb28193f83c4092e24fd502 (patch)
treea98339a71fb56d6625a8475b69a92acb5ece8180 /clang/lib/AST/DeclBase.cpp
parentf7b2c93b2f50270fa921c6c90358e92ad3b1c702 (diff)
downloadbcm5719-llvm-c8e630e4db137cbe4bb28193f83c4092e24fd502.tar.gz
bcm5719-llvm-c8e630e4db137cbe4bb28193f83c4092e24fd502.zip
Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 110de64d8cd..dfc5a6ae5d3 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -269,7 +269,8 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) {
case ObjCMethod:
case ObjCProperty:
return IDNS_Ordinary;
-
+ case Label:
+ return IDNS_Label;
case IndirectField:
return IDNS_Ordinary | IDNS_Member;
OpenPOWER on IntegriCloud