[Basic/LangOptions] Remove std::unordered_map/unordered_set from LangOptions and use SmallVector instead.

The config options are so few that a map is not worth it currently.

Swift SVN r15476
This commit is contained in:
Argyrios Kyrtzidis
2014-03-26 00:26:17 +00:00
parent 97c89acb9a
commit f1d14c0911
7 changed files with 69 additions and 26 deletions

View File

@@ -46,9 +46,9 @@ void CompilerInstance::setTargetConfigurations(IRGenOptions &IRGenOpts,
// Set the "os" target configuration.
if (triple.isMacOSX()) {
LangOpts.TargetConfigOptions["os"] = "OSX";
LangOpts.addTargetConfigOption("os", "OSX");
} else if (triple.isiOS()) {
LangOpts.TargetConfigOptions["os"] = "iOS";
LangOpts.addTargetConfigOption("os", "iOS");
} else {
assert(false && "Unsupported target OS");
}
@@ -56,18 +56,18 @@ void CompilerInstance::setTargetConfigurations(IRGenOptions &IRGenOpts,
// Set the "arch" target configuration.
switch (triple.getArch()) {
case llvm::Triple::ArchType::arm:
LangOpts.TargetConfigOptions["arch"] = "arm";
LangOpts.addTargetConfigOption("arch", "arm");
break;
case llvm::Triple::ArchType::x86:
LangOpts.TargetConfigOptions["arch"] = "i386";
LangOpts.addTargetConfigOption("arch", "i386");
break;
case llvm::Triple::ArchType::x86_64:
LangOpts.TargetConfigOptions["arch"] = "x86_64";
LangOpts.addTargetConfigOption("arch", "x86_64");
break;
default:
// FIXME: Use `case llvm::Triple::arm64` when underlying LLVM is new enough
if (StringRef("arm64") == llvm::Triple::getArchTypeName(triple.getArch()))
LangOpts.TargetConfigOptions["arch"] = "arm64";
LangOpts.addTargetConfigOption("arch", "arm64");
break;
llvm_unreachable("Unsupported target architecture");
}