Rename getBuiltinValue -> getBuiltinValueDecl since it doesn't

produce a value, it produces a decl.



Swift SVN r10697
This commit is contained in:
Chris Lattner
2013-12-01 02:13:45 +00:00
parent 5a29366de5
commit ecfba9fb53
4 changed files with 12 additions and 17 deletions

View File

@@ -86,19 +86,19 @@ llvm::Intrinsic::ID
getLLVMIntrinsicIDForBuiltinWithOverflow(BuiltinValueKind ID);
/// \brief Finds the builtin value with the given name.
/// \brief Create a ValueDecl for the builtin with the given name.
///
/// Returns null if the name does not identifier a known builtin value.
ValueDecl *getBuiltinValue(ASTContext &Context, Identifier Name);
ValueDecl *getBuiltinValueDecl(ASTContext &Context, Identifier Name);
/// \brief The information identifying the builtin - it's kind and types.
/// \brief The information identifying the builtin - its kind and types.
struct BuiltinInfo {
BuiltinValueKind ID;
SmallVector<Type, 4> Types;
bool isReadNone() const;
};
/// \brief The information identifying the llvm intrinsic - it's id and types.
/// \brief The information identifying the llvm intrinsic - its id and types.
struct IntrinsicInfo {
llvm::Intrinsic::ID ID;
SmallVector<Type, 4> Types;

View File

@@ -880,7 +880,7 @@ static bool isValidAtomicOrdering(StringRef Ordering) {
Ordering == "acqrel" || Ordering == "seqcst";
}
ValueDecl *swift::getBuiltinValue(ASTContext &Context, Identifier Id) {
ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
SmallVector<Type, 4> Types;
StringRef OperationName = getBuiltinBaseName(Context, Id.str(), Types);

View File

@@ -77,7 +77,7 @@ BuiltinModule::LookupCache::lookupValue(Identifier Name, NLKind LookupKind,
MutableArrayRef<TypeLoc>());
if (Entry == 0)
Entry = getBuiltinValue(M.Ctx, Name);
Entry = getBuiltinValueDecl(M.Ctx, Name);
if (Entry)
Result.push_back(Entry);

View File

@@ -15,7 +15,6 @@
#include "swift/SIL/SILValue.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/StringSwitch.h"
using namespace swift;
namespace swift {
@@ -35,8 +34,7 @@ namespace swift {
};
} // end namespace swift.
void SILExternalSource::anchor()
{
void SILExternalSource::anchor() {
}
/// SILTypeListUniquingType - This is the type of the folding set maintained by
@@ -44,8 +42,7 @@ void SILExternalSource::anchor()
typedef llvm::FoldingSet<SILTypeList> SILTypeListUniquingType;
SILModule::SILModule(Module *SwiftModule)
: TheSwiftModule(SwiftModule), Stage(SILStage::Raw), Types(*this)
{
: TheSwiftModule(SwiftModule), Stage(SILStage::Raw), Types(*this) {
TypeListUniquing = new SILTypeListUniquingType();
}
@@ -125,15 +122,13 @@ const BuiltinInfo &SILModule::getBuiltinInfo(Identifier ID) {
// Several operation names have suffixes and don't match the name from
// Builtins.def, so handle those first.
if (OperationName.startswith("fence_")) {
if (OperationName.startswith("fence_"))
Info.ID = BuiltinValueKind::Fence;
} else
if (OperationName.startswith("cmpxchg_")) {
else if (OperationName.startswith("cmpxchg_"))
Info.ID = BuiltinValueKind::CmpXChg;
} else
if (OperationName.startswith("atomicrmw_")) {
else if (OperationName.startswith("atomicrmw_"))
Info.ID = BuiltinValueKind::AtomicRMW;
} else {
else {
// Switch through the rest of builtins.
Info.ID = llvm::StringSwitch<BuiltinValueKind>(OperationName)
#define BUILTIN(ID, Name, Attrs) \