[llvm] Add support for the .base64 directive (fixes #165499) (PR #165549)
Ben Kallus via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 14:24:33 PDT 2025
================
@@ -3074,6 +3079,25 @@ bool AsmParser::parseDirectiveAscii(StringRef IDVal, bool ZeroTerminated) {
return parseMany(parseOp);
}
+/// parseDirectiveBase64:
+// ::= .base64 "string"
+bool AsmParser::parseDirectiveBase64() {
+ if (checkForValidSection() ||
+ check(getTok().isNot(AsmToken::String), "expected string")) {
+ return true;
+ }
+
+ std::vector<char> Decoded;
+ std::string const str = getTok().getStringContents().str();
+ if (str.empty() || decodeBase64(str, Decoded)) {
+ return true;
+ }
----------------
kenballus wrote:
Done. Thanks.
https://github.com/llvm/llvm-project/pull/165549
More information about the llvm-commits
mailing list