[llvm-branch-commits] [llvm-branch] r104775 - in /llvm/branches/Apple/whitney: include/llvm/Target/TargetMachine.h lib/CodeGen/LLVMTargetMachine.cpp lib/Target/TargetMachine.cpp

Daniel Dunbar daniel at zuster.org
Wed May 26 15:29:24 PDT 2010


Author: ddunbar
Date: Wed May 26 17:29:23 2010
New Revision: 104775

URL: http://llvm.org/viewvc/llvm-project?rev=104775&view=rev
Log:
MC: Add TargetMachine support for setting the value of MCRelaxAll with -filetype=obj.

Modified:
    llvm/branches/Apple/whitney/include/llvm/Target/TargetMachine.h
    llvm/branches/Apple/whitney/lib/CodeGen/LLVMTargetMachine.cpp
    llvm/branches/Apple/whitney/lib/Target/TargetMachine.cpp

Modified: llvm/branches/Apple/whitney/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/include/llvm/Target/TargetMachine.h?rev=104775&r1=104774&r2=104775&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/include/llvm/Target/TargetMachine.h (original)
+++ llvm/branches/Apple/whitney/include/llvm/Target/TargetMachine.h Wed May 26 17:29:23 2010
@@ -99,7 +99,9 @@
   /// AsmInfo - Contains target specific asm information.
   ///
   const MCAsmInfo *AsmInfo;
-  
+
+  unsigned MCRelaxAll : 1;
+
 public:
   virtual ~TargetMachine();
 
@@ -156,6 +158,14 @@
   /// 
   virtual const TargetELFWriterInfo *getELFWriterInfo() const { return 0; }
 
+  /// hasMCRelaxAll - Check whether all machine code instructions should be
+  /// relaxed.
+  bool hasMCRelaxAll() const { return MCRelaxAll; }
+
+  /// setMCRelaxAll - Set whether all machine code instructions should be
+  /// relaxed.
+  void setMCRelaxAll(bool Value) { MCRelaxAll = Value; }
+
   /// getRelocationModel - Returns the code generation relocation model. The
   /// choices are static, PIC, and dynamic-no-pic, and target default.
   static Reloc::Model getRelocationModel();

Modified: llvm/branches/Apple/whitney/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/CodeGen/LLVMTargetMachine.cpp?rev=104775&r1=104774&r2=104775&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/branches/Apple/whitney/lib/CodeGen/LLVMTargetMachine.cpp Wed May 26 17:29:23 2010
@@ -160,8 +160,10 @@
     TargetAsmBackend *TAB = getTarget().createAsmBackend(TargetTriple);
     if (MCE == 0 || TAB == 0)
       return true;
-    
-    AsmStreamer.reset(createMachOStreamer(*Context, *TAB, Out, MCE));
+
+    AsmStreamer.reset(getTarget().createObjectStreamer(TargetTriple, *Context,
+                                                       *TAB, Out, MCE,
+                                                       hasMCRelaxAll()));
     break;
   }
   case CGFT_Null:

Modified: llvm/branches/Apple/whitney/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/TargetMachine.cpp?rev=104775&r1=104774&r2=104775&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/TargetMachine.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/TargetMachine.cpp Wed May 26 17:29:23 2010
@@ -212,7 +212,8 @@
 //
 
 TargetMachine::TargetMachine(const Target &T) 
-  : TheTarget(T), AsmInfo(0) {
+  : TheTarget(T), AsmInfo(0),
+    MCRelaxAll(false) {
   // Typically it will be subtargets that will adjust FloatABIType from Default
   // to Soft or Hard.
   if (UseSoftFloat)





More information about the llvm-branch-commits mailing list