Skip to content

Compile VMCore with -fno-exceptions #1169

@llvmbot

Description

@llvmbot
Bugzilla Link 797
Resolution FIXED
Resolved on Feb 22, 2010 12:47
Version 1.0
OS All
Reporter LLVM Bugzilla Contributor
CC @lattner

Extended Description

We might be able to reduce the size of libVMCore.a by compiling it with the
-fno-exceptions flag. This prevents the compiler from generating functions that
know how to propagate exceptions. VMCore is very close to being exception
handling free. With a little work, we could make it exception free and turn
this flag on permanently in the lib/VMCore/Makefile.

Here are the outstanding issues:

Pass.cpp in the constructor of FunctionPass needs to handle exceptions coming
from the bytecode reader when its function is materialized. Possible solutions:

  1. Don't have bytecode reader throw exceptions (big change). This actually
    implies that any ModuleProvider would not be able to throw exceptions.
  2. Move Pass.cpp out of VMCore
  3. Rearrange the code so that Pass.cpp is not the thing doing the function
    materialization.

Verifier.cpp throws an exception when it checks abortIfBroken(). This is a
feature used by the bcanalyzer and llvm-as. Both programs could be made to just
abort if the verifier fails.

The libraries VMCore depends upon (Support, bzip2, System) do not throw in
anything that VMCore includes or calls.

Since VMCore has a lot of functions, this could be a big win for library size.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions