mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 20:33:15 +00:00
clean up some really strange code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92275 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
442ffa1c56
commit
42991eeb64
@ -492,11 +492,12 @@ bool LLParser::ParseMDNode(MDNode *&Result) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create MDNode forward reference
|
// Create MDNode forward reference.
|
||||||
|
|
||||||
|
// FIXME: This is not unique enough!
|
||||||
std::string FwdRefName = "llvm.mdnode.fwdref." + utostr(MID);
|
std::string FwdRefName = "llvm.mdnode.fwdref." + utostr(MID);
|
||||||
SmallVector<Value *, 1> Elts;
|
Value *V = MDString::get(Context, FwdRefName));
|
||||||
Elts.push_back(MDString::get(Context, FwdRefName));
|
MDNode *FwdNode = MDNode::get(Context, &V, 1);
|
||||||
MDNode *FwdNode = MDNode::get(Context, Elts.data(), Elts.size());
|
|
||||||
ForwardRefMDNodes[MID] = std::make_pair(FwdNode, Lex.getLoc());
|
ForwardRefMDNodes[MID] = std::make_pair(FwdNode, Lex.getLoc());
|
||||||
Result = FwdNode;
|
Result = FwdNode;
|
||||||
return false;
|
return false;
|
||||||
@ -521,12 +522,11 @@ bool LLParser::ParseNamedMetadata() {
|
|||||||
Lex.Lex();
|
Lex.Lex();
|
||||||
SmallVector<MetadataBase *, 8> Elts;
|
SmallVector<MetadataBase *, 8> Elts;
|
||||||
do {
|
do {
|
||||||
// FIXME: Eat if present.
|
if (ParseToken(lltok::Metadata, "Expected '!' here"))
|
||||||
if (Lex.getKind() != lltok::Metadata)
|
return true;
|
||||||
return TokError("Expected '!' here");
|
|
||||||
Lex.Lex();
|
Lex.Lex();
|
||||||
|
|
||||||
// FIXME: Will crash on mdstrings etc.
|
// FIXME: This rejects MDStrings. Are they legal in an named MDNode or not?
|
||||||
MDNode *N = 0;
|
MDNode *N = 0;
|
||||||
if (ParseMDNode(N)) return true;
|
if (ParseMDNode(N)) return true;
|
||||||
Elts.push_back(N);
|
Elts.push_back(N);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user