aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-05 15:51:44 +0000
committerDan Gohman <gohman@apple.com>2008-08-05 15:51:44 +0000
commitabbdc89d7e44333657ee67dc4d85b82737e73d63 (patch)
treee9f238737783c1ccaccee1f92072dac179cf0950 /lib
parentc154449b3b3c6ec60c7e7a766b88155b9889f7e9 (diff)
downloadexternal_llvm-abbdc89d7e44333657ee67dc4d85b82737e73d63.tar.gz
external_llvm-abbdc89d7e44333657ee67dc4d85b82737e73d63.tar.bz2
external_llvm-abbdc89d7e44333657ee67dc4d85b82737e73d63.zip
Fix the AsmWriter to not print extra spaces after parameter attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/AsmWriter.cpp2
-rw-r--r--lib/VMCore/ParameterAttributes.cpp2
-rw-r--r--lib/VMCore/Verifier.cpp8
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 98c6fefad7..9a87b1867d 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1385,7 +1385,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
Out << " )";
if (PAL.getParamAttrs(0) != ParamAttr::None)
- Out << " " << ParamAttr::getAsString(PAL.getParamAttrs(0));
+ Out << ' ' << ParamAttr::getAsString(PAL.getParamAttrs(0));
Out << "\n\t\t\tto";
writeOperand(II->getNormalDest(), true);
Out << " unwind";
diff --git a/lib/VMCore/ParameterAttributes.cpp b/lib/VMCore/ParameterAttributes.cpp
index b5fb832fde..d16f54de23 100644
--- a/lib/VMCore/ParameterAttributes.cpp
+++ b/lib/VMCore/ParameterAttributes.cpp
@@ -52,6 +52,8 @@ std::string ParamAttr::getAsString(ParameterAttributes Attrs) {
Result += utostr((Attrs & ParamAttr::Alignment) >> 16);
Result += " ";
}
+ // Trim the trailing space.
+ Result.erase(Result.end()-1);
return Result;
}
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 00a5870a34..c093274d9d 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -404,18 +404,18 @@ void Verifier::VerifyAttrs(ParameterAttributes Attrs, const Type *Ty,
if (isReturnValue) {
ParameterAttributes RetI = Attrs & ParamAttr::ParameterOnly;
Assert1(!RetI, "Attribute " + ParamAttr::getAsString(RetI) +
- "does not apply to return values!", V);
+ " does not apply to return values!", V);
} else {
ParameterAttributes ParmI = Attrs & ParamAttr::ReturnOnly;
Assert1(!ParmI, "Attribute " + ParamAttr::getAsString(ParmI) +
- "only applies to return values!", V);
+ " only applies to return values!", V);
}
for (unsigned i = 0;
i < array_lengthof(ParamAttr::MutuallyIncompatible); ++i) {
ParameterAttributes MutI = Attrs & ParamAttr::MutuallyIncompatible[i];
Assert1(!(MutI & (MutI - 1)), "Attributes " +
- ParamAttr::getAsString(MutI) + "are incompatible!", V);
+ ParamAttr::getAsString(MutI) + " are incompatible!", V);
}
ParameterAttributes TypeI = Attrs & ParamAttr::typeIncompatible(Ty);
@@ -931,7 +931,7 @@ void Verifier::VerifyCallSite(CallSite CS) {
ParameterAttributes VArgI = Attr & ParamAttr::VarArgsIncompatible;
Assert1(!VArgI, "Attribute " + ParamAttr::getAsString(VArgI) +
- "cannot be used for vararg call arguments!", I);
+ " cannot be used for vararg call arguments!", I);
}
visitInstruction(*I);