diff options
author | Juergen Ributzka <juergen@apple.com> | 2013-11-19 03:08:35 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2013-11-19 03:08:35 +0000 |
commit | 05c5a93283b830032532321fdc4c0fe6b8473aac (patch) | |
tree | a6dd62ef804f1e97d576d5741db7fb04f1ce771e /llvm/examples/ExceptionDemo/ExceptionDemo.cpp | |
parent | ef9315d942a0499141769e3c53c8830ee1e74841 (diff) | |
download | llvm-05c5a93283b830032532321fdc4c0fe6b8473aac.zip llvm-05c5a93283b830032532321fdc4c0fe6b8473aac.tar.gz llvm-05c5a93283b830032532321fdc4c0fe6b8473aac.tar.bz2 |
[weak vtables] Place class definitions into anonymous namespaces to prevent weak vtables.
This patch places class definitions in implementation files into anonymous
namespaces to prevent weak vtables. This eliminates the need of providing an
out-of-line definition to pin the vtable explicitly to the file.
llvm-svn: 195092
Diffstat (limited to 'llvm/examples/ExceptionDemo/ExceptionDemo.cpp')
-rw-r--r-- | llvm/examples/ExceptionDemo/ExceptionDemo.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp index 6a0d0d0..d6954e8 100644 --- a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1562,7 +1562,7 @@ llvm::Function *createUnwindExceptionTest(llvm::Module &module, return(outerCatchFunct); } - +namespace { /// Represents our foreign exceptions class OurCppRunException : public std::runtime_error { public: @@ -1577,11 +1577,9 @@ public: std::runtime_error::operator=(toCopy))); } - ~OurCppRunException (void) throw (); + virtual ~OurCppRunException (void) throw () {} }; - -// Provide out-of-line definition to prevent weak vtable. -OurCppRunException::~OurCppRunException() throw () {} +} // end anonymous namespace /// Throws foreign C++ exception. /// @param ignoreIt unused parameter that allows function to match implied |