diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-12-18 19:19:00 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-12-18 19:19:00 +0000 |
| commit | ecc159aae7002f76951b26197dbab83ca3df4ca0 (patch) | |
| tree | 8cfcda7b08525c827fa7668af1143279bf379fe4 /lib/CodeGen/ModuleBuilder.cpp | |
| parent | 9e8f0d3f6a9745e556dfba30457dff380b22bd15 (diff) | |
| download | clang-ecc159aae7002f76951b26197dbab83ca3df4ca0.tar.gz | |
ModuleBuilder: assert that all deferred inline method defs get handled
While we're here, also move the declaration of DeferredInlineMethodDefinitions
closer to the other member vars and make it a SmallVector. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ModuleBuilder.cpp')
| -rw-r--r-- | lib/CodeGen/ModuleBuilder.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp index ee6f6f94c7..bf89a2f032 100644 --- a/lib/CodeGen/ModuleBuilder.cpp +++ b/lib/CodeGen/ModuleBuilder.cpp @@ -52,6 +52,9 @@ namespace { std::unique_ptr<llvm::Module> M; std::unique_ptr<CodeGen::CodeGenModule> Builder; + private: + SmallVector<CXXMethodDecl *, 8> DeferredInlineMethodDefinitions; + public: CodeGeneratorImpl(DiagnosticsEngine &diags, const std::string& ModuleName, const CodeGenOptions &CGO, llvm::LLVMContext& C, @@ -60,7 +63,10 @@ namespace { CoverageInfo(CoverageInfo), M(new llvm::Module(ModuleName, C)) {} - virtual ~CodeGeneratorImpl() {} + virtual ~CodeGeneratorImpl() { + assert(DeferredInlineMethodDefinitions.empty() && + "Leftover inline method definitions!"); + } llvm::Module* GetModule() override { return M.get(); @@ -223,9 +229,6 @@ namespace { void HandleDependentLibrary(llvm::StringRef Lib) override { Builder->AddDependentLib(Lib); } - - private: - std::vector<CXXMethodDecl *> DeferredInlineMethodDefinitions; }; } |
