diff options
author | Kiran Chandramohan <kiran.chandramohan@arm.com> | 2023-03-24 17:12:40 +0000 |
---|---|---|
committer | Sacha Ballantyne <Sacha.Ballantyne@arm.com> | 2023-03-29 12:01:54 +0000 |
commit | ab49747f9d67d82a1cf0f19196ff29f01d4384f5 (patch) | |
tree | 71b64ddd409dc2940cfd8f3578076dca5f74ac6f /clang/lib/CodeGen/CGVTables.cpp | |
parent | e5132d70ff3a8fc6bc6733fe56f06765962c0279 (diff) | |
download | llvm-ab49747f9d67d82a1cf0f19196ff29f01d4384f5.zip llvm-ab49747f9d67d82a1cf0f19196ff29f01d4384f5.tar.gz llvm-ab49747f9d67d82a1cf0f19196ff29f01d4384f5.tar.bz2 |
[NFC][Clang] Move DebugOptions to llvm/Frontend for reuse in Flang
This patch moves the Debug Options to llvm/Frontend so that it can be shared by Flang as well.
Reviewed By: kiranchandramohan, awarzynski
Differential Revision: https://reviews.llvm.org/D142347
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGVTables.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index a0b5d9e..173d462 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/lib/CodeGen/CGVTables.cpp @@ -1045,19 +1045,20 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) { switch (keyFunction->getTemplateSpecializationKind()) { case TSK_Undeclared: case TSK_ExplicitSpecialization: - assert((def || CodeGenOpts.OptimizationLevel > 0 || - CodeGenOpts.getDebugInfo() != codegenoptions::NoDebugInfo) && - "Shouldn't query vtable linkage without key function, " - "optimizations, or debug info"); - if (!def && CodeGenOpts.OptimizationLevel > 0) - return llvm::GlobalVariable::AvailableExternallyLinkage; - - if (keyFunction->isInlined()) - return !Context.getLangOpts().AppleKext ? - llvm::GlobalVariable::LinkOnceODRLinkage : - llvm::Function::InternalLinkage; - - return llvm::GlobalVariable::ExternalLinkage; + assert( + (def || CodeGenOpts.OptimizationLevel > 0 || + CodeGenOpts.getDebugInfo() != llvm::codegenoptions::NoDebugInfo) && + "Shouldn't query vtable linkage without key function, " + "optimizations, or debug info"); + if (!def && CodeGenOpts.OptimizationLevel > 0) + return llvm::GlobalVariable::AvailableExternallyLinkage; + + if (keyFunction->isInlined()) + return !Context.getLangOpts().AppleKext + ? llvm::GlobalVariable::LinkOnceODRLinkage + : llvm::Function::InternalLinkage; + + return llvm::GlobalVariable::ExternalLinkage; case TSK_ImplicitInstantiation: return !Context.getLangOpts().AppleKext ? |