]> granicus.if.org Git - clang/commitdiff
PCHReader doesn't implement classof so dyn_casting it will do really weird stuff...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 30 Jan 2010 16:23:25 +0000 (16:23 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 30 Jan 2010 16:23:25 +0000 (16:23 +0000)
I don't know if this hack is the right fix. Doug, please take a look.

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

lib/Frontend/ASTUnit.cpp
test/Index/remap-load.c

index ff19810233b7c8112ffc9b0355bc46ca5bb1a0fa..eaa2062c862f15faa86003e14582316b545e3ed9 100644 (file)
@@ -98,7 +98,7 @@ const std::string &ASTUnit::getOriginalSourceFileName() {
 
 const std::string &ASTUnit::getPCHFileName() {
   assert(isMainFileAST() && "Not an ASTUnit from a PCH file!");
-  return dyn_cast<PCHReader>(Ctx->getExternalSource())->getFileName();
+  return static_cast<PCHReader *>(Ctx->getExternalSource())->getFileName();
 }
 
 ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename,
index 1e9d729a40bfd8ff13cf4dbf99c188c02f1acf8b..637b1673f638d3cce1b2e6a809dd0c6f7859709d 100644 (file)
@@ -1,15 +1,11 @@
-// UN: c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s
-// UN: CINDEXTEST_USE_EXTERNAL_AST_GENERATION=1 c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s
-
-// disable this for now, it's failing sporadically.
-// RUN: false
-// XFAIL: *
+// RUN: c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s
+// RUN: CINDEXTEST_USE_EXTERNAL_AST_GENERATION=1 c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s
 
 // CHECK: remap-load.c:1:5: FunctionDecl=foo:1:5 (Definition) [Extent=1:5:3:1]
 // CHECK: remap-load.c:1:13: ParmDecl=parm1:1:13 (Definition) [Extent=1:9:1:17]
 // CHECK: remap-load.c:1:26: ParmDecl=parm2:1:26 (Definition) [Extent=1:20:1:30]
-// CHECK: remap-load.c:1:5: UnexposedStmt=foo [Extent=1:33:3:1]
-// CHECK: remap-load.c:1:5: UnexposedStmt=foo [Extent=2:3:2:22]
+// CHECK: remap-load.c:1:5: UnexposedStmt= [Extent=1:33:3:1]
+// CHECK: remap-load.c:1:5: UnexposedStmt= [Extent=2:3:2:22]
 // CHECK: remap-load.c:2:10: UnexposedExpr= [Extent=2:10:2:22]
 // CHECK: remap-load.c:2:10: UnexposedExpr= [Extent=2:10:2:22]
 // CHECK: remap-load.c:2:10: UnexposedExpr=parm1:1:13 [Extent=2:10:2:14]