projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a potential serious problem where kills belonging to the val# defined by a two...
[oota-llvm.git]
/
lib
/
CodeGen
/
ELFWriter.cpp
diff --git
a/lib/CodeGen/ELFWriter.cpp
b/lib/CodeGen/ELFWriter.cpp
index 5fd3dcc1d6cb354e22dceafaf3810e075e2aeecd..908abe5f1bba032e318bf3bcb2ffb7e2691c2f56 100644
(file)
--- a/
lib/CodeGen/ELFWriter.cpp
+++ b/
lib/CodeGen/ELFWriter.cpp
@@
-2,8
+2,8
@@
//
// The LLVM Compiler Infrastructure
//
//
// The LLVM Compiler Infrastructure
//
-// This file
was developed by Chris Lattner and is distributed under th
e
-//
University of Illinois Open Source
License. See LICENSE.TXT for details.
+// This file
is distributed under the University of Illinois Open Sourc
e
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
@@
-47,6
+47,7
@@
#include <list>
using namespace llvm;
#include <list>
using namespace llvm;
+char ELFWriter::ID = 0;
/// AddELFWriter - Concrete function to add the ELF writer to the function pass
/// manager.
MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
/// AddELFWriter - Concrete function to add the ELF writer to the function pass
/// manager.
MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
@@
-71,7
+72,7
@@
namespace llvm {
std::vector<unsigned char> *OutBuffer;
size_t FnStart;
public:
std::vector<unsigned char> *OutBuffer;
size_t FnStart;
public:
- ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
+
explicit
ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
void startFunction(MachineFunction &F);
bool finishFunction(MachineFunction &F);
void startFunction(MachineFunction &F);
bool finishFunction(MachineFunction &F);
@@
-176,7
+177,8
@@
bool ELFCodeEmitter::finishFunction(MachineFunction &F) {
// ELFWriter Implementation
//===----------------------------------------------------------------------===//
// ELFWriter Implementation
//===----------------------------------------------------------------------===//
-ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
+ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm)
+ : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
e_flags = 0; // e_flags defaults to 0, no flags.
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
e_flags = 0; // e_flags defaults to 0, no flags.
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
@@
-255,8
+257,8
@@
void ELFWriter::EmitGlobal(GlobalVariable *GV) {
}
const Type *GVType = (const Type*)GV->getType();
}
const Type *GVType = (const Type*)GV->getType();
- unsigned Align = TM.getTargetData()->get
TypeAlignmentPref(GVType
);
- unsigned Size = TM.getTargetData()->getTypeSize(GVType);
+ unsigned Align = TM.getTargetData()->get
PreferredAlignment(GV
);
+ unsigned Size = TM.getTargetData()->get
ABI
TypeSize(GVType);
// If this global has a zero initializer, it is part of the .bss or common
// section.
// If this global has a zero initializer, it is part of the .bss or common
// section.