diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-18 17:52:18 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-18 17:52:18 -0800 |
commit | 7db0b7b0f653bf0735e8b6c4f50c959eb49f456d (patch) | |
tree | 3d6fd670bb02d3a83531ddb582027ef03ca6c557 /lib/Transforms | |
parent | 3751924adc535bbc283013cd6a19e33796474fa9 (diff) |
don't try to legalize llvm.dbg.declare, and ignore it later
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/NaCl/ExpandI64.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Transforms/NaCl/ExpandI64.cpp index 1dd8775903..271c534686 100644 --- a/lib/Transforms/NaCl/ExpandI64.cpp +++ b/lib/Transforms/NaCl/ExpandI64.cpp @@ -150,7 +150,15 @@ static FunctionType *getLegalizedFunctionType(FunctionType *FT) { // Implementation of ExpandI64 +bool okToRemainIllegal(Function *F) { + const char *Name = F->getName().str().c_str(); + if (strcmp(Name, "llvm.dbg.value") == 0) return true; + return false; +} + void ExpandI64::ensureLegalFunc(Function *F) { + if (okToRemainIllegal(F)) return; + FunctionType *FT = F->getFunctionType(); int Num = FT->getNumParams(); for (int i = -1; i < Num; i++) { @@ -189,6 +197,8 @@ void ExpandI64::ensureLegalFunc(Function *F) { } void ExpandI64::removeIllegalFunc(Function *F) { + if (okToRemainIllegal(F)) return; + FunctionType *FT = F->getFunctionType(); int Num = FT->getNumParams(); for (int i = -1; i < Num; i++) { @@ -425,6 +435,11 @@ void ExpandI64::splitInst(Instruction *I, DataLayout& DL) { } case Instruction::Call: { CallInst *CI = dyn_cast<CallInst>(I); + Function *F = CI->getCalledFunction(); + if (F) { + assert(okToRemainIllegal(F)); + break; + } Value *CV = CI->getCalledValue(); FunctionType *OFT = NULL; if (ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) { |