Modified: CreateTargetInfo(). Now takes Diagnostic* instead of Diagnostic&.
Modified: ctor of SerializationTest: Now takes LangOptions argument. We
will eventually serialize this as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44630 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.h b/Driver/ASTConsumers.h
index a22113a..ab2f0ee 100644
--- a/Driver/ASTConsumers.h
+++ b/Driver/ASTConsumers.h
@@ -32,7 +32,8 @@
ASTConsumer *CreateUnitValsChecker(Diagnostic &Diags);
ASTConsumer *CreateLLVMEmitter(Diagnostic &Diags, const LangOptions &Features);
ASTConsumer *CreateCodeRewriterTest(Diagnostic &Diags);
-ASTConsumer *CreateSerializationTest(Diagnostic &Diags, FileManager& FMgr);
+ASTConsumer *CreateSerializationTest(Diagnostic &Diags, FileManager& FMgr,
+ const LangOptions &LOpts);
} // end clang namespace
diff --git a/Driver/SerializationTest.cpp b/Driver/SerializationTest.cpp
index 0354f2b..813aa7e 100644
--- a/Driver/SerializationTest.cpp
+++ b/Driver/SerializationTest.cpp
@@ -56,6 +56,7 @@
ASTContext* Context;
Diagnostic &Diags;
FileManager &FMgr;
+ const LangOptions& LangOpts;
std::list<Decl*> Decls;
enum { BasicMetadataBlock = 1,
@@ -63,8 +64,8 @@
DeclsBlock = 3 };
public:
- SerializationTest(Diagnostic &d, FileManager& fmgr)
- : Context(NULL), Diags(d), FMgr(fmgr) {};
+ SerializationTest(Diagnostic &d, FileManager& fmgr, const LangOptions& LOpts)
+ : Context(NULL), Diags(d), FMgr(fmgr), LangOpts(LOpts) {};
~SerializationTest();
@@ -84,8 +85,9 @@
} // end anonymous namespace
ASTConsumer*
-clang::CreateSerializationTest(Diagnostic &Diags, FileManager& FMgr) {
- return new SerializationTest(Diags,FMgr);
+clang::CreateSerializationTest(Diagnostic &Diags, FileManager& FMgr,
+ const LangOptions &LOpts) {
+ return new SerializationTest(Diags,FMgr,LOpts);
}
static void WritePreamble(llvm::BitstreamWriter& Stream) {
@@ -272,7 +274,7 @@
std::vector<std::string> triples;
triples.push_back(triple);
delete [] triple;
- Dezr.RegisterPtr(PtrID,CreateTargetInfo(triples,Diags));
+ Dezr.RegisterPtr(PtrID,CreateTargetInfo(triples,&Diags));
}
// For Selectors, we must read the identifier table first because the
diff --git a/Driver/Targets.cpp b/Driver/Targets.cpp
index 336beb9..63df5d4 100644
--- a/Driver/Targets.cpp
+++ b/Driver/Targets.cpp
@@ -691,7 +691,7 @@
/// CreateTargetInfo - Return the set of target info objects as specified by
/// the -arch command line option.
TargetInfo *clang::CreateTargetInfo(const std::vector<std::string>& triples,
- Diagnostic &Diags) {
+ Diagnostic *Diags) {
assert (!triples.empty() && "No target triple.");
@@ -701,7 +701,7 @@
if (!PrimaryTarget)
return NULL;
- TargetInfo *TI = new TargetInfo(PrimaryTarget, &Diags);
+ TargetInfo *TI = new TargetInfo(PrimaryTarget, Diags);
// Add all secondary targets.
for (unsigned i = 1, e = triples.size(); i != e; ++i) {
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 64f8cb6..484a03c 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -848,7 +848,7 @@
return CreateUnitValsChecker(Diag);
case TestSerialization:
- return CreateSerializationTest(Diag, FileMgr);
+ return CreateSerializationTest(Diag, FileMgr, LangOpts);
case EmitLLVM:
return CreateLLVMEmitter(Diag, LangOpts);
@@ -1004,7 +1004,7 @@
{ // Create triples, and create the TargetInfo.
std::vector<std::string> triples;
CreateTargetTriples(triples);
- Target = CreateTargetInfo(triples,Diags);
+ Target = CreateTargetInfo(triples,&Diags);
if (Target == 0) {
fprintf(stderr, "Sorry, I don't know what target this is: %s\n",
diff --git a/Driver/clang.h b/Driver/clang.h
index eadeb70..098c51b 100644
--- a/Driver/clang.h
+++ b/Driver/clang.h
@@ -37,7 +37,7 @@
/// CreateTargetInfo - Return the set of target info objects as specified by
/// the -arch command line option.
TargetInfo *CreateTargetInfo(const std::vector<std::string>& triples,
- Diagnostic &Diags);
+ Diagnostic *Diags);
/// EmitLLVMFromASTs - Implement -emit-llvm, which generates llvm IR from C.
void EmitLLVMFromASTs(Preprocessor &PP, unsigned MainFileID,