Add trivial exception specs to produce better code since the methods cannot
authorChris Lattner <sabre@nondot.org>
Mon, 29 Dec 2003 21:43:58 +0000 (21:43 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Dec 2003 21:43:58 +0000 (21:43 +0000)
be inlined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10643 91177308-0d34-0410-b5e6-96231b3b80d8

include/Support/FileUtilities.h
include/llvm/Support/FileUtilities.h
lib/Support/FileUtilities.cpp

index a6a1dc2456ffb8b3da0096dbe542cec3abf5da72..978b61bfd1775bf068047fbab7987e2daec3db38 100644 (file)
@@ -113,15 +113,15 @@ class FDHandle {
 public:
   FDHandle() : FD(-1) {}
   FDHandle(int fd) : FD(fd) {}
-  ~FDHandle();
+  ~FDHandle() throw();
 
   operator int() const { return FD; }
 
-  FDHandle &operator=(int fd);
+  FDHandle &operator=(int fd) throw();
 
   /// take - Take ownership of the file descriptor away from the FDHandle
   /// object, so that the file is not closed when the FDHandle is destroyed.
-  int take();
+  int take() throw();
 };
 } // End llvm namespace
 
index a6a1dc2456ffb8b3da0096dbe542cec3abf5da72..978b61bfd1775bf068047fbab7987e2daec3db38 100644 (file)
@@ -113,15 +113,15 @@ class FDHandle {
 public:
   FDHandle() : FD(-1) {}
   FDHandle(int fd) : FD(fd) {}
-  ~FDHandle();
+  ~FDHandle() throw();
 
   operator int() const { return FD; }
 
-  FDHandle &operator=(int fd);
+  FDHandle &operator=(int fd) throw();
 
   /// take - Take ownership of the file descriptor away from the FDHandle
   /// object, so that the file is not closed when the FDHandle is destroyed.
-  int take();
+  int take() throw();
 };
 } // End llvm namespace
 
index 02b4edd557324260e9d56f15f2ff961f3884b934..5b7f7b01c51589e5a2397c878f5f502b95813b26 100644 (file)
@@ -199,11 +199,11 @@ bool llvm::MakeFileReadable(const std::string &Filename) {
 // FDHandle class implementation
 //
 
-FDHandle::~FDHandle() {
+FDHandle::~FDHandle() throw() {
   if (FD != -1) close(FD);
 }
 
-FDHandle &FDHandle::operator=(int fd) {
+FDHandle &FDHandle::operator=(int fd) throw() {
   if (FD != -1) close(FD);
   FD = fd;
   return *this;
@@ -212,7 +212,7 @@ FDHandle &FDHandle::operator=(int fd) {
 
 /// take - Take ownership of the file descriptor away from the FDHandle
 /// object, so that the file is not closed when the FDHandle is destroyed.
-int FDHandle::take() {
+int FDHandle::take() throw() {
   int Ret = FD;
   FD = -1;
   return Ret;