summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-09-01 16:38:08 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-09-01 16:38:08 +0000
commit0274487d97fa4daa8478b05dbc2e5fed9ce00493 (patch)
treed97d234b30c9732c258e7e5d8d7c6e141e5faee1
parent5f344fff089dd7685bd0013ef6f03b318819b334 (diff)
downloadbcm5719-llvm-0274487d97fa4daa8478b05dbc2e5fed9ce00493.tar.gz
bcm5719-llvm-0274487d97fa4daa8478b05dbc2e5fed9ce00493.zip
Enable -fdelayed-template-parsing by default on Win32.
I had to force -fno-delayed-template-parsing on some Index tests because delayed template parsing will change the output of some tests. llvm-svn: 138942
-rw-r--r--clang/lib/Driver/Tools.cpp5
-rw-r--r--clang/test/Index/annotate-nested-name-specifier.cpp2
-rw-r--r--clang/test/Index/annotate-tokens-cxx0x.cpp2
-rw-r--r--clang/test/Index/index-templates.cpp4
-rw-r--r--clang/test/Index/load-stmts.cpp2
-rw-r--r--clang/test/Index/preamble_macro_template.cpp4
6 files changed, 10 insertions, 9 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 1486065411d..4901bc27045 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -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
diff --git a/clang/test/Index/annotate-nested-name-specifier.cpp b/clang/test/Index/annotate-nested-name-specifier.cpp
index 7c83740f088..3189f19c9df 100644
--- a/clang/test/Index/annotate-nested-name-specifier.cpp
+++ b/clang/test/Index/annotate-nested-name-specifier.cpp
@@ -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
diff --git a/clang/test/Index/annotate-tokens-cxx0x.cpp b/clang/test/Index/annotate-tokens-cxx0x.cpp
index bf86f325fbf..9dd5aa604a2 100644
--- a/clang/test/Index/annotate-tokens-cxx0x.cpp
+++ b/clang/test/Index/annotate-tokens-cxx0x.cpp
@@ -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
diff --git a/clang/test/Index/index-templates.cpp b/clang/test/Index/index-templates.cpp
index f6040da59cd..14b22fc80a7 100644
--- a/clang/test/Index/index-templates.cpp
+++ b/clang/test/Index/index-templates.cpp
@@ -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]
diff --git a/clang/test/Index/load-stmts.cpp b/clang/test/Index/load-stmts.cpp
index cb9d3f2b609..6dd19b30d4c 100644
--- a/clang/test/Index/load-stmts.cpp
+++ b/clang/test/Index/load-stmts.cpp
@@ -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]
diff --git a/clang/test/Index/preamble_macro_template.cpp b/clang/test/Index/preamble_macro_template.cpp
index dc98927101f..1da297ee9a5 100644
--- a/clang/test/Index/preamble_macro_template.cpp
+++ b/clang/test/Index/preamble_macro_template.cpp
@@ -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]
OpenPOWER on IntegriCloud