11 CIL Limitations
There are several implementation details of CIL that might make it unusable
or less than ideal for certain tasks:
-
CIL operates after preprocessing. If you need to see comments, for
example, you cannot use CIL. But you can use attributes and pragmas instead.
And there is some support to help you patch the include files before they are
seen by the preprocessor. For example, this is how we turn some
#defines that we don't like into function calls.
- CIL does transform the code in a non-trivial way. This is done in order
to make most analyses easier. But if you want to see the code e1, e2++
exactly as it appears in the code, then you should not use CIL.
- CIL removes all local scopes and moves all variables to function
scope. It also separates a declaration with an initializer into a declaration
plus an assignment. The unfortunate effect of this transformation is that
local variables cannot have the const qualifier.