]> granicus.if.org Git - clang/commitdiff
Enable -fdelayed-template-parsing by default on Win32.
authorFrancois Pichet <pichet2000@gmail.com>
Thu, 1 Sep 2011 16:38:08 +0000 (16:38 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Thu, 1 Sep 2011 16:38:08 +0000 (16:38 +0000)
I had to force -fno-delayed-template-parsing on some Index tests because delayed template parsing will change the output of some tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138942 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Index/annotate-nested-name-specifier.cpp
test/Index/annotate-tokens-cxx0x.cpp
test/Index/index-templates.cpp
test/Index/load-stmts.cpp
test/Index/preamble_macro_template.cpp

index 1486065411d4ad97b301a4818b07bcfb4ae67478..4901bc27045500b528bc59a108ea6340e9912330 100644 (file)
@@ -1782,10 +1782,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                    options::OPT_fno_borland_extensions, false))
     CmdArgs.push_back("-fborland-extensions");
 
-  // -fno-delayed-template-parsing is default.
+  // -fno-delayed-template-parsing is default, except for Windows where MSVC STL
+  // needs it.
   if (Args.hasFlag(options::OPT_fdelayed_template_parsing,
                    options::OPT_fno_delayed_template_parsing,
-                   false))
+                   getToolChain().getTriple().getOS() == llvm::Triple::Win32))
     CmdArgs.push_back("-fdelayed-template-parsing");
 
   // -fgnu-keywords default varies depending on language; only pass if
index 7c83740f0888cde264853a27e75a61686140caa3..3189f19c9dff1c0a62add157aeb25c49d153fd04 100644 (file)
@@ -137,7 +137,7 @@ struct X9 : X8 {
   }
 };
 
-// RUN: c-index-test -test-annotate-tokens=%s:13:1:137:1 %s | FileCheck %s
+// RUN: c-index-test -test-annotate-tokens=%s:13:1:137:1 -fno-delayed-template-parsing %s | FileCheck %s
 
 // CHECK: Keyword: "using" [14:1 - 14:6] UsingDeclaration=vector[4:12]
 // CHECK: Identifier: "outer_alias" [14:7 - 14:18] NamespaceRef=outer_alias:10:11
index bf86f325fbfa7290d6ec69d7a51f7e010c57d735..9dd5aa604a269cf082712a267f8ba197d9067745 100644 (file)
@@ -8,7 +8,7 @@ void test() {
   decltype(a) b;
 }
 
-// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -std=c++0x %s | FileCheck %s
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -fno-delayed-template-parsing -std=c++0x %s | FileCheck %s
 // CHECK: Identifier: "args" [3:20 - 3:24] UnexposedExpr=args:2:15
 // CHECK: Identifier: "Args" [3:38 - 3:42] TypeRef=Args:1:22
 
index f6040da59cdf19e7bdb8bdf20f594fdc6195f28e..14b22fc80a788f99b8cf0fe5ec5f214c3ab5af7d 100644 (file)
@@ -100,7 +100,7 @@ template class Pair<int, int>;
 template<typename T, typename U>
 struct SuperPair : Pair<int, int>, Pair<T, U> { };
 
-// RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix=CHECK-LOAD %s
+// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing %s | FileCheck -check-prefix=CHECK-LOAD %s
 // CHECK-LOAD: index-templates.cpp:4:6: FunctionTemplate=f:4:6 Extent=[3:1 - 4:22]
 // CHECK-LOAD: index-templates.cpp:3:19: TemplateTypeParameter=T:3:19 (Definition) Extent=[3:10 - 3:20]
 // CHECK-LOAD: index-templates.cpp:3:24: NonTypeTemplateParameter=Value:3:24 (Definition) Extent=[3:22 - 3:29]
@@ -180,7 +180,7 @@ struct SuperPair : Pair<int, int>, Pair<T, U> { };
 // CHECK-LOAD: index-templates.cpp:101:36: C++ base class specifier=Pair<T, U>:76:8 [access=public isVirtual=false] Extent=[101:36 - 101:46]
 
 
-// RUN: c-index-test -test-load-source-usrs all %s | FileCheck -check-prefix=CHECK-USRS %s
+// RUN: c-index-test -test-load-source-usrs all -fno-delayed-template-parsing %s | FileCheck -check-prefix=CHECK-USRS %s
 // CHECK-USRS: index-templates.cpp c:@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22S0_# Extent=[3:1 - 4:22]
 // CHECK-USRS: index-templates.cpp c:index-templates.cpp@70 Extent=[3:10 - 3:20]
 // CHECK-USRS: index-templates.cpp c:index-templates.cpp@82 Extent=[3:22 - 3:29]
index cb9d3f2b609f20344709b18b9c228d66dca34803..6dd19b30d4cfe86e4d0b98b01d781ee074b3eb1a 100644 (file)
@@ -117,7 +117,7 @@ void casts(int *ip) {
   (void)reinterpret_cast<float *>(ip);
 }
 
-// RUN: c-index-test -test-load-source all %s | FileCheck %s
+// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing %s | FileCheck %s
 // CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:1 - 1:14]
 // CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23]
 // CHECK: load-stmts.cpp:2:16: FieldDecl=a:2:16 (Definition) Extent=[2:12 - 2:17]
index dc98927101ff9fe3f73ebea70331a1e33469ca80..1da297ee9a5279d825ec0a8e26c7cd6a963e4419 100644 (file)
@@ -2,8 +2,8 @@ template void foo(int *);
 
 int main() { }
 
-// RUN: c-index-test -write-pch %t.pch -x c++-header %S/Inputs/preamble_macro_template.h
-// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -I %S/Inputs -include %t %s | FileCheck %s
+// RUN: c-index-test -write-pch %t.pch -fno-delayed-template-parsing -x c++-header %S/Inputs/preamble_macro_template.h
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -fno-delayed-template-parsing -I %S/Inputs -include %t %s | FileCheck %s
 // CHECK: preamble_macro_template.h:4:6: FunctionDecl=foo:4:6 (Definition) [Specialization of foo:4:6] Extent=[4:1 - 6:2]
 // CHECK: preamble_macro_template.h:4:13: ParmDecl=p:4:13 (Definition) Extent=[4:10 - 4:14]
 // CHECK: preamble_macro_template.h:4:16: UnexposedStmt= Extent=[4:16 - 6:2]