aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CodeGenAction.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-07 23:21:04 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-07 23:21:04 +0000
commit05a7f3ddce9a88249b05b896e70f66e9ed381743 (patch)
tree04f5dd72cebf89f86b6dd2806d1b48ed15b36297 /lib/Frontend/CodeGenAction.cpp
parent897c6768db8e09c692009280d9f1d71fb17023bf (diff)
Frontend: Drop unnecessary TargetData argument to EmitBackendOutput, we always
create modules which have target data strings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CodeGenAction.cpp')
-rw-r--r--lib/Frontend/CodeGenAction.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/Frontend/CodeGenAction.cpp b/lib/Frontend/CodeGenAction.cpp
index a3eba0fbd5..99af838a33 100644
--- a/lib/Frontend/CodeGenAction.cpp
+++ b/lib/Frontend/CodeGenAction.cpp
@@ -20,11 +20,11 @@
#include "clang/Frontend/FrontendDiagnostic.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
+#include "llvm/Pass.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/Timer.h"
-#include "llvm/Target/TargetData.h"
using namespace clang;
using namespace llvm;
@@ -42,7 +42,6 @@ namespace {
llvm::OwningPtr<CodeGenerator> Gen;
llvm::OwningPtr<llvm::Module> TheModule;
- llvm::TargetData *TheTargetData;
public:
BackendConsumer(BackendAction action, Diagnostic &_Diags,
@@ -56,15 +55,10 @@ namespace {
TargetOpts(targetopts),
AsmOutStream(OS),
LLVMIRGeneration("LLVM IR Generation Time"),
- Gen(CreateLLVMCodeGen(Diags, infile, compopts, C)),
- TheTargetData(0) {
+ Gen(CreateLLVMCodeGen(Diags, infile, compopts, C)) {
llvm::TimePassesIsEnabled = TimePasses;
}
- ~BackendConsumer() {
- delete TheTargetData;
- }
-
llvm::Module *takeModule() { return TheModule.take(); }
virtual void Initialize(ASTContext &Ctx) {
@@ -76,7 +70,6 @@ namespace {
Gen->Initialize(Ctx);
TheModule.reset(Gen->GetModule());
- TheTargetData = new llvm::TargetData(Ctx.Target.getTargetDescription());
if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.stopTimer();
@@ -109,7 +102,7 @@ namespace {
}
// Silently ignore if we weren't initialized for some reason.
- if (!TheModule || !TheTargetData)
+ if (!TheModule)
return;
// Make sure IR generation is happy with the module. This is released by
@@ -134,7 +127,7 @@ namespace {
this);
EmitBackendOutput(Diags, CodeGenOpts, TargetOpts,
- TheModule.get(), TheTargetData, Action, AsmOutStream);
+ TheModule.get(), Action, AsmOutStream);
Ctx.setInlineAsmDiagnosticHandler(OldHandler, OldContext);
}