mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
revert r179735, it has no testcases, and doesn't really make sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include "llvm/IR/TypeFinder.h"
|
||||
#include "llvm/IR/ValueSymbolTable.h"
|
||||
#include "llvm/Support/CFG.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@@ -43,12 +42,6 @@
|
||||
#include <cctype>
|
||||
using namespace llvm;
|
||||
|
||||
static cl::opt<bool>
|
||||
OldStyleAttrSyntax("enable-old-style-attr-syntax",
|
||||
cl::desc("Output attributes on functions rather than in attribute groups"),
|
||||
cl::Hidden,
|
||||
cl::init(false));
|
||||
|
||||
// Make virtual table appear in this compilation unit.
|
||||
AssemblyAnnotationWriter::~AssemblyAnnotationWriter() {}
|
||||
|
||||
@@ -1385,7 +1378,7 @@ void AssemblyWriter::printModule(const Module *M) {
|
||||
printFunction(I);
|
||||
|
||||
// Output all attribute groups.
|
||||
if (!OldStyleAttrSyntax && !Machine.as_empty()) {
|
||||
if (!Machine.as_empty()) {
|
||||
Out << '\n';
|
||||
writeAllAttributeGroups();
|
||||
}
|
||||
@@ -1613,9 +1606,24 @@ void AssemblyWriter::printFunction(const Function *F) {
|
||||
Out << "; Materializable\n";
|
||||
|
||||
const AttributeSet &Attrs = F->getAttributes();
|
||||
if (!OldStyleAttrSyntax && Attrs.hasAttributes(AttributeSet::FunctionIndex)) {
|
||||
if (Attrs.hasAttributes(AttributeSet::FunctionIndex)) {
|
||||
AttributeSet AS = Attrs.getFnAttributes();
|
||||
std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
|
||||
std::string AttrStr;
|
||||
|
||||
unsigned Idx = 0;
|
||||
for (unsigned E = AS.getNumSlots(); Idx != E; ++Idx)
|
||||
if (AS.getSlotIndex(Idx) == AttributeSet::FunctionIndex)
|
||||
break;
|
||||
|
||||
for (AttributeSet::iterator I = AS.begin(Idx), E = AS.end(Idx);
|
||||
I != E; ++I) {
|
||||
Attribute Attr = *I;
|
||||
if (!Attr.isStringAttribute()) {
|
||||
if (!AttrStr.empty()) AttrStr += ' ';
|
||||
AttrStr += Attr.getAsString();
|
||||
}
|
||||
}
|
||||
|
||||
if (!AttrStr.empty())
|
||||
Out << "; Function Attrs: " << AttrStr << '\n';
|
||||
}
|
||||
@@ -1677,15 +1685,8 @@ void AssemblyWriter::printFunction(const Function *F) {
|
||||
Out << ')';
|
||||
if (F->hasUnnamedAddr())
|
||||
Out << " unnamed_addr";
|
||||
if (!OldStyleAttrSyntax) {
|
||||
if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
|
||||
Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
|
||||
} else {
|
||||
AttributeSet AS = Attrs.getFnAttributes();
|
||||
std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
|
||||
if (!AttrStr.empty())
|
||||
Out << ' ' << AttrStr;
|
||||
}
|
||||
if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
|
||||
Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
|
||||
if (F->hasSection()) {
|
||||
Out << " section \"";
|
||||
PrintEscapedString(F->getSection(), Out);
|
||||
@@ -2156,8 +2157,7 @@ void AssemblyWriter::writeAllAttributeGroups() {
|
||||
for (std::vector<std::pair<AttributeSet, unsigned> >::iterator
|
||||
I = asVec.begin(), E = asVec.end(); I != E; ++I)
|
||||
Out << "attributes #" << I->second << " = { "
|
||||
<< I->first.getAsString(AttributeSet::FunctionIndex, true, true)
|
||||
<< " }\n";
|
||||
<< I->first.getAsString(AttributeSet::FunctionIndex, true) << " }\n";
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user