diff options
| author | Tim Northover <tnorthover@apple.com> | 2014-03-30 17:32:48 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2014-03-30 17:32:48 +0000 |
| commit | 65f582f432729398265e53d04560e5007cf4ca8a (patch) | |
| tree | 0a43c9a13522b047a1eff70c34ed0f51608d32a8 /clang/lib/CodeGen/CGCXXABI.h | |
| parent | 8baf17fc5fc5605460c793ea3f988e842ccd47d3 (diff) | |
| download | bcm5719-llvm-65f582f432729398265e53d04560e5007cf4ca8a.tar.gz bcm5719-llvm-65f582f432729398265e53d04560e5007cf4ca8a.zip | |
RTTI: refactor the uniqueness question into CGCXXABI.
This also brings the code into closer conformance with usual LLVM
coding style and other surrounding conventions.
llvm-svn: 205158
Diffstat (limited to 'clang/lib/CodeGen/CGCXXABI.h')
| -rw-r--r-- | clang/lib/CodeGen/CGCXXABI.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h index 783cc594361..beaec2c2217 100644 --- a/clang/lib/CodeGen/CGCXXABI.h +++ b/clang/lib/CodeGen/CGCXXABI.h @@ -484,6 +484,36 @@ public: virtual LValue EmitThreadLocalVarDeclLValue(CodeGenFunction &CGF, const VarDecl *VD, QualType LValType); + + /**************************** RTTI Uniqueness ******************************/ + +protected: + /// Returns true if the ABI requires RTTI type_info objects to be unique + /// across a program. + virtual bool shouldRTTIBeUnique() { return true; } + +public: + /// What sort of unique-RTTI behavior should we use? + enum RTTIUniquenessKind { + /// We are guaranteeing, or need to guarantee, that the RTTI string + /// is unique. + RUK_Unique, + + /// We are not guaranteeing uniqueness for the RTTI string, so we + /// can demote to hidden visibility but must use string comparisons. + RUK_NonUniqueHidden, + + /// We are not guaranteeing uniqueness for the RTTI string, so we + /// have to use string comparisons, but we also have to emit it with + /// non-hidden visibility. + RUK_NonUniqueVisible + }; + + /// Return the required visibility status for the given type and linkage in + /// the current ABI. + RTTIUniquenessKind + classifyRTTIUniqueness(QualType CanTy, + llvm::GlobalValue::LinkageTypes Linkage); }; // Create an instance of a C++ ABI class: |

