projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for 128 bit multiplicative operations.
[oota-llvm.git]
/
lib
/
CodeGen
/
AsmPrinter.cpp
diff --git
a/lib/CodeGen/AsmPrinter.cpp
b/lib/CodeGen/AsmPrinter.cpp
index a682a3f5a88dc752191550a3a07603edae8c8234..366b8b398f9a1b8a971b89591b7b91631e05d5f1 100644
(file)
--- a/
lib/CodeGen/AsmPrinter.cpp
+++ b/
lib/CodeGen/AsmPrinter.cpp
@@
-21,7
+21,6
@@
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
@@
-29,14
+28,12
@@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <cerrno>
using namespace llvm;
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <cerrno>
using namespace llvm;
-static cl::opt<bool>
-AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
-
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
const TargetAsmInfo *T)
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
const TargetAsmInfo *T)
@@
-296,13
+293,16
@@
void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
// the appropriate section.
TargetLowering *LoweringInfo = TM.getTargetLowering();
// the appropriate section.
TargetLowering *LoweringInfo = TM.getTargetLowering();
- const char* JumpTableDataSection = TAI->getJumpTableDataSection();
+ const char* JumpTableDataSection = TAI->getJumpTableDataSection();
+ const Function *F = MF.getFunction();
+ unsigned SectionFlags = TAI->SectionFlagsForGlobal(F);
if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) ||
if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) ||
- !JumpTableDataSection) {
+ !JumpTableDataSection ||
+ SectionFlags & SectionFlags::Linkonce) {
// In PIC mode, we need to emit the jump table to the same section as the
// function body itself, otherwise the label differences won't make sense.
// In PIC mode, we need to emit the jump table to the same section as the
// function body itself, otherwise the label differences won't make sense.
- // We should also do if the section name is NULL
.
- const Function *F = MF.getFunction();
+ // We should also do if the section name is NULL
or function is declared in
+ // discardable section.
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
} else {
SwitchToDataSection(JumpTableDataSection);
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
} else {
SwitchToDataSection(JumpTableDataSection);
@@
-551,8
+551,19
@@
void AsmPrinter::PrintHex(int Value) const {
void AsmPrinter::EOL() const {
O << '\n';
}
void AsmPrinter::EOL() const {
O << '\n';
}
+
void AsmPrinter::EOL(const std::string &Comment) const {
void AsmPrinter::EOL(const std::string &Comment) const {
- if (AsmVerbose && !Comment.empty()) {
+ if (VerboseAsm && !Comment.empty()) {
+ O << '\t'
+ << TAI->getCommentString()
+ << ' '
+ << Comment;
+ }
+ O << '\n';
+}
+
+void AsmPrinter::EOL(const char* Comment) const {
+ if (VerboseAsm && *Comment) {
O << '\t'
<< TAI->getCommentString()
<< ' '
O << '\t'
<< TAI->getCommentString()
<< ' '
@@
-1369,7
+1380,7
@@
void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
O << ':';
if (printComment && MBB->getBasicBlock())
O << '\t' << TAI->getCommentString() << ' '
O << ':';
if (printComment && MBB->getBasicBlock())
O << '\t' << TAI->getCommentString() << ' '
- << MBB->getBasicBlock()->getName();
+ << MBB->getBasicBlock()->getName
Start
();
}
/// printPICJumpTableSetLabel - This method prints a set label for the
}
/// printPICJumpTableSetLabel - This method prints a set label for the
@@
-1437,10
+1448,23
@@
void AsmPrinter::printDataDirective(const Type *type) {
}
}
}
}
-void AsmPrinter::printSuffixedName(std::string &Name, const char* Suffix) {
+void AsmPrinter::printSuffixedName(const char *Name, const char *Suffix,
+ const char *Prefix) {
+ if (Name[0]=='\"')
+ O << '\"';
+ O << TAI->getPrivateGlobalPrefix();
+ if (Prefix) O << Prefix;
+ if (Name[0]=='\"')
+ O << '\"';
if (Name[0]=='\"')
if (Name[0]=='\"')
- O << '\"' << TAI->getPrivateGlobalPrefix() <<
- Name.substr(1, Name.length()-2) << Suffix << '\"';
+ O << Name[1];
else
else
- O << TAI->getPrivateGlobalPrefix() << Name << Suffix;
+ O << Name;
+ O << Suffix;
+ if (Name[0]=='\"')
+ O << '\"';
+}
+
+void AsmPrinter::printSuffixedName(const std::string &Name, const char* Suffix) {
+ printSuffixedName(Name.c_str(), Suffix);
}
}