Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Enable sized deallocation by default in C++14 onwards
Since C++14 has been released for about nine years and most standard libraries have implemented sized deallocation functions, it's time to make this feature default again. Reviewed By: rnk, aaron.ballman, #libc, ldionne, Mordante, MaskRay Differential Revision: https://reviews.llvm.org/D112921
- Loading branch information
Showing
40 changed files
with
446 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//===------- SizedDellocation.h - Sized Deallocation ------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// Defines a function that returns the minimum OS versions supporting | ||
/// C++14's sized deallocation functions. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_CLANG_BASIC_SIZEDDEALLOCATION_H | ||
#define LLVM_CLANG_BASIC_SIZEDDEALLOCATION_H | ||
|
||
#include "llvm/Support/ErrorHandling.h" | ||
#include "llvm/Support/VersionTuple.h" | ||
#include "llvm/TargetParser/Triple.h" | ||
|
||
namespace clang { | ||
inline llvm::VersionTuple sizedDeallocMinVersion(llvm::Triple::OSType OS) { | ||
switch (OS) { | ||
default: | ||
break; | ||
case llvm::Triple::Darwin: | ||
case llvm::Triple::MacOSX: // Earliest supporting version is 10.12. | ||
return llvm::VersionTuple(10U, 12U); | ||
case llvm::Triple::IOS: | ||
case llvm::Triple::TvOS: // Earliest supporting version is 10.0.0. | ||
return llvm::VersionTuple(10U); | ||
case llvm::Triple::WatchOS: // Earliest supporting version is 3.0.0. | ||
return llvm::VersionTuple(3U); | ||
case llvm::Triple::ZOS: | ||
return llvm::VersionTuple(); // All z/OS versions have no support. | ||
} | ||
|
||
llvm_unreachable("Unexpected OS"); | ||
} | ||
|
||
} // end namespace clang | ||
|
||
#endif // LLVM_CLANG_BASIC_SIZEDDEALLOCATION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.