runtime: namespace LLVMSupport fork

This adds the `__swift::__runtime` inline namespace to the LLVMSupport
interfaces.  This avoids an ODR violation when LLVM and Swift are in the
same address space.  It also will aid in the process of pruning the
LLVMSupport library by ensuring that accidental leakage of the llvm
namespace does not allow us to remove symbols which we rely on.
This commit is contained in:
Saleem Abdulrasool
2020-05-11 09:29:25 -07:00
committed by Saleem Abdulrasool
parent 3fa1d1fe3f
commit b72788c27a
118 changed files with 328 additions and 84 deletions

View File

@@ -413,8 +413,8 @@ static unsigned GetAutoSenseRadix(StringRef &Str) {
return 10;
}
bool llvm::consumeUnsignedInteger(StringRef &Str, unsigned Radix,
unsigned long long &Result) {
bool __swift::__runtime::llvm::consumeUnsignedInteger(
StringRef &Str, unsigned Radix, unsigned long long &Result) {
// Autosense radix if not specified.
if (Radix == 0)
Radix = GetAutoSenseRadix(Str);
@@ -461,8 +461,8 @@ bool llvm::consumeUnsignedInteger(StringRef &Str, unsigned Radix,
return false;
}
bool llvm::consumeSignedInteger(StringRef &Str, unsigned Radix,
long long &Result) {
bool __swift::__runtime::llvm::consumeSignedInteger(
StringRef &Str, unsigned Radix, long long &Result) {
unsigned long long ULLVal;
// Handle positive strings first.
@@ -491,8 +491,8 @@ bool llvm::consumeSignedInteger(StringRef &Str, unsigned Radix,
/// GetAsUnsignedInteger - Workhorse method that converts a integer character
/// sequence of radix up to 36 to an unsigned long long value.
bool llvm::getAsUnsignedInteger(StringRef Str, unsigned Radix,
unsigned long long &Result) {
bool __swift::__runtime::llvm::getAsUnsignedInteger(
StringRef Str, unsigned Radix, unsigned long long &Result) {
if (consumeUnsignedInteger(Str, Radix, Result))
return true;
@@ -501,8 +501,8 @@ bool llvm::getAsUnsignedInteger(StringRef Str, unsigned Radix,
return !Str.empty();
}
bool llvm::getAsSignedInteger(StringRef Str, unsigned Radix,
long long &Result) {
bool __swift::__runtime::llvm::getAsSignedInteger(
StringRef Str, unsigned Radix, long long &Result) {
if (consumeSignedInteger(Str, Radix, Result))
return true;
@@ -603,6 +603,6 @@ bool StringRef::getAsDouble(double &Result, bool AllowInexact) const {
}
// Implementation of StringRef hashing.
hash_code llvm::hash_value(StringRef S) {
hash_code __swift::__runtime::llvm::hash_value(StringRef S) {
return hash_combine_range(S.begin(), S.end());
}