]> granicus.if.org Git - clang/commitdiff
clang-import-test had some dead code. I did the following to eliminate it:
authorSean Callanan <scallanan@apple.com>
Mon, 10 Jul 2017 23:47:00 +0000 (23:47 +0000)
committerSean Callanan <scallanan@apple.com>
Mon, 10 Jul 2017 23:47:00 +0000 (23:47 +0000)
- eliminated error handling for the indirect CompilerInstance, which should
  never generate an error as it is created;
- added a new test for direct importation; and
- removed an unused implementation of the CompleteType() API.

This brings clang-import-test.cpp and ExternalASTMerge.cpp back to 100%
coverage on all metrics measured by DLLVM_BUILD_INSTRUMENTED_COVERAGE.

Differential Revision: https://reviews.llvm.org/D35220

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

include/clang/AST/ExternalASTMerger.h
lib/AST/ExternalASTMerger.cpp
test/Import/direct/Inputs/S.c [new file with mode: 0644]
test/Import/direct/test.c [new file with mode: 0644]

index 92d7b39c48d2ff0b3c29012dd383d7d7d6ae2586..51d0c30ad23bf5b7b897e126bd87229ba030e996 100644 (file)
@@ -44,10 +44,6 @@ public:
   FindExternalLexicalDecls(const DeclContext *DC,
                            llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
                            SmallVectorImpl<Decl *> &Result) override;
-
-   using ExternalASTSource::CompleteType;
-
-   void CompleteType(TagDecl *Tag) override;
 };
 
 } // end namespace clang
index b746edaf643991a5668d7e4ba2220aa8e18a36b0..4f4a99794c5b074f0270c5568808d4748c3445fd 100644 (file)
@@ -180,8 +180,3 @@ void ExternalASTMerger::FindExternalLexicalDecls(
       });
 }
 
-void ExternalASTMerger::CompleteType(TagDecl *Tag) {
-  SmallVector<Decl *, 0> Result;
-  FindExternalLexicalDecls(Tag, [](Decl::Kind) { return true; }, Result);
-  Tag->setHasExternalLexicalStorage(false);
-}
diff --git a/test/Import/direct/Inputs/S.c b/test/Import/direct/Inputs/S.c
new file mode 100644 (file)
index 0000000..b0876d2
--- /dev/null
@@ -0,0 +1,3 @@
+struct S {
+  int a;
+};
diff --git a/test/Import/direct/test.c b/test/Import/direct/test.c
new file mode 100644 (file)
index 0000000..5fac24c
--- /dev/null
@@ -0,0 +1,5 @@
+// RUN: clang-import-test -direct -import %S/Inputs/S.c -expression %s
+void expr() {
+  struct S MyS;
+  MyS.a = 3;
+}