[llvm-branch-commits] [llvm-branch] r93617 - in /llvm/branches/Apple/Zoidberg: include/llvm/Target/TargetMachine.h lib/CodeGen/AsmPrinter/DwarfException.cpp lib/Target/X86/X86TargetMachine.cpp lib/Target/X86/X86TargetMachine.h
Bill Wendling
isanbard at gmail.com
Fri Jan 15 17:43:44 PST 2010
Author: void
Date: Fri Jan 15 19:43:44 2010
New Revision: 93617
URL: http://llvm.org/viewvc/llvm-project?rev=93617&view=rev
Log:
$ svn merge -c 93616 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r93616 into '.':
U include/llvm/Target/TargetMachine.h
U lib/CodeGen/AsmPrinter/DwarfException.cpp
U lib/Target/X86/X86TargetMachine.h
U lib/Target/X86/X86TargetMachine.cpp
Modified:
llvm/branches/Apple/Zoidberg/include/llvm/Target/TargetMachine.h
llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfException.cpp
llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.cpp
llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.h
Modified: llvm/branches/Apple/Zoidberg/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/include/llvm/Target/TargetMachine.h?rev=93617&r1=93616&r2=93617&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/include/llvm/Target/TargetMachine.h (original)
+++ llvm/branches/Apple/Zoidberg/include/llvm/Target/TargetMachine.h Fri Jan 15 19:43:44 2010
@@ -81,6 +81,14 @@
};
}
+// Specify if we should encode the LSDA pointer in the FDE as 4- or 8-bytes.
+namespace DwarfLSDAEncoding {
+ enum Encoding {
+ Default,
+ FourByte,
+ EightByte
+ };
+}
//===----------------------------------------------------------------------===//
///
@@ -192,6 +200,12 @@
/// is false.
static void setAsmVerbosityDefault(bool);
+ /// getLSDAEncoding - Returns the LSDA pointer encoding. The choices are
+ /// 4-byte, 8-byte, and target default.
+ virtual DwarfLSDAEncoding::Encoding getLSDAEncoding() const {
+ return DwarfLSDAEncoding::Default;
+ }
+
/// CodeGenFileType - These enums are meant to be passed into
/// addPassesToEmitFile to indicate what type of file to emit.
enum CodeGenFileType {
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=93617&r1=93616&r2=93617&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfException.cpp Fri Jan 15 19:43:44 2010
@@ -289,17 +289,28 @@
if (MMI->getPersonalities()[0] != NULL) {
bool is4Byte = TD->getPointerSize() == sizeof(int32_t);
- Asm->EmitULEB128Bytes(is4Byte ? 4 : 8);
- Asm->EOL("Augmentation size");
+ if (Asm->TM.getLSDAEncoding() == DwarfLSDAEncoding::FourByte) {
+ Asm->EmitULEB128Bytes(4);
+ Asm->EOL("Augmentation size");
- if (EHFrameInfo.hasLandingPads)
- EmitReference("exception", EHFrameInfo.Number, true, false);
- else {
- if (is4Byte)
- Asm->EmitInt32((int)0);
+ if (EHFrameInfo.hasLandingPads)
+ EmitReference("exception", EHFrameInfo.Number, true, true);
else
- Asm->EmitInt64((int)0);
+ Asm->EmitInt32((int)0);
+ } else {
+ Asm->EmitULEB128Bytes(is4Byte ? 4 : 8);
+ Asm->EOL("Augmentation size");
+
+ if (EHFrameInfo.hasLandingPads) {
+ EmitReference("exception", EHFrameInfo.Number, true, false);
+ } else {
+ if (is4Byte)
+ Asm->EmitInt32((int)0);
+ else
+ Asm->EmitInt64((int)0);
+ }
}
+
Asm->EOL("Language Specific Data Area");
} else {
Asm->EmitULEB128Bytes(0);
Modified: llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.cpp?rev=93617&r1=93616&r2=93617&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.cpp Fri Jan 15 19:43:44 2010
@@ -240,3 +240,10 @@
PM.add(createX86ObjectCodeEmitterPass(*this, OCE));
return false;
}
+
+DwarfLSDAEncoding::Encoding X86TargetMachine::getLSDAEncoding() const {
+ if (Subtarget.isTargetDarwin() && Subtarget.getDarwinVers() > 10)
+ return DwarfLSDAEncoding::FourByte;
+
+ return DwarfLSDAEncoding::Default;
+}
Modified: llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.h?rev=93617&r1=93616&r2=93617&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.h (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/X86/X86TargetMachine.h Fri Jan 15 19:43:44 2010
@@ -57,6 +57,8 @@
return Subtarget.isTargetELF() ? &ELFWriterInfo : 0;
}
+ virtual DwarfLSDAEncoding::Encoding getLSDAEncoding() const;
+
// Set up the pass pipeline.
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
More information about the llvm-branch-commits
mailing list