Эх сурвалжийг харах

clang-import-test had some dead code. I did the following to eliminate it:

- 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
Sean Callanan 8 жил өмнө
parent
commit
660c98f3e3

+ 0 - 4
include/clang/AST/ExternalASTMerger.h

@@ -44,10 +44,6 @@ public:
   FindExternalLexicalDecls(const DeclContext *DC,
   FindExternalLexicalDecls(const DeclContext *DC,
                            llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
                            llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
                            SmallVectorImpl<Decl *> &Result) override;
                            SmallVectorImpl<Decl *> &Result) override;
-
-   using ExternalASTSource::CompleteType;
-
-   void CompleteType(TagDecl *Tag) override;
 };
 };
 
 
 } // end namespace clang
 } // end namespace clang

+ 0 - 5
lib/AST/ExternalASTMerger.cpp

@@ -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);
-}

+ 3 - 0
test/Import/direct/Inputs/S.c

@@ -0,0 +1,3 @@
+struct S {
+  int a;
+};

+ 5 - 0
test/Import/direct/test.c

@@ -0,0 +1,5 @@
+// RUN: clang-import-test -direct -import %S/Inputs/S.c -expression %s
+void expr() {
+  struct S MyS;
+  MyS.a = 3;
+}