我想将上传的文件编码为base64,以便我可以将它们传递给请求.问题是我正在使用带有Typescript的Angular 2,但我找不到任何关于如何做到这一点的信息.我发现在Javascript中它可以用canvas完成,但我不知道如何在Typescript中实现代码.
<input type="file" class="form-control" accept="image/*" multiple
[(ngModel)]="spot.images" name="images">
Run Code Online (Sandbox Code Playgroud) 我有一个文件print.c,它有两个功能:
void printLoad(...) {
// print address and value of memory location from which value
printf("address=... value=...", ...);
}
void printStore(...) {
// print address and value of memory location from which value
}
Run Code Online (Sandbox Code Playgroud)
我有一个 LLVM 传递,它遍历指令并在当前指令(加载/存储指令)之后添加 CallInst 指令 printLoad 或 printStore (取决于指令类型)。
为了调用这个 printStore 或 printLoad,我需要向 CallInst::Create 函数添加适当的参数,它们是内存位置的地址和值。
这是我想要实现的一个例子:
define void @mains() #0 {
%1 = alloca i32, align 4
%2 = alloca i32, align 4
store i32 0, i32* %1, align 4
store i32 5, i32* %1, align …Run Code Online (Sandbox Code Playgroud)