Skip to content

Commit a0efa09

Browse files
committed
PNaCl ABI: Promote illegal integer types
This pass (mostly) legalizes integer types by promoting them. It has some limitations (e.g. it can't change function types) but it is more than sufficient for what clang and SROA generate. A more significant limitation of promotion is that packed bitfields of size > 64 bits are still not handled. There are none in our tests (other than callingconv_case_by_case which doesn't require a stable pexe) but we will want to either handle them by correctly expanding them, or find a better way to error out. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360 [email protected], [email protected] Review URL: https://codereview.chromium.org/14569012
1 parent 52daf9d commit a0efa09

File tree

6 files changed

+958
-0
lines changed

6 files changed

+958
-0
lines changed

include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ void initializeInsertDivideCheckPass(PassRegistry&);
290290
void initializeNaClCcRewritePass(PassRegistry&);
291291
void initializePNaClABIVerifyModulePass(PassRegistry&);
292292
void initializePNaClABIVerifyFunctionsPass(PassRegistry&);
293+
void initializePromoteIntegersPass(PassRegistry&);
293294
void initializeResolveAliasesPass(PassRegistry&);
294295
void initializeStripMetadataPass(PassRegistry&);
295296
// @LOCALMOD-END

include/llvm/Transforms/NaCl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ModulePass *createExpandTlsConstantExprPass();
2828
ModulePass *createExpandVarArgsPass();
2929
ModulePass *createFlattenGlobalsPass();
3030
ModulePass *createGlobalCleanupPass();
31+
FunctionPass *createPromoteIntegersPass();
3132
ModulePass *createResolveAliasesPass();
3233
ModulePass *createStripMetadataPass();
3334
FunctionPass *createInsertDivideCheckPass();

lib/Transforms/NaCl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_llvm_library(LLVMNaClTransforms
1010
InsertDivideCheck.cpp
1111
FlattenGlobals.cpp
1212
GlobalCleanup.cpp
13+
PromoteIntegers.cpp
1314
StripMetadata.cpp
1415
)
1516

0 commit comments

Comments
 (0)