summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-01 01:27:45 +0000
committerChris Lattner <sabre@nondot.org>2009-11-01 01:27:45 +0000
commitaa99c94e2a75e86381bcc45de61c11725a1484d6 (patch)
tree5ebc881e76d6c5d15bc2a8240caa9c274da1a3ce /llvm/lib/AsmParser/LLParser.cpp
parent6f29ad917051349b99d566ddf57add7c60489094 (diff)
downloadbcm5719-llvm-aa99c94e2a75e86381bcc45de61c11725a1484d6.tar.gz
bcm5719-llvm-aa99c94e2a75e86381bcc45de61c11725a1484d6.zip
Revert 85678/85680. The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 9dbd78c558e..07bf261573c 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -123,25 +123,20 @@ bool LLParser::ResolveForwardRefBlockAddresses(Function *TheFn,
// Loop over all the references, resolving them.
for (unsigned i = 0, e = Refs.size(); i != e; ++i) {
BasicBlock *Res;
- if (Refs[i].first.Kind == ValID::t_Null)
- Res = 0;
- else if (PFS) {
+ if (PFS) {
if (Refs[i].first.Kind == ValID::t_LocalName)
Res = PFS->GetBB(Refs[i].first.StrVal, Refs[i].first.Loc);
- else {
- assert(Refs[i].first.Kind == ValID::t_LocalID);
+ else
Res = PFS->GetBB(Refs[i].first.UIntVal, Refs[i].first.Loc);
- }
} else if (Refs[i].first.Kind == ValID::t_LocalID) {
return Error(Refs[i].first.Loc,
"cannot take address of numeric label after it the function is defined");
} else {
- assert(Refs[i].first.Kind == ValID::t_LocalName);
Res = dyn_cast_or_null<BasicBlock>(
TheFn->getValueSymbolTable().lookup(Refs[i].first.StrVal));
}
- if (Res == 0 && Refs[i].first.Kind != ValID::t_Null)
+ if (Res == 0)
return Error(Refs[i].first.Loc,
"referenced value is not a basic block");
@@ -2060,11 +2055,10 @@ bool LLParser::ParseValID(ValID &ID) {
ParseValID(Label) ||
ParseToken(lltok::rparen, "expected ')' in block address expression"))
return true;
-
+
if (Fn.Kind != ValID::t_GlobalID && Fn.Kind != ValID::t_GlobalName)
return Error(Fn.Loc, "expected function name in blockaddress");
- if (Label.Kind != ValID::t_LocalID && Label.Kind != ValID::t_LocalName &&
- Label.Kind != ValID::t_Null)
+ if (Label.Kind != ValID::t_LocalID && Label.Kind != ValID::t_LocalName)
return Error(Label.Loc, "expected basic block name in blockaddress");
// Make a global variable as a placeholder for this reference.
OpenPOWER on IntegriCloud