summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-02-25 02:44:04 +0000
committerAdrian Prantl <aprantl@apple.com>2015-02-25 02:44:04 +0000
commit9f65c5634036e08cee3ab904b1e3a23990a2caa0 (patch)
treec11c417e51caa207941044dfdbc08be42f4e9916
parentd68bbb9e7a282ca31b30f26b7d5d1aee436cdd25 (diff)
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230454 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/PCHInternals.rst3
-rw-r--r--include/clang/CodeGen/CodeGenModuleContainer.h34
-rw-r--r--include/clang/Frontend/FrontendActions.h8
-rw-r--r--include/clang/Serialization/ASTReader.h4
-rw-r--r--include/clang/Serialization/ASTWriter.h18
-rw-r--r--lib/CodeGen/CMakeLists.txt2
-rw-r--r--lib/CodeGen/CodeGenModuleContainer.cpp150
-rw-r--r--lib/Frontend/ASTUnit.cpp18
-rw-r--r--lib/Frontend/CMakeLists.txt1
-rw-r--r--lib/Frontend/ChainedIncludesSource.cpp16
-rw-r--r--lib/Frontend/FrontendActions.cpp40
-rw-r--r--lib/Frontend/MultiplexConsumer.cpp27
-rw-r--r--lib/Serialization/ASTReader.cpp34
-rw-r--r--lib/Serialization/CMakeLists.txt1
-rw-r--r--lib/Serialization/GeneratePCH.cpp18
-rw-r--r--lib/Serialization/GlobalModuleIndex.cpp5
-rw-r--r--lib/Serialization/ModuleManager.cpp9
-rw-r--r--test/ARCMT/check-with-pch.m1
-rw-r--r--test/ARCMT/migrate-on-pch-and-module.m1
-rw-r--r--test/ARCMT/objcmt-with-pch.m1
-rw-r--r--test/ARCMT/objcmt-with-pch.m.result1
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp1
-rw-r--r--test/CodeGen/atomic-ops.c1
-rw-r--r--test/CodeGen/big-atomic-ops.c2
-rw-r--r--test/Frontend/ast-codegen.c1
-rw-r--r--test/Index/TestClassForwardDecl.m2
-rw-r--r--test/Index/c-index-api-loadTU-test.m2
-rw-r--r--test/Index/c-index-getCursor-test.m1
-rw-r--r--test/Index/pch-with-module.m1
-rw-r--r--test/Index/print-mangled-name.cpp1
-rw-r--r--test/Modules/dependency-gen-inferred-map.m1
-rw-r--r--test/Modules/dependency-gen-pch.m1
-rw-r--r--test/Modules/irgen.c1
-rw-r--r--test/Modules/module_container.m14
-rw-r--r--test/Modules/self-import-header.m2
-rw-r--r--test/Modules/templates-2.mm2
-rw-r--r--test/Modules/templates.mm2
-rw-r--r--test/Modules/va_list.m1
-rw-r--r--test/OpenMP/atomic_read_codegen.c2
-rw-r--r--test/OpenMP/barrier_codegen.cpp2
-rw-r--r--test/OpenMP/critical_codegen.cpp2
-rw-r--r--test/OpenMP/flush_codegen.cpp2
-rw-r--r--test/OpenMP/for_codegen.cpp2
-rw-r--r--test/OpenMP/master_codegen.cpp2
-rw-r--r--test/OpenMP/parallel_codegen.cpp2
-rw-r--r--test/OpenMP/parallel_private_codegen.cpp2
-rw-r--r--test/OpenMP/simd_codegen.cpp2
-rw-r--r--test/OpenMP/single_codegen.cpp2
-rw-r--r--test/OpenMP/taskyield_codegen.cpp2
-rw-r--r--test/OpenMP/threadprivate_codegen.cpp2
-rw-r--r--test/PCH/__va_list_tag.c1
-rw-r--r--test/PCH/arc.m1
-rw-r--r--test/PCH/asm.c1
-rw-r--r--test/PCH/chain-external-defs.c1
-rw-r--r--test/PCH/chain-trivial.c1
-rw-r--r--test/PCH/cxx-ms-function-specialization-class-scope.cpp1
-rw-r--r--test/PCH/external-defs.c1
-rw-r--r--test/PCH/floating-literal.c1
-rw-r--r--test/PCH/local_static.cpp1
-rw-r--r--test/PCH/pchpch.c1
-rw-r--r--test/PCH/reloc.c1
-rw-r--r--test/PCH/subscripting-literals.m1
-rw-r--r--test/PCH/target-options.c1
-rw-r--r--test/PCH/tentative-defs.c1
-rw-r--r--test/PCH/thread-local.cpp2
-rw-r--r--test/PCH/va_arg.c1
-rw-r--r--test/PCH/va_arg.cpp1
-rw-r--r--tools/arcmt-test/Makefile6
-rw-r--r--tools/c-arcmt-test/Makefile5
-rw-r--r--tools/c-index-test/Makefile6
-rw-r--r--tools/clang-check/Makefile5
-rw-r--r--tools/diagtool/Makefile2
-rw-r--r--tools/libclang/CMakeLists.txt1
-rw-r--r--tools/libclang/Makefile5
-rw-r--r--unittests/AST/Makefile5
-rw-r--r--unittests/ASTMatchers/Dynamic/Makefile11
-rw-r--r--unittests/ASTMatchers/Makefile5
-rw-r--r--unittests/CodeGen/Makefile6
-rw-r--r--unittests/Frontend/Makefile3
-rw-r--r--unittests/Sema/Makefile5
-rw-r--r--unittests/Tooling/Makefile5
-rw-r--r--unittests/libclang/Makefile5
83 files changed, 91 insertions, 456 deletions
diff --git a/docs/PCHInternals.rst b/docs/PCHInternals.rst
index d247d3ed0a..a36e65c199 100644
--- a/docs/PCHInternals.rst
+++ b/docs/PCHInternals.rst
@@ -65,9 +65,6 @@ be included at the beginning of the translation unit. The extensions to the
AST file format required for modules are discussed in the section on
:ref:`modules <pchinternals-modules>`.
-Clang's AST files are Mach-O, ELF, or COFF containers that contain a
-``__clangast`` section which holds the AST bitstream.
-
Clang's AST files are designed with a compact on-disk representation, which
minimizes both creation time and the time required to initially load the AST
file. The AST file itself contains a serialized representation of Clang's
diff --git a/include/clang/CodeGen/CodeGenModuleContainer.h b/include/clang/CodeGen/CodeGenModuleContainer.h
deleted file mode 100644
index 3c5456fc18..0000000000
--- a/include/clang/CodeGen/CodeGenModuleContainer.h
+++ /dev/null
@@ -1,34 +0,0 @@
-//===--- CodeGen/ModuleContainerGenerator.h - Emit .pcm files ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_CODEGEN_MODULE_CONTAINER_H
-#define LLVM_CLANG_CODEGEN_MODULE_CONTAINER_H
-
-#include "ModuleBuilder.h"
-#include <string>
-
-namespace llvm {
-class raw_ostream;
-}
-
-namespace clang {
-
-class PCHGenerator;
-class TargetOptions;
-
-/// \brief Create a CodeGenerator instance.
-/// It is the responsibility of the caller to call delete on
-/// the allocated CodeGenerator instance.
-CodeGenerator *CreateModuleContainerGenerator(
- DiagnosticsEngine &Diags, const std::string &ModuleName,
- const CodeGenOptions &CGO, const TargetOptions &TO, const LangOptions &LO,
- llvm::raw_ostream *OS, PCHGenerator *PCHGen);
-}
-
-#endif
diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h
index b96b9f559e..850f87c073 100644
--- a/include/clang/Frontend/FrontendActions.h
+++ b/include/clang/Frontend/FrontendActions.h
@@ -69,14 +69,6 @@ protected:
StringRef InFile) override;
};
-/// \brief Emits the output of a GeneratePCHAction or GenerateModuleAction into
-/// a Mach-O/ELF/COFF container.
-class GeneratePCMContainerAction : public FrontendAction {
-protected:
- std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
- StringRef InFile) override;
-};
-
class GeneratePCHAction : public ASTFrontendAction {
protected:
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index 754273688b..27af9995aa 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -1127,10 +1127,6 @@ private:
public:
void ResolveImportedPath(ModuleFile &M, std::string &Filename);
static void ResolveImportedPath(std::string &Filename, StringRef Prefix);
- /// \brief Initialize a BitstreamReader with the `__clangast` section from an
- /// object file container found in Buffer.
- static void InitStreamFileWithModule(llvm::MemoryBufferRef Buffer,
- llvm::BitstreamReader &StreamFile);
private:
struct ImportedModule {
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h
index 4b8668b3c6..1d2fa556e2 100644
--- a/include/clang/Serialization/ASTWriter.h
+++ b/include/clang/Serialization/ASTWriter.h
@@ -823,13 +823,10 @@ class PCHGenerator : public SemaConsumer {
std::string OutputFile;
clang::Module *Module;
std::string isysroot;
+ raw_ostream *Out;
Sema *SemaPtr;
- // This buffer is always large, but BitstreamWriter really wants a
- // SmallVectorImpl<char>.
- SmallVector<char, 0> Buffer;
+ SmallVector<char, 128> Buffer;
llvm::BitstreamWriter Stream;
- std::function<void(SmallVectorImpl<char>*)>
- SerializationFinishedCallback;
ASTWriter Writer;
bool AllowASTWithErrors;
bool HasEmittedPCH;
@@ -839,21 +836,16 @@ protected:
const ASTWriter &getWriter() const { return Writer; }
public:
- PCHGenerator(const Preprocessor &PP,
- StringRef OutputFile,
+ PCHGenerator(const Preprocessor &PP, StringRef OutputFile,
clang::Module *Module,
- StringRef isysroot,
+ StringRef isysroot, raw_ostream *Out,
bool AllowASTWithErrors = false);
~PCHGenerator();
void InitializeSema(Sema &S) override { SemaPtr = &S; }
void HandleTranslationUnit(ASTContext &Ctx) override;
ASTMutationListener *GetASTMutationListener() override;
ASTDeserializationListener *GetASTDeserializationListener() override;
- /// \brief Register a callback to be invoked when the serialization is done.
- void RegisterSerializationFinishedCallback(
- const std::function<void(SmallVectorImpl<char>*)> Fn) {
- SerializationFinishedCallback = Fn;
- }
+
bool hasEmittedPCH() const { return HasEmittedPCH; }
};
diff --git a/lib/CodeGen/CMakeLists.txt b/lib/CodeGen/CMakeLists.txt
index dae14bd3b1..18f505d8c5 100644
--- a/lib/CodeGen/CMakeLists.txt
+++ b/lib/CodeGen/CMakeLists.txt
@@ -1,5 +1,4 @@
set(LLVM_LINK_COMPONENTS
- ${LLVM_TARGETS_TO_BUILD}
Analysis
BitReader
BitWriter
@@ -64,7 +63,6 @@ add_clang_library(clangCodeGen
CodeGenAction.cpp
CodeGenFunction.cpp
CodeGenModule.cpp
- CodeGenModuleContainer.cpp
CodeGenPGO.cpp
CodeGenTBAA.cpp
CodeGenTypes.cpp
diff --git a/lib/CodeGen/CodeGenModuleContainer.cpp b/lib/CodeGen/CodeGenModuleContainer.cpp
deleted file mode 100644
index 0cc825b671..0000000000
--- a/lib/CodeGen/CodeGenModuleContainer.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//===--- CodeGenModuleContainer.cpp - Emit .pcm files ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/CodeGen/CodeGenModuleContainer.h"
-#include "CodeGenModule.h"
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/DeclObjC.h"
-#include "clang/AST/Expr.h"
-#include "clang/AST/RecursiveASTVisitor.h"
-#include "clang/Basic/Diagnostic.h"
-#include "clang/Basic/TargetInfo.h"
-#include "clang/CodeGen/BackendUtil.h"
-#include "clang/Frontend/CodeGenOptions.h"
-#include "clang/Serialization/ASTWriter.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/IR/Constants.h"
-#include "llvm/IR/DataLayout.h"
-#include "llvm/IR/LLVMContext.h"
-#include "llvm/IR/Module.h"
-#include "llvm/Support/TargetRegistry.h"
-#include <memory>
-using namespace clang;
-
-namespace {
-class ModuleContainerGenerator : public CodeGenerator {
- DiagnosticsEngine &Diags;
- std::unique_ptr<const llvm::DataLayout> TD;
- ASTContext *Ctx;
- const CodeGenOptions CodeGenOpts;
- const TargetOptions TargetOpts;
- const LangOptions LangOpts;
- llvm::LLVMContext VMContext;
- std::unique_ptr<llvm::Module> M;
- std::unique_ptr<CodeGen::CodeGenModule> Builder;
- raw_ostream *OS;
- SmallVectorImpl<char> *SerializedASTBuffer;
-
-public:
- ModuleContainerGenerator(DiagnosticsEngine &diags,
- const std::string &ModuleName,
- const CodeGenOptions &CGO, const TargetOptions &TO,
- const LangOptions &LO, raw_ostream *OS,
- PCHGenerator *PCHGen)
- : Diags(diags), CodeGenOpts(CGO), TargetOpts(TO), LangOpts(LO),
- M(new llvm::Module(ModuleName, VMContext)), OS(OS) {
- PCHGen->RegisterSerializationFinishedCallback(
- [&](SmallVectorImpl<char> *Buf){
- SerializedASTBuffer = Buf;
- });
- }
-
- virtual ~ModuleContainerGenerator() {}
- llvm::Module *GetModule() override { return M.get(); }
- llvm::Module *ReleaseModule() override { return M.release(); }
-
- /// Lifted from ModuleBuilder.
- const Decl *GetDeclForMangledName(StringRef MangledName) override {
- GlobalDecl Result;
- if (!Builder->lookupRepresentativeDecl(MangledName, Result))
- return nullptr;
- const Decl *D = Result.getCanonicalDecl().getDecl();
- if (auto FD = dyn_cast<FunctionDecl>(D)) {
- if (FD->hasBody(FD))
- return FD;
- } else if (auto TD = dyn_cast<TagDecl>(D)) {
- if (auto Def = TD->getDefinition())
- return Def;
- }
- return D;
- }
-
- void Initialize(ASTContext &Context) override {
- Ctx = &Context;
- M->setTargetTriple(Ctx->getTargetInfo().getTriple().getTriple());
- M->setDataLayout(Ctx->getTargetInfo().getTargetDescription());
- TD.reset(new llvm::DataLayout(Ctx->getTargetInfo().getTargetDescription()));
- Builder.reset(
- new CodeGen::CodeGenModule(Context, CodeGenOpts, *M, *TD, Diags));
- }
-
- /// Emit a container holding the serialized AST.
- void HandleTranslationUnit(ASTContext &Ctx) override {
- if (Diags.hasErrorOccurred()) {
- if (Builder)
- Builder->clear();
- M.reset();
- return;
- }
-
- // Finalize the Builder.
- if (Builder)
- Builder->Release();
-
- // Initialize the backend if we haven't done so already.
- LLVMInitializeAllTargetInfos();
- LLVMInitializeAllTargets();
- LLVMInitializeAllAsmPrinters();
- LLVMInitializeAllTargetMCs();
-
- // Ensure the target exists.
- std::string Error;
- auto Triple = Ctx.getTargetInfo().getTriple();
- if (!llvm::TargetRegistry::lookupTarget(Triple.getTriple(), Error))
- llvm::report_fatal_error(Error);
-
- // Emit the serialized Clang AST into its own section.
- auto Size = SerializedASTBuffer->size();
- auto Int8Ty = llvm::Type::getInt8Ty(VMContext);
- auto *Ty = llvm::ArrayType::get(Int8Ty, Size);
- auto *Data = llvm::ConstantDataArray::getString(VMContext,
- StringRef(SerializedASTBuffer->data(), Size), /*AddNull=*/false);
- auto *ASTSym = new llvm::GlobalVariable(*M, Ty, /*constant*/ true,
- llvm::GlobalVariable::InternalLinkage, Data, "__clang_ast");
- ASTSym->setAlignment(8);
- if (Triple.isOSBinFormatMachO())
- // Include Mach-O segment name.
- ASTSym->setSection("__CLANG,__clangast");
- else if (Triple.isOSBinFormatCOFF())
- // Adhere to COFF eight-character limit.
- ASTSym->setSection("clangast");
- else
- ASTSym->setSection("__clangast");
-
- // Use the LLVM backend to emit the pcm.
- clang::EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
- Ctx.getTargetInfo().getTargetDescription(), M.get(),
- BackendAction::Backend_EmitObj, OS);
-
- // Make sure the module container hits disk now.
- OS->flush();
-
- // Free up some memory, in case the process is kept alive.
- SerializedASTBuffer->clear();
- }
-};
-}
-
-CodeGenerator *clang::CreateModuleContainerGenerator(
- DiagnosticsEngine &Diags, const std::string &ModuleName,
- const CodeGenOptions &CGO, const TargetOptions &TO, const LangOptions &LO,
- llvm::raw_ostream *OS, PCHGenerator *PCHGen) {
- return
- new ModuleContainerGenerator(Diags, ModuleName, CGO, TO, LO, OS, PCHGen);
-}
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 58a5f98008..bfb1efe352 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -914,20 +914,13 @@ class PrecompilePreambleConsumer : public PCHGenerator {
unsigned &Hash;
std::vector<Decl *> TopLevelDecls;
PrecompilePreambleAction *Action;
- raw_ostream *Out;
- SmallVectorImpl<char> *SerializedASTBuffer;
public:
PrecompilePreambleConsumer(ASTUnit &Unit, PrecompilePreambleAction *Action,
const Preprocessor &PP, StringRef isysroot,
raw_ostream *Out)
- : PCHGenerator(PP, "", nullptr, isysroot, /*AllowASTWithErrors=*/true),
- Unit(Unit), Hash(Unit.getCurrentTopLevelHashValue()), Action(Action),
- Out(Out) {
- RegisterSerializationFinishedCallback(
- [&](SmallVectorImpl<char> *Buf){
- SerializedASTBuffer = Buf;
- });
+ : PCHGenerator(PP, "", nullptr, isysroot, Out, /*AllowASTWithErrors=*/true),
+ Unit(Unit), Hash(Unit.getCurrentTopLevelHashValue()), Action(Action) {
Hash = 0;
}
@@ -948,13 +941,6 @@ public:
void HandleTranslationUnit(ASTContext &Ctx) override {
PCHGenerator::HandleTranslationUnit(Ctx);
if (hasEmittedPCH()) {
- // Write the generated bitstream to "Out".
- Out->write((char *)&SerializedASTBuffer->front(),
- SerializedASTBuffer->size());
- // Make sure it hits disk now.
- Out->flush();
- SerializedASTBuffer->clear();
-
// Translate the top-level declarations we captured during
// parsing into declaration IDs in the precompiled
// preamble. This will allow us to deserialize those top-level
diff --git a/lib/Frontend/CMakeLists.txt b/lib/Frontend/CMakeLists.txt
index 6c9085d65d..7c5fca54d1 100644
--- a/lib/Frontend/CMakeLists.txt
+++ b/lib/Frontend/CMakeLists.txt
@@ -45,7 +45,6 @@ add_clang_library(clangFrontend
LINK_LIBS
clangAST
clangBasic
- clangCodeGen
clangDriver
clangEdit
clangLex
diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp
index 1ecc0bfc6b..cb260b4f4c 100644
--- a/lib/Frontend/ChainedIncludesSource.cpp
+++ b/lib/Frontend/ChainedIncludesSource.cpp
@@ -156,13 +156,11 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource(
&Clang->getPreprocessor());
Clang->createASTContext();
- auto consumer = llvm::make_unique<PCHGenerator>(Clang->getPreprocessor(),
- "-", nullptr, /*isysroot=*/"");
- SmallVectorImpl<char> *serialAST;
- consumer->RegisterSerializationFinishedCallback(
- [&](SmallVectorImpl<char> *Buf){
- serialAST = Buf;
- });
+ SmallVector<char, 256> serialAST;
+ llvm::raw_svector_ostream OS(serialAST);
+ auto consumer =
+ llvm::make_unique<PCHGenerator>(Clang->getPreprocessor(), "-", nullptr,
+ /*isysroot=*/"", &OS);
Clang->getASTContext().setASTMutationListener(
consumer->GetASTMutationListener());
Clang->setASTConsumer(std::move(consumer));
@@ -199,9 +197,7 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource(
ParseAST(Clang->getSema());
Clang->getDiagnosticClient().EndSourceFile();
- SerialBufs.push_back(llvm::MemoryBuffer::
- getMemBufferCopy(StringRef(serialAST->data(), serialAST->size())));
- serialAST->clear();
+ SerialBufs.push_back(llvm::MemoryBuffer::getMemBufferCopy(OS.str()));
source->CIs.push_back(Clang.release());
}
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp
index 3e0f525e65..a55a325785 100644
--- a/lib/Frontend/FrontendActions.cpp
+++ b/lib/Frontend/FrontendActions.cpp
@@ -10,13 +10,10 @@
#include "clang/Frontend/FrontendActions.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/FileManager.h"
-#include "clang/Basic/TargetInfo.h"
-#include "clang/CodeGen/CodeGenModuleContainer.h"
#include "clang/Frontend/ASTConsumers.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
-#include "clang/Frontend/MultiplexConsumer.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Pragma.h"
@@ -88,23 +85,8 @@ GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
if (!CI.getFrontendOpts().RelocatablePCH)
Sysroot.clear();
-
- std::vector<std::unique_ptr<ASTConsumer>> Consumers;
- Consumers.push_back(llvm::make_unique<PCHGenerator>(CI.getPreprocessor(),
- OutputFile, nullptr,
- Sysroot));
-
- auto CGOpts = CI.getCodeGenOpts();
- // The debug info emitted by ModuleContainerGenerator is not affected by the
- // optimization level.
- CGOpts.OptimizationLevel = 0;
- CGOpts.setDebugInfo(CodeGenOptions::LimitedDebugInfo);
- Consumers.push_back(std::unique_ptr<ASTConsumer>(
- CreateModuleContainerGenerator(CI.getDiagnostics(), "PCH", CGOpts,
- CI.getTargetOpts(), CI.getLangOpts(), OS,
- cast<PCHGenerator>(Consumers[0].get()))));
-
- return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
+ return llvm::make_unique<PCHGenerator>(CI.getPreprocessor(), OutputFile,
+ nullptr, Sysroot, OS);
}
bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
@@ -140,22 +122,8 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
if (ComputeASTConsumerArguments(CI, InFile, Sysroot, OutputFile, OS))
return nullptr;
- std::vector<std::unique_ptr<ASTConsumer>> Consumers;
- Consumers.push_back(llvm::make_unique<PCHGenerator>(CI.getPreprocessor(),
- OutputFile, Module,
- Sysroot));
-
- auto CGOpts = CI.getCodeGenOpts();
- // The debug info emitted by ModuleContainerGenerator is not affected by the
- // optimization level.
- CGOpts.OptimizationLevel = 0;
- CGOpts.setDebugInfo(CodeGenOptions::LimitedDebugInfo);
- Consumers.push_back(
- std::unique_ptr<ASTConsumer>(CreateModuleContainerGenerator(
- CI.getDiagnostics(), Module->getFullModuleName(), CGOpts,
- CI.getTargetOpts(), CI.getLangOpts(), OS,
- cast<PCHGenerator>(Consumers[0].get()))));
- return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
+ return llvm::make_unique<PCHGenerator>(CI.getPreprocessor(), OutputFile,
+ Module, Sysroot, OS);
}
static SmallVectorImpl<char> &
diff --git a/lib/Frontend/MultiplexConsumer.cpp b/lib/Frontend/MultiplexConsumer.cpp
index bb9c907b2e..3c4fed1d18 100644
--- a/lib/Frontend/MultiplexConsumer.cpp
+++ b/lib/Frontend/MultiplexConsumer.cpp
@@ -33,14 +33,11 @@ public:
void ReaderInitialized(ASTReader *Reader) override;
void IdentifierRead(serialization::IdentID ID,
IdentifierInfo *II) override;
- void MacroRead(serialization::MacroID ID, MacroInfo *MI) override;
void TypeRead(serialization::TypeIdx Idx, QualType T) override;
void DeclRead(serialization::DeclID ID, const Decl *D) override;
void SelectorRead(serialization::SelectorID iD, Selector Sel) override;
void MacroDefinitionRead(serialization::PreprocessedEntityID,
MacroDefinition *MD) override;
- void ModuleRead(serialization::SubmoduleID ID, Module *Mod) override;
-
private:
std::vector<ASTDeserializationListener*> Listeners;
};
@@ -62,12 +59,6 @@ void MultiplexASTDeserializationListener::IdentifierRead(
Listeners[i]->IdentifierRead(ID, II);
}
-void MultiplexASTDeserializationListener::MacroRead(
- serialization::MacroID ID, MacroInfo *MI) {
- for (auto &Listener : Listeners)
- Listener->MacroRead(ID, MI);
-}
-
void MultiplexASTDeserializationListener::TypeRead(
serialization::TypeIdx Idx, QualType T) {
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
@@ -92,12 +83,6 @@ void MultiplexASTDeserializationListener::MacroDefinitionRead(
Listeners[i]->MacroDefinitionRead(ID, MD);
}
-void MultiplexASTDeserializationListener::ModuleRead(
- serialization::SubmoduleID ID, Module *Mod) {
- for (auto &Listener : Listeners)
- Listener->ModuleRead(ID, Mod);
-}
-
// This ASTMutationListener forwards its notifications to a set of
// child listeners.
class MultiplexASTMutationListener : public ASTMutationListener {
@@ -113,13 +98,11 @@ public:
const VarTemplateSpecializationDecl *D) override;
void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
const FunctionDecl *D) override;
- void ResolvedExceptionSpec(const FunctionDecl *FD) override;
void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType) override;
void CompletedImplicitDefinition(const FunctionDecl *D) override;
void StaticDataMemberInstantiated(const VarDecl *D) override;
void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
const ObjCInterfaceDecl *IFD) override;
- void FunctionDefinitionInstantiated(const FunctionDecl *D) override;
void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop,
const ObjCPropertyDecl *OrigProp,
const ObjCCategoryDecl *ClassExt) override;
@@ -166,11 +149,6 @@ void MultiplexASTMutationListener::AddedCXXTemplateSpecialization(
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
Listeners[i]->AddedCXXTemplateSpecialization(TD, D);
}
-void MultiplexASTMutationListener::ResolvedExceptionSpec(
- const FunctionDecl *FD) {
- for (auto &Listener : Listeners)
- Listener->ResolvedExceptionSpec(FD);
-}
void MultiplexASTMutationListener::DeducedReturnType(const FunctionDecl *FD,
QualType ReturnType) {
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
@@ -192,11 +170,6 @@ void MultiplexASTMutationListener::AddedObjCCategoryToInterface(
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
Listeners[i]->AddedObjCCategoryToInterface(CatD, IFD);
}
-void MultiplexASTMutationListener::FunctionDefinitionInstantiated(
- const FunctionDecl *D) {
- for (auto &Listener : Listeners)
- Listener->FunctionDefinitionInstantiated(D);
-}
void MultiplexASTMutationListener::AddedObjCPropertyInClassExtension(
const ObjCPropertyDecl *Prop,
const ObjCPropertyDecl *OrigProp,
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index dd73bbae37..0ee2b2b221 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -46,8 +46,6 @@
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Bitcode/BitstreamReader.h"
-#include "llvm/Object/COFF.h"
-#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -634,27 +632,6 @@ void PCHValidator::ReadCounter(const ModuleFile &M, unsigned Value) {
// AST reader implementation
//===----------------------------------------------------------------------===//
-void ASTReader::InitStreamFileWithModule(llvm::MemoryBufferRef Buffer,
- llvm::BitstreamReader &StreamFile) {
- if (auto OF = llvm::object::ObjectFile::createObjectFile(Buffer)) {
- bool IsCOFF = isa<llvm::object::COFFObjectFile>(OF.get().get());
- // Find the clang AST section in the container.
- for (auto &Section : OF->get()->sections()) {
- StringRef Name;
- Section.getName(Name);
- if ((!IsCOFF && Name == "__clangast") ||
- ( IsCOFF && Name == "clangast")) {
- StringRef Buf;
- Section.getContents(Buf);
- return StreamFile.init((const unsigned char*)Buf.begin(),
- (const unsigned char*)Buf.end());
- }
- }
- }
- StreamFile.init((const unsigned char *)Buffer.getBufferStart(),
- (const unsigned char *)Buffer.getBufferEnd());
-}
-
void ASTReader::setDeserializationListener(ASTDeserializationListener *Listener,
bool TakeOwnership) {
DeserializationListener = Listener;
@@ -3906,10 +3883,9 @@ ASTReader::ReadASTCore(StringRef FileName,
ModuleFile &F = *M;
BitstreamCursor &Stream = F.Stream;
- InitStreamFileWithModule(F.Buffer->getMemBufferRef(), F.StreamFile);
Stream.init(&F.StreamFile);
- F.SizeInBits = F.StreamFile.getBitcodeBytes().getExtent() * 8;
-
+ F.SizeInBits = F.Buffer->getBufferSize() * 8;
+
// Sniff for the signature.
if (Stream.Read(8) != 'C' ||
Stream.Read(8) != 'P' ||
@@ -4198,7 +4174,8 @@ std::string ASTReader::getOriginalSourceFile(const std::string &ASTFileName,
// Initialize the stream
llvm::BitstreamReader StreamFile;
- InitStreamFileWithModule((*Buffer)->getMemBufferRef(), StreamFile);
+ StreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
+ (const unsigned char *)(*Buffer)->getBufferEnd());
BitstreamCursor Stream(StreamFile);
// Sniff for the signature.
@@ -4293,7 +4270,8 @@ bool ASTReader::readASTFileControlBlock(StringRef Filename,
// Initialize the stream
llvm::BitstreamReader StreamFile;
- InitStreamFileWithModule((*Buffer)->getMemBufferRef(), StreamFile);
+ StreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
+ (const unsigned char *)(*Buffer)->getBufferEnd());
BitstreamCursor Stream(StreamFile);
// Sniff for the signature.
diff --git a/lib/Serialization/CMakeLists.txt b/lib/Serialization/CMakeLists.txt
index a1a5ad4abe..d885db2297 100644
--- a/lib/Serialization/CMakeLists.txt
+++ b/lib/Serialization/CMakeLists.txt
@@ -1,6 +1,5 @@
set(LLVM_LINK_COMPONENTS
BitReader
- Object
Support
)
diff --git a/lib/Serialization/GeneratePCH.cpp b/lib/Serialization/GeneratePCH.cpp
index 0cd01dc6f3..b5031fdf92 100644
--- a/lib/Serialization/GeneratePCH.cpp
+++ b/lib/Serialization/GeneratePCH.cpp
@@ -19,6 +19,7 @@
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/SemaConsumer.h"
#include "llvm/Bitcode/BitstreamWriter.h"
+#include "llvm/Support/raw_ostream.h"
#include <string>
using namespace clang;
@@ -27,11 +28,10 @@ PCHGenerator::PCHGenerator(const Preprocessor &PP,
StringRef OutputFile,
clang::Module *Module,
StringRef isysroot,
- bool AllowASTWithErrors)
+ raw_ostream *OS, bool AllowASTWithErrors)
: PP(PP), OutputFile(OutputFile), Module(Module),
- isysroot(isysroot.str()),
- SemaPtr(nullptr), Stream(Buffer),
- Writer(Stream),
+ isysroot(isysroot.str()), Out(OS),
+ SemaPtr(nullptr), Stream(Buffer), Writer(Stream),
AllowASTWithErrors(AllowASTWithErrors),
HasEmittedPCH(false) {
}
@@ -52,8 +52,14 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) {
assert(SemaPtr && "No Sema?");
Writer.WriteAST(*SemaPtr, OutputFile, Module, isysroot, hasErrors);
- if (SerializationFinishedCallback)
- SerializationFinishedCallback(&Buffer);
+ // Write the generated bitstream to "Out".
+ Out->write((char *)&Buffer.front(), Buffer.size());
+
+ // Make sure it hits disk now.
+ Out->flush();
+
+ // Free up some memory, in case the process is kept alive.
+ Buffer.clear();
HasEmittedPCH = true;
}
diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp
index 68a23ea870..4791388045 100644
--- a/lib/Serialization/GlobalModuleIndex.cpp
+++ b/lib/Serialization/GlobalModuleIndex.cpp
@@ -15,7 +15,6 @@
#include "clang/Basic/FileManager.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Serialization/ASTBitCodes.h"
-#include "clang/Serialization/ASTReader.h"
#include "clang/Serialization/GlobalModuleIndex.h"
#include "clang/Serialization/Module.h"
#include "llvm/ADT/DenseMap.h"
@@ -502,8 +501,8 @@ bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
// Initialize the input stream
llvm::BitstreamReader InStreamFile;
- ASTReader::InitStreamFileWithModule((*Buffer)->getMemBufferRef(),
- InStreamFile);
+ InStreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
+ (const unsigned char *)(*Buffer)->getBufferEnd());
llvm::BitstreamCursor InStream(InStreamFile);
// Sniff for the signature.
diff --git a/lib/Serialization/ModuleManager.cpp b/lib/Serialization/ModuleManager.cpp
index 8f1473f3a3..ac98ca0b87 100644
--- a/lib/Serialization/ModuleManager.cpp
+++ b/lib/Serialization/ModuleManager.cpp
@@ -13,7 +13,6 @@
//===----------------------------------------------------------------------===//
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/ModuleMap.h"
-#include "clang/Serialization/ASTReader.h"
#include "clang/Serialization/GlobalModuleIndex.h"
#include "clang/Serialization/ModuleManager.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -136,10 +135,10 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
New->Buffer = std::move(*Buf);
}
-
- // Initialize the stream.
- ASTReader::InitStreamFileWithModule(New->Buffer->getMemBufferRef(),
- New->StreamFile);
+
+ // Initialize the stream
+ New->StreamFile.init((const unsigned char *)New->Buffer->getBufferStart(),
+ (const unsigned char *)New->Buffer->getBufferEnd());
}
if (ExpectedSignature) {
diff --git a/test/ARCMT/check-with-pch.m b/test/ARCMT/check-with-pch.m
index 5e843ff08d..1a94dda796 100644
--- a/test/ARCMT/check-with-pch.m
+++ b/test/ARCMT/check-with-pch.m
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin10 %S/Common.h -emit-pch -o %t.pch
// RUN: %clang_cc1 -include-pch %t.pch -arcmt-check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s
-// REQUIRES: x86-registered-target
// rdar://9601437
@interface I9601437 {
diff --git a/test/ARCMT/migrate-on-pch-and-module.m b/test/ARCMT/migrate-on-pch-and-module.m
index 5073a6228b..c98ce467f6 100644
--- a/test/ARCMT/migrate-on-pch-and-module.m
+++ b/test/ARCMT/migrate-on-pch-and-module.m
@@ -1,7 +1,6 @@
// RUN: rm -rf %t-mcp
// RUN: %clang_cc1 -objcmt-migrate-subscripting -emit-pch -o %t.pch %s -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -F %S/Inputs -fmodules -fmodules-cache-path=%t-mcp -w
// RUN: %clang_cc1 -objcmt-migrate-subscripting -include-pch %t.pch %s -migrate -o %t.remap -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -F %S/Inputs -fmodules -fmodules-cache-path=%t-mcp
-// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER
diff --git a/test/ARCMT/objcmt-with-pch.m b/test/ARCMT/objcmt-with-pch.m
index 61c87a2b00..fac42c8512 100644
--- a/test/ARCMT/objcmt-with-pch.m
+++ b/test/ARCMT/objcmt-with-pch.m
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: rm -rf %t
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c %S/Common.h -emit-pch -o %t.pch
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -include-pch %t.pch
diff --git a/test/ARCMT/objcmt-with-pch.m.result b/test/ARCMT/objcmt-with-pch.m.result
index 7e2570cfc4..04eadc9d3f 100644
--- a/test/ARCMT/objcmt-with-pch.m.result
+++ b/test/ARCMT/objcmt-with-pch.m.result
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: rm -rf %t
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c %S/Common.h -emit-pch -o %t.pch
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -include-pch %t.pch
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 526f129bab..591a9272ae 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -58,7 +58,7 @@ set(CLANG_TEST_PARAMS
if( NOT CLANG_BUILT_STANDALONE )
list(APPEND CLANG_TEST_DEPS
llvm-config
- llc opt FileCheck count not llvm-symbolizer llvm-profdata llvm-objdump
+ llc opt FileCheck count not llvm-symbolizer llvm-profdata
)
endif()
diff --git a/test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp b/test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp
index e299705a4c..5c1029f1a3 100644
--- a/test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp
+++ b/test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++11 -include %S/ser.h %s -o - | FileCheck %s
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -emit-pch -o %t-ser.pch -std=c++11 -x c++ %S/ser.h
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++11 -include-pch %t-ser.pch %s -o - | FileCheck %s
diff --git a/test/CodeGen/atomic-ops.c b/test/CodeGen/atomic-ops.c
index 659a5ad944..559b135413 100644
--- a/test/CodeGen/atomic-ops.c
+++ b/test/CodeGen/atomic-ops.c
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -ffreestanding -triple=i686-apple-darwin9 | FileCheck %s
-// REQUIRES: x86-registered-target
// Also test serialization of atomic operations here, to avoid duplicating the
// test.
diff --git a/test/CodeGen/big-atomic-ops.c b/test/CodeGen/big-atomic-ops.c
index b4e0efd288..74096616ac 100644
--- a/test/CodeGen/big-atomic-ops.c
+++ b/test/CodeGen/big-atomic-ops.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-macosx10.9.0 | FileCheck %s
-// REQUIRES: x86-registered-target
+
// Also test serialization of atomic operations here, to avoid duplicating the
// test.
// RUN: %clang_cc1 %s -emit-pch -o %t -triple=x86_64-apple-macosx10.9.0
diff --git a/test/Frontend/ast-codegen.c b/test/Frontend/ast-codegen.c
index 4a3f8a3b79..b85c5dcf50 100644
--- a/test/Frontend/ast-codegen.c
+++ b/test/Frontend/ast-codegen.c
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: %clang -target i386-unknown-unknown -emit-ast -o %t.ast %s
// RUN: %clang -target i386-unknown-unknown -emit-llvm -S -o - %t.ast | FileCheck %s
diff --git a/test/Index/TestClassForwardDecl.m b/test/Index/TestClassForwardDecl.m
index 284406f644..9696a28066 100644
--- a/test/Index/TestClassForwardDecl.m
+++ b/test/Index/TestClassForwardDecl.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-load %s
-// REQUIRES: x86-registered-target
+
// This test checks how the @class resolves as a cursor when the @interface is implicitly defined.
// See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>)
diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m
index cbd742b240..c75d5ac681 100644
--- a/test/Index/c-index-api-loadTU-test.m
+++ b/test/Index/c-index-api-loadTU-test.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
// RUN: c-index-test -test-load-tu %t.ast all > %t 2>&1 && FileCheck --input-file=%t %s
-// REQUIRES: x86-registered-target
+
@interface Foo
{
__attribute__((iboutlet)) id myoutlet;
diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m
index f368f1f074..c1799026ce 100644
--- a/test/Index/c-index-getCursor-test.m
+++ b/test/Index/c-index-getCursor-test.m
@@ -166,4 +166,3 @@ void f() {
// CHECK: [57:1 - 57:10] FunctionDecl=f:57:6 (Definition)
// CHECK: [58:4 - 58:8] VarDecl=my_var:58:8 (Definition)
// CHECK: [58:8 - 58:15] macro expansion=CONCAT:55:9
-// REQUIRES: x86-registered-target
diff --git a/test/Index/pch-with-module.m b/test/Index/pch-with-module.m
index 77262d5eb6..e839c811da 100644
--- a/test/Index/pch-with-module.m
+++ b/test/Index/pch-with-module.m
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: rm -rf %t.cache
// RUN: c-index-test -write-pch %t.h.pch %s -target x86_64-apple-macosx10.7 -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash
// RUN: %clang -fsyntax-only %s -target x86_64-apple-macosx10.7 -include %t.h -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \
diff --git a/test/Index/print-mangled-name.cpp b/test/Index/print-mangled-name.cpp
index d4edc5ff39..b7e79c3f6d 100644
--- a/test/Index/print-mangled-name.cpp
+++ b/test/Index/print-mangled-name.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-pch %s -o %t_linux.ast
// RUN: c-index-test -test-print-mangle %t_linux.ast | FileCheck %s --check-prefix=ITANIUM
diff --git a/test/Modules/dependency-gen-inferred-map.m b/test/Modules/dependency-gen-inferred-map.m
index e61b6cd7b9..11cc872881 100644
--- a/test/Modules/dependency-gen-inferred-map.m
+++ b/test/Modules/dependency-gen-inferred-map.m
@@ -1,6 +1,5 @@
// Test that the virtual file "__inferred_module.map" doesn't show up as dependency.
-// REQUIRES: x86-registered-target
// RUN: rm -rf %t-mcp
// RUN: %clang_cc1 -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -dependency-file %t.d -MT %s.o -F %S/Inputs -fsyntax-only -fmodules -fmodules-cache-path=%t-mcp %s
// RUN: FileCheck %s < %t.d
diff --git a/test/Modules/dependency-gen-pch.m b/test/Modules/dependency-gen-pch.m
index c81a7e7d06..65e22d485d 100644
--- a/test/Modules/dependency-gen-pch.m
+++ b/test/Modules/dependency-gen-pch.m
@@ -1,6 +1,5 @@
// RUN: rm -rf %t-mcp
// RUN: mkdir -p %t-mcp
-// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -module-file-deps -dependency-file %t.d -MT %s.o -I %S/Inputs -fmodules -fdisable-module-hash -fmodules-cache-path=%t-mcp -emit-pch -o %t.pch %s
// RUN: FileCheck %s < %t.d
diff --git a/test/Modules/irgen.c b/test/Modules/irgen.c
index 46737a2f2e..c44afb1bec 100644
--- a/test/Modules/irgen.c
+++ b/test/Modules/irgen.c
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -I %S/Inputs -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
diff --git a/test/Modules/module_container.m b/test/Modules/module_container.m
deleted file mode 100644
index 348a869ad2..0000000000
--- a/test/Modules/module_container.m
+++ /dev/null
@@ -1,14 +0,0 @@
-@import DependsOnModule;
-// REQUIRES: x86-registered-target
-// RUN: rm -rf %t-MachO %t-ELF %t-COFF
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fmodules -fdisable-module-hash -fmodules-cache-path=%t-MachO -F %S/Inputs %s
-// RUN: %clang_cc1 -triple=x86_64-linux-elf -fmodules -fdisable-module-hash -fmodules-cache-path=%t-ELF -F %S/Inputs %s
-// RUN: %clang_cc1 -triple=x86_64-windows-coff -fmodules -fdisable-module-hash -fmodules-cache-path=%t-COFF -F %S/Inputs %s
-
-// RUN: llvm-objdump -section-headers %t-MachO/DependsOnModule.pcm %t-ELF/DependsOnModule.pcm %t-COFF/DependsOnModule.pcm | FileCheck %s
-// CHECK: file format Mach-O 64-bit x86-64
-// CHECK: __clangast {{[0-9a-f]+}} {{[0-9a-f]+}} DATA
-// CHECK: file format ELF64-x86-64
-// CHECK: __clangast {{[0-9a-f]+}} {{[0-9a-f]+}} DATA
-// CHECK: file format COFF-x86-64
-// CHECK: clangast {{[0-9a-f]+}} {{[0-9a-f]+}}
diff --git a/test/Modules/self-import-header.m b/test/Modules/self-import-header.m
index 83e5c0104d..9b4bd5dee5 100644
--- a/test/Modules/self-import-header.m
+++ b/test/Modules/self-import-header.m
@@ -1,5 +1,5 @@
// rdar://13840148
-// REQUIRES: x86-registered-target
+
// RUN: rm -rf %t
// RUN: %clang -fsyntax-only -isysroot %S/Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
// RUN: -target x86_64-darwin \
diff --git a/test/Modules/templates-2.mm b/test/Modules/templates-2.mm
index 1fe14104da..8a752f7613 100644
--- a/test/Modules/templates-2.mm
+++ b/test/Modules/templates-2.mm
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
@import templates_top;
struct TestEmitDefaultedSpecialMembers {
diff --git a/test/Modules/templates.mm b/test/Modules/templates.mm
index f52e687699..d60b873d0f 100644
--- a/test/Modules/templates.mm
+++ b/test/Modules/templates.mm
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
@import templates_left;
void testInlineRedeclEarly() {
diff --git a/test/Modules/va_list.m b/test/Modules/va_list.m
index 6aec13f997..5a305180fc 100644
--- a/test/Modules/va_list.m
+++ b/test/Modules/va_list.m
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: rm -rf %t
// RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fmodules-cache-path=%t \
// RUN: -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list \
diff --git a/test/OpenMP/atomic_read_codegen.c b/test/OpenMP/atomic_read_codegen.c
index 536f38be2f..c97fe8c290 100644
--- a/test/OpenMP/atomic_read_codegen.c
+++ b/test/OpenMP/atomic_read_codegen.c
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/barrier_codegen.cpp b/test/OpenMP/barrier_codegen.cpp
index dee90de277..2e817c138c 100644
--- a/test/OpenMP/barrier_codegen.cpp
+++ b/test/OpenMP/barrier_codegen.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/critical_codegen.cpp b/test/OpenMP/critical_codegen.cpp
index db7b26a2fd..dda532ca36 100644
--- a/test/OpenMP/critical_codegen.cpp
+++ b/test/OpenMP/critical_codegen.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/flush_codegen.cpp b/test/OpenMP/flush_codegen.cpp
index a114c4f9da..7dc58f47fb 100644
--- a/test/OpenMP/flush_codegen.cpp
+++ b/test/OpenMP/flush_codegen.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/for_codegen.cpp b/test/OpenMP/for_codegen.cpp
index 8f3d206437..badc5bdeca 100644
--- a/test/OpenMP/for_codegen.cpp
+++ b/test/OpenMP/for_codegen.cpp
@@ -3,9 +3,9 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
//
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER
+
// CHECK: [[IDENT_T_TY:%.+]] = type { i32, i32, i32, i32, i8* }
// CHECK-LABEL: define {{.*void}} @{{.*}}without_schedule_clause{{.*}}(float* {{.+}}, float* {{.+}}, float* {{.+}}, float* {{.+}})
void without_schedule_clause(float *a, float *b, float *c, float *d) {
diff --git a/test/OpenMP/master_codegen.cpp b/test/OpenMP/master_codegen.cpp
index 5c75a5d952..d354bae2d7 100644
--- a/test/OpenMP/master_codegen.cpp
+++ b/test/OpenMP/master_codegen.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/parallel_codegen.cpp b/test/OpenMP/parallel_codegen.cpp
index 704c69fe95..ffaca9ab7f 100644
--- a/test/OpenMP/parallel_codegen.cpp
+++ b/test/OpenMP/parallel_codegen.cpp
@@ -2,9 +2,9 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix=CHECK-DEBUG %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER
+
// CHECK-DAG: %ident_t = type { i32, i32, i32, i32, i8* }
// CHECK-DAG: %struct.anon = type { i32* }
// CHECK-DAG: %struct.anon.0 = type { i8*** }
diff --git a/test/OpenMP/parallel_private_codegen.cpp b/test/OpenMP/parallel_private_codegen.cpp
index 6770b05208..6911068250 100644
--- a/test/OpenMP/parallel_private_codegen.cpp
+++ b/test/OpenMP/parallel_private_codegen.cpp
@@ -4,9 +4,9 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER
+
template <class T>
struct S {
T f;
diff --git a/test/OpenMP/simd_codegen.cpp b/test/OpenMP/simd_codegen.cpp
index 3d1cbbdd95..b8073c2948 100644
--- a/test/OpenMP/simd_codegen.cpp
+++ b/test/OpenMP/simd_codegen.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// REQUIRES: x86-registered-target
+//
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/single_codegen.cpp b/test/OpenMP/single_codegen.cpp
index 495f182bdf..e67af0f508 100644
--- a/test/OpenMP/single_codegen.cpp
+++ b/test/OpenMP/single_codegen.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/taskyield_codegen.cpp b/test/OpenMP/taskyield_codegen.cpp
index 6fc317e8fa..7c02b52ea6 100644
--- a/test/OpenMP/taskyield_codegen.cpp
+++ b/test/OpenMP/taskyield_codegen.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics
-// REQUIRES: x86-registered-target
+
#ifndef HEADER
#define HEADER
diff --git a/test/OpenMP/threadprivate_codegen.cpp b/test/OpenMP/threadprivate_codegen.cpp
index e761416b11..98b7917714 100644
--- a/test/OpenMP/threadprivate_codegen.cpp
+++ b/test/OpenMP/threadprivate_codegen.cpp
@@ -18,7 +18,7 @@
// CHECK-DEBUG-DAG: [[S4:%.+]] = type { [[INT]], [[INT]] }
// CHECK-DEBUG-DAG: [[S5:%.+]] = type { [[INT]], [[INT]], [[INT]] }
// CHECK-DEBUG-DAG: [[SMAIN:%.+]] = type { [[INT]], double, double }
-// REQUIRES: x86-registered-target
+
struct S1 {
int a;
S1()
diff --git a/test/PCH/__va_list_tag.c b/test/PCH/__va_list_tag.c
index 81cda8963b..efe5c1b366 100644
--- a/test/PCH/__va_list_tag.c
+++ b/test/PCH/__va_list_tag.c
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// PR13189
// rdar://problem/11741429
// Test this without pch.
diff --git a/test/PCH/arc.m b/test/PCH/arc.m
index 63c77778f4..466b317055 100644
--- a/test/PCH/arc.m
+++ b/test/PCH/arc.m
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// Test this without pch.
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include %S/Inputs/arc.h -fsyntax-only -emit-llvm-only %s
diff --git a/test/PCH/asm.c b/test/PCH/asm.c
index cabd03cac9..160829b7a6 100644
--- a/test/PCH/asm.c
+++ b/test/PCH/asm.c
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// Test this without pch.
// RUN: %clang_cc1 -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s
diff --git a/test/PCH/chain-external-defs.c b/test/PCH/chain-external-defs.c
index f7c7233389..7422294428 100644
--- a/test/PCH/chain-external-defs.c
+++ b/test/PCH/chain-external-defs.c
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// Test with pch.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t1.pch %S/Inputs/chain-external-defs1.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch
diff --git a/test/PCH/chain-trivial.c b/test/PCH/chain-trivial.c
index 4cc7890de0..a0f5827fb9 100644
--- a/test/PCH/chain-trivial.c
+++ b/test/PCH/chain-trivial.c
@@ -1,3 +1,2 @@
-// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t1 %S/Inputs/chain-trivial1.h
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t2 -include-pch %t1 %S/Inputs/chain-trivial2.h
diff --git a/test/PCH/cxx-ms-function-specialization-class-scope.cpp b/test/PCH/cxx-ms-function-specialization-class-scope.cpp
index f97a8d183c..afbb80b737 100644
--- a/test/PCH/cxx-ms-function-specialization-class-scope.cpp
+++ b/test/PCH/cxx-ms-function-specialization-class-scope.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -x c++-header -emit-pch -o %t %S/cxx-ms-function-specialization-class-scope.h
// RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s
// expected-no-diagnostics
diff --git a/test/PCH/external-defs.c b/test/PCH/external-defs.c
index 5e906b246b..5c2582a9c3 100644
--- a/test/PCH/external-defs.c
+++ b/test/PCH/external-defs.c
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// Test with pch.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s
diff --git a/test/PCH/floating-literal.c b/test/PCH/floating-literal.c
index b5ff6fe84b..738e45a415 100644
--- a/test/PCH/floating-literal.c
+++ b/test/PCH/floating-literal.c
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -triple mips64-none-linux-gnu -emit-pch -o %t %s
-// REQUIRES: mips-registered-target
// RUN: %clang_cc1 -x ast -ast-print %t | FileCheck %s
// Make sure the semantics of FloatingLiterals are stored correctly in
diff --git a/test/PCH/local_static.cpp b/test/PCH/local_static.cpp
index b4131bffde..1085d81d31 100644
--- a/test/PCH/local_static.cpp
+++ b/test/PCH/local_static.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
// Test this without PCH.
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include %S/local_static.h -fsyntax-only %s -emit-llvm -o %t.no_pch.ll %s
// RUN: FileCheck --input-file %t.no_pch.ll %s
diff --git a/test/PCH/pchpch.c b/test/PCH/pchpch.c
index 5ea661abd5..d68a6ad4ae 100644
--- a/test/PCH/pchpch.c
+++ b/test/PCH/pchpch.c
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t1 %S/pchpch1.h
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t2 %S/pchpch2.h -include-pch %t1
// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only %s -include-pch %t2
-// REQUIRES: x86-registered-target
// The purpose of this test is to make sure that a PCH created while including
// an existing PCH can be loaded.
diff --git a/test/PCH/reloc.c b/test/PCH/reloc.c
index bf70ab6f69..8dabb8b03d 100644
--- a/test/PCH/reloc.c
+++ b/test/PCH/reloc.c
@@ -3,7 +3,6 @@
// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only \
// RUN: -include-pch %t -isysroot %S/libroot %s -Xclang -verify
// RUN: not %clang -target x86_64-apple-darwin10 -include-pch %t %s
-// REQUIRES: x86-registered-target
#include <reloc.h>
diff --git a/test/PCH/subscripting-literals.m b/test/PCH/subscripting-literals.m
index 0153239972..1675373441 100644
--- a/test/PCH/subscripting-literals.m
+++ b/test/PCH/subscripting-literals.m
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.nopch.ll %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch -o %t.pch %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.pch.ll %s -include-pch %t.pch
-// REQUIRES: x86-registered-target
// RUN: diff %t.nopch.ll %t.pch.ll
#ifndef HEADER
diff --git a/test/PCH/target-options.c b/test/PCH/target-options.c
index 06a09502f9..2b85efe07a 100644
--- a/test/PCH/target-options.c
+++ b/test/PCH/target-options.c
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-pch -o %t.pch %S/target-options.h
// RUN: not %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include-pch %t.pch %s -emit-llvm -o - > %t.err 2>&1
// RUN: FileCheck %s < %t.err
-// REQUIRES: x86-registered-target
// CHECK: for the target
diff --git a/test/PCH/tentative-defs.c b/test/PCH/tentative-defs.c
index 7163316a93..42882307dc 100644
--- a/test/PCH/tentative-defs.c
+++ b/test/PCH/tentative-defs.c
@@ -1,7 +1,6 @@
// Test with pch.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s
-// REQUIRES: x86-registered-target
// RUN: grep "@variable = common global i32 0" %t | count 1
// RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1
diff --git a/test/PCH/thread-local.cpp b/test/PCH/thread-local.cpp
index ab37f7b3f7..f65c12af09 100644
--- a/test/PCH/thread-local.cpp
+++ b/test/PCH/thread-local.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s
-// REQUIRES: x86-registered-target
+
#ifndef HEADER_INCLUDED
#define HEADER_INCLUDED
diff --git a/test/PCH/va_arg.c b/test/PCH/va_arg.c
index dba9eea8de..1fb2a838e4 100644
--- a/test/PCH/va_arg.c
+++ b/test/PCH/va_arg.c
@@ -1,6 +1,5 @@
// Test this without pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o -
-// REQUIRES: x86-registered-target
// Test with pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h
diff --git a/test/PCH/va_arg.cpp b/test/PCH/va_arg.cpp
index 0b3c3b107c..7c8dc6b316 100644
--- a/test/PCH/va_arg.cpp
+++ b/test/PCH/va_arg.cpp
@@ -1,6 +1,5 @@
// Test this without pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include %S/Inputs/va_arg.h %s -emit-llvm -o -
-// REQUIRES: x86-registered-target
// Test with pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -x c++-header -o %t %S/Inputs/va_arg.h
diff --git a/tools/arcmt-test/Makefile b/tools/arcmt-test/Makefile
index b4d992cbaa..d9d44bb05b 100644
--- a/tools/arcmt-test/Makefile
+++ b/tools/arcmt-test/Makefile
@@ -17,11 +17,9 @@ TOOL_NO_EXPORTS = 1
NO_INSTALL = 1
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo mc objcarcopts option support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangARCMigrate.a clangRewrite.a \
- clangFrontend.a clangCodeGen.a \
- clangDriver.a clangSerialization.a clangParse.a \
+ clangFrontend.a clangDriver.a clangSerialization.a clangParse.a \
clangSema.a clangEdit.a clangAnalysis.a clangAST.a clangLex.a \
clangBasic.a
diff --git a/tools/c-arcmt-test/Makefile b/tools/c-arcmt-test/Makefile
index 30ba4b4774..fff05f8282 100644
--- a/tools/c-arcmt-test/Makefile
+++ b/tools/c-arcmt-test/Makefile
@@ -21,8 +21,7 @@ NO_INSTALL = 1
# LINK_COMPONENTS before including Makefile.rules
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo support mc objcarcopts option
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
# Note that 'USEDLIBS' must include all of the core clang libraries
# when -static is given to linker on cygming.
@@ -34,7 +33,7 @@ USEDLIBS = clang.a \
clangToolingCore.a \
clangRewriteFrontend.a \
clangRewrite.a \
- clangFrontend.a clangCodeGen.a clangDriver.a \
+ clangFrontend.a clangDriver.a \
clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
clangSerialization.a clangParse.a clangSema.a \
clangAnalysis.a clangEdit.a clangAST.a clangLex.a clangBasic.a
diff --git a/tools/c-index-test/Makefile b/tools/c-index-test/Makefile
index 39adbf3731..62bc9348db 100644
--- a/tools/c-index-test/Makefile
+++ b/tools/c-index-test/Makefile
@@ -22,15 +22,13 @@ TOOL_NO_EXPORTS = 1
# LINK_COMPONENTS before including Makefile.rules
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo support mc objcarcopts option
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
# Note that 'USEDLIBS' must include all of the core clang libraries
# when -static is given to linker on cygming.
USEDLIBS = clang.a \
clangIndex.a clangFormat.a clangRewrite.a \
- clangCodeGen.a \
- clangFrontend.a clangCodeGen.a clangDriver.a \
+ clangFrontend.a clangDriver.a \
clangTooling.a \
clangToolingCore.a \
clangSerialization.a clangParse.a clangSema.a \
diff --git a/tools/clang-check/Makefile b/tools/clang-check/Makefile
index f4b9de120d..e98a131de5 100644
--- a/tools/clang-check/Makefile
+++ b/tools/clang-check/Makefile
@@ -15,9 +15,8 @@ TOOLNAME = clang-check
TOOL_NO_EXPORTS = 1
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo mc option objcarcopts support
-USEDLIBS = clangFrontend.a clangCodeGen.a clangSerialization.a clangDriver.a \
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
+USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \
clangTooling.a clangParse.a clangSema.a \
clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
clangStaticAnalyzerCore.a clangAnalysis.a clangRewriteFrontend.a \
diff --git a/tools/diagtool/Makefile b/tools/diagtool/Makefile
index 1a74506006..d49e976e64 100644
--- a/tools/diagtool/Makefile
+++ b/tools/diagtool/Makefile
@@ -20,7 +20,7 @@ include $(CLANG_LEVEL)/../../Makefile.config
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangFrontend.a clangDriver.a clangSerialization.a clangParse.a \
clangSema.a clangAnalysis.a clangEdit.a clangAST.a clangLex.a \
- clangBasic.a clangCodeGen.a
+ clangBasic.a
include $(CLANG_LEVEL)/Makefile
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
index 1cc4cb748d..26f88a97c5 100644
--- a/tools/libclang/CMakeLists.txt
+++ b/tools/libclang/CMakeLists.txt
@@ -40,7 +40,6 @@ set(SOURCES
set(LIBS
clangAST
clangBasic
- clangCodeGen
clangFrontend
clangIndex
clangLex
diff --git a/tools/libclang/Makefile b/tools/libclang/Makefile
index 66b67a369a..97f663cde4 100644
--- a/tools/libclang/Makefile
+++ b/tools/libclang/Makefile
@@ -16,13 +16,12 @@ LINK_LIBS_IN_SHARED = 1
SHARED_LIBRARY = 1
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter core \
- instrumentation ipo mc mcparser objcarcopts option support
+LINK_COMPONENTS := AsmParser BitReader Core MC MCParser Option Support
USEDLIBS = clangIndex.a clangARCMigrate.a \
clangRewriteFrontend.a \
clangFormat.a \
clangTooling.a clangToolingCore.a \
- clangFrontend.a clangCodeGen.a clangDriver.a \
+ clangFrontend.a clangDriver.a \
clangSerialization.a \
clangParse.a clangSema.a \
clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
diff --git a/unittests/AST/Makefile b/unittests/AST/Makefile
index db6e5010f5..e3b3d7dc33 100644
--- a/unittests/AST/Makefile
+++ b/unittests/AST/Makefile
@@ -10,10 +10,9 @@
CLANG_LEVEL = ../..
TESTNAME = AST
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation mc option objcarcopts support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
- clangCodeGen.a clangRewrite.a clangRewriteFrontend.a \
+ clangRewrite.a clangRewriteFrontend.a \
clangParse.a clangSema.a clangAnalysis.a \
clangEdit.a clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
diff --git a/unittests/ASTMatchers/Dynamic/Makefile b/unittests/ASTMatchers/Dynamic/Makefile
index 148e47cc66..dfd0086c88 100644
--- a/unittests/ASTMatchers/Dynamic/Makefile
+++ b/unittests/ASTMatchers/Dynamic/Makefile
@@ -11,11 +11,10 @@ CLANG_LEVEL = ../../..
TESTNAME = DynamicASTMatchers
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo mc option objcarcopts support
-USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
- clangCodeGen.a clangRewrite.a clangRewriteFrontend.a clangParse.a \
- clangSema.a clangAnalysis.a clangEdit.a clangAST.a \
- clangASTMatchers.a clangLex.a clangBasic.a clangDynamicASTMatchers.a
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
+USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
+ clangRewrite.a clangRewriteFrontend.a clangParse.a clangSema.a \
+ clangAnalysis.a clangEdit.a clangAST.a clangASTMatchers.a \
+ clangLex.a clangBasic.a clangDynamicASTMatchers.a
include $(CLANG_LEVEL)/unittests/Makefile
diff --git a/unittests/ASTMatchers/Makefile b/unittests/ASTMatchers/Makefile
index 6eacbc261b..92f2fa0e5d 100644
--- a/unittests/ASTMatchers/Makefile
+++ b/unittests/ASTMatchers/Makefile
@@ -13,10 +13,9 @@ PARALLEL_DIRS = Dynamic
TESTNAME = ASTMatchers
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation mc option objcarcopts support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
- clangCodeGen.a clangRewrite.a clangRewriteFrontend.a \
+ clangRewrite.a clangRewriteFrontend.a \
clangParse.a clangSema.a clangAnalysis.a \
clangEdit.a clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
diff --git a/unittests/CodeGen/Makefile b/unittests/CodeGen/Makefile
index fa653f5ce7..de347e1afd 100644
--- a/unittests/CodeGen/Makefile
+++ b/unittests/CodeGen/Makefile
@@ -10,9 +10,9 @@
CLANG_LEVEL = ../..
TESTNAME = CodeGen
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo mc option objcarcopts profiledata support
-USEDLIBS = clangFrontend.a clangCodeGen.a clangSerialization.a \
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader mc option \
+ profiledata support
+USEDLIBS = clangCodeGen.a clangFrontend.a clangSerialization.a \
clangDriver.a \
clangParse.a clangSema.a clangAnalysis.a \
clangEdit.a clangAST.a clangLex.a clangBasic.a
diff --git a/unittests/Frontend/Makefile b/unittests/Frontend/Makefile
index 2604f6e5cc..a63ae18245 100644
--- a/unittests/Frontend/Makefile
+++ b/unittests/Frontend/Makefile
@@ -10,8 +10,7 @@
CLANG_LEVEL = ../..
TESTNAME = Frontend
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation mc option objcarcopts support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
diff --git a/unittests/Sema/Makefile b/unittests/Sema/Makefile
index 65ab9bc8dc..7fd5c27ad6 100644
--- a/unittests/Sema/Makefile
+++ b/unittests/Sema/Makefile
@@ -10,10 +10,9 @@
CLANG_LEVEL = ../..
TESTNAME = Sema
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation mc option objcarcopts support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
- clangCodeGen.a clangRewrite.a clangRewriteFrontend.a \
+ clangRewrite.a clangRewriteFrontend.a \
clangParse.a clangSema.a clangAnalysis.a \
clangEdit.a clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
diff --git a/unittests/Tooling/Makefile b/unittests/Tooling/Makefile
index 8e345ce9c2..514e80bd03 100644
--- a/unittests/Tooling/Makefile
+++ b/unittests/Tooling/Makefile
@@ -10,10 +10,9 @@
CLANG_LEVEL = ../..
TESTNAME = Tooling
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter \
- instrumentation ipo mc option objcarcopts support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangTooling.a clangToolingCore.a clangFrontend.a \
- clangCodeGen.a clangSerialization.a clangDriver.a \
+ clangSerialization.a clangDriver.a \
clangParse.a clangRewrite.a clangRewriteFrontend.a \
clangSema.a clangAnalysis.a clangEdit.a \
clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
diff --git a/unittests/libclang/Makefile b/unittests/libclang/Makefile
index ea60fc5924..f8e83aa83a 100644
--- a/unittests/libclang/Makefile
+++ b/unittests/libclang/Makefile
@@ -12,14 +12,13 @@ TESTNAME = libclang
LINK_LIBS_IN_SHARED := 1
include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader ipo objcarcopts \
- instrumentation bitwriter support mc option
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
# Note that 'USEDLIBS' must include all of the core clang libraries
# when -static is given to linker on cygming.
USEDLIBS = clang.a \
clangIndex.a clangFormat.a clangRewrite.a \
- clangCodeGen.a clangFrontend.a clangDriver.a \
+ clangFrontend.a clangDriver.a \
clangTooling.a \
clangToolingCore.a \
clangSerialization.a clangParse.a clangSema.a \