This situation can occur:
[oota-llvm.git] / lib / Target / X86 / X86TargetAsmInfo.cpp
index 390c5a6ff30c0b0f201215b98474e7066e6e5ca9..887c13dcc767866ee5789621d0b0173d2ea44315 100644 (file)
@@ -66,6 +66,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     ReadOnlySection = "\t.const\n";
     LCOMMDirective = "\t.lcomm\t";
     SwitchToSectionDirective = "\t.section ";
+    StringConstantPrefix = "\1LC";
     COMMDirectiveTakesAlignment = false;
     HasDotTypeDotSizeDirective = false;
     if (TM.getRelocationModel() == Reloc::Static) {
@@ -83,8 +84,9 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
       PersonalitySuffix = "$non_lazy_ptr";
     }
     NeedsIndirectEncoding = true;
-    InlineAsmStart = "# InlineAsm Start";
-    InlineAsmEnd = "# InlineAsm End";
+    InlineAsmStart = "## InlineAsm Start";
+    InlineAsmEnd = "## InlineAsm End";
+    CommentString = "##";
     SetDirective = "\t.set";
     PCSymbol = ".";
     UsedDirective = "\t.no_dead_strip\t";
@@ -119,8 +121,6 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     GlobalEHDirective = "\t.globl\t";
     SupportsWeakOmittedEHFrame = false;
     AbsoluteEHSectionOffsets = false;
-    if (Subtarget->is64Bit())
-      ShortenEHDataOn64Bit = true;
     DwarfEHFrameSection =
     ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
     DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
@@ -228,6 +228,10 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     SectionEndDirectiveSuffix = "\tends\n";
   }
 
+  // On Linux we must declare when we can use a non-executable stack.
+  if (Subtarget->isLinux())
+    NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
+
   AssemblerDialect = Subtarget->getAsmFlavor();
 }
 
@@ -253,7 +257,7 @@ bool X86TargetAsmInfo::LowerToBSwap(CallInst *CI) const {
   Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Tys, 1);
   
   Value *Op = CI->getOperand(1);
-  Op = new CallInst(Int, Op, CI->getName(), CI);
+  Op = CallInst::Create(Int, Op, CI->getName(), CI);
   
   CI->replaceAllUsesWith(Op);
   CI->eraseFromParent();