VC ++“生成代码"是什么意思? [英] VC++ 'Generating Code', what does it mean?

查看:174
本文介绍了VC ++“生成代码"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中进行编译时,编译器将根据自己的判断输出以下内容:

WHen compiling in visual studio the compiler outputs this at what seems to be its own discretion:

1>正在生成代码...

1>Generating Code...

这到底在做什么?

推荐答案

它正在执行所说的操作:它正在生成机器代码.许多编译器将C/C ++源代码转换成某种中间的内部表示形式,随后将其用作生成实际机器代码的源代码. Visual C ++编译器(与许多其他编译器一样)在 batches 中执行此操作:首先,它将一堆源文件转换为该中间表示形式,然后将它们全部转换为机器代码(然后开始在下一批中工作) ).这是当您看到正在生成代码"消息时发生的情况.

It is doing what it says: it is generating the machine code. Many compilers translate C/C++ sources into some intermediate internal representation that is later used as the source to generate the actual machine code. Visual C++ compiler (as many other compilers) does this in batches: first it translates a bunch of source files into that intermediate representation and then converts them all to machine code (and then starts working on the next batch). This is what happens when you see the "Generating code" messages.

我不知道将源文件分成批处理到底使用了什么逻辑.也许它只是按大小来工作:到目前为止生成的所有中间表示的总大小达到某个限制后,它将切换到生成代码"模式.也许还有其他逻辑在起作用.

I don't know what logic exactly it is using to split the source files into batches. Maybe it works simply by size: once the total size of all intermediate representations generated so far gets to some limit, it switches to "generating code" mode. Maybe there's some other logic at work there as well.

在任何情况下,请注意,在这种情况下,不合格的术语代码"不涉及源代码,这意味着它与模板和/或预处理器或类似内容无关.而且,使用不合格的代码"(而不是合格的"代码")来引用C源代码是一件非常小众的事情,与实际的程序员相比,营销部门的工作更多.在程序员的水平上,没有人将C源代码称为代码":)

In any case note that the unqualified term "code" in this case does not refer to source code, meaning that it has nothing to do with templates and/or preprocessor or anything like that. Moreover, referring to C sources with unqualified "code" (as opposed to the qualified "source code") is a very niche thing, more at home with marketing department than with actual programmers. At the programmers' level nobody refers to C sources as just "code" :)

这篇关于VC ++“生成代码"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆