summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-04 15:25:02 +0000
committerAlp Toker <alp@nuanti.com>2014-01-04 15:25:02 +0000
commite1fab52688af31c9ab357616801c4a004660112c (patch)
tree107fb660e9ed806496957c470991e5c20f0d160d /clang/lib/Sema
parentef6b007dc5ff1290d48d71736fc5dc0f4c154331 (diff)
downloadbcm5719-llvm-e1fab52688af31c9ab357616801c4a004660112c.tar.gz
bcm5719-llvm-e1fab52688af31c9ab357616801c4a004660112c.zip
Move MS predefined type_info out of InitializePredefinedMacros
Instead of keeping it in amongst the macros, build the declaration at Sema init the same way we do with other predeclared and builtin types. In practice this means the declaration is marked implicit and therefore won't show up as an unwanted user-declared type in tooling which has been a frequently reported issue (though I haven't been able to cook up a test). llvm-svn: 198497
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/Sema.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 9a00783da1e..35fd86fd251 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -178,6 +178,13 @@ void Sema::Initialize() {
PushOnScopeChains(Context.getObjCProtocolDecl(), TUScope);
}
+ // Initialize Microsoft "predefined C++ types".
+ if (PP.getLangOpts().MicrosoftExt && PP.getLangOpts().CPlusPlus) {
+ if (IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
+ PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class),
+ TUScope);
+ }
+
// Initialize predefined OpenCL types.
if (PP.getLangOpts().OpenCL) {
addImplicitTypedef("image1d_t", Context.OCLImage1dTy);
OpenPOWER on IntegriCloud