Removed long obsolete (and broken) LLVM IR annotation code.

If someone wants to redo this properly, an idea that actually works
would be to use a custom llvm::AssemblyAnnotationWriter.
This commit is contained in:
David Nadlinger
2012-12-18 15:52:14 +01:00
parent c250b8b208
commit 2988bc46e0
7 changed files with 0 additions and 32 deletions

View File

@@ -301,7 +301,6 @@ struct Param
OUTPUTFLAG output_bc;
OUTPUTFLAG output_s;
OUTPUTFLAG output_o;
bool llvmAnnotate;
bool useInlineAsm;
bool verbose_cg;
bool useAvailableExternally;

View File

@@ -298,7 +298,6 @@ struct Param
OUTPUTFLAG output_bc;
OUTPUTFLAG output_s;
OUTPUTFLAG output_o;
bool llvmAnnotate;
bool useInlineAsm;
bool verbose_cg;
bool useAvailableExternally;

View File

@@ -102,11 +102,6 @@ static cl::opt<ubyte, true> debugInfo(
cl::location(global.params.symdebug),
cl::init(0));
static cl::opt<bool, true> annotate("annotate",
cl::desc("Annotate the bitcode with human readable source code"),
cl::location(global.params.llvmAnnotate));
cl::opt<bool> noAsm("noasm",
cl::desc("Disallow use of inline assembler"));

View File

@@ -1548,24 +1548,6 @@ LLConstant* DtoConstExpInit(Loc loc, Type* type, Expression* exp)
//////////////////////////////////////////////////////////////////////////////////////////
void DtoAnnotation(const char* str)
{
std::string s("CODE: ");
s.append(str);
char* p = &s[0];
while (*p)
{
if (*p == '"')
*p = '\'';
++p;
}
// create a noop with the code as the result name!
// FIXME: this is const folded and eliminated immediately ... :/
gIR->ir->CreateAnd(DtoConstSize_t(0),DtoConstSize_t(0),s.c_str());
}
//////////////////////////////////////////////////////////////////////////////////////////
LLConstant* DtoTypeInfoOf(Type* type, bool base)
{
type = type->merge2(); // needed.. getTypeInfo does the same

View File

@@ -123,9 +123,6 @@ LLConstant* DtoConstInitializer(Loc loc, Type* type, Initializer* init);
LLConstant* DtoConstExpInit(Loc loc, Type* t, Expression* exp);
DValue* DtoInitializer(LLValue* target, Initializer* init);
// annotation generator
void DtoAnnotation(const char* str);
// getting typeinfo of type, base=true casts to object.TypeInfo
LLConstant* DtoTypeInfoOf(Type* ty, bool base=true);

View File

@@ -194,8 +194,6 @@ void ExpStatement::toIR(IRState* p)
DtoDwarfStopPoint(loc.linnum);
if (exp) {
if (global.params.llvmAnnotate)
DtoAnnotation(exp->toChars());
elem* e;
// a cast(void) around the expression is allowed, but doesn't require any code
if(exp->op == TOKcast && exp->type == Type::tvoid) {

View File

@@ -260,8 +260,6 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args,
for (int i=begin,k=0; i<n_arguments; i++,k++)
{
Expression* argexp = static_cast<Expression*>(arguments->data[i]);
if (global.params.llvmAnnotate)
DtoAnnotation(argexp->toChars());
LLValue* argdst = DtoGEPi(mem,0,k);
argdst = DtoBitCast(argdst, getPtrToType(DtoType(argexp->type)));
DtoVariadicArgument(argexp, argdst);