|
41 | 41 | #include "llvm/IR/DataLayout.h"
|
42 | 42 | #include "llvm/IR/Dominators.h"
|
43 | 43 | #include "llvm/IR/FPEnv.h"
|
44 |
| -// TO_UPSTREAM(BoundsSafety) ON |
45 |
| -#include "llvm/IR/InlineAsm.h" |
46 | 44 | #include "llvm/IR/Instruction.h"
|
47 | 45 | #include "llvm/IR/IntrinsicInst.h"
|
48 | 46 | #include "llvm/IR/Intrinsics.h"
|
@@ -321,43 +319,6 @@ TypeEvaluationKind CodeGenFunction::getEvaluationKind(QualType type) {
|
321 | 319 | }
|
322 | 320 | }
|
323 | 321 |
|
324 |
| -/* TO_UPSTREAM(BoundsSafety) ON*/ |
325 |
| -llvm::BasicBlock *CodeGenFunction::createUnmergeableBasicBlock( |
326 |
| - const Twine &name, llvm::Function *parent, llvm::BasicBlock *before) { |
327 |
| - auto *BB = createBasicBlock(name, parent, before); |
328 |
| - // This approach is the same approach used by Swift. |
329 |
| - // TODO: Find a better way to do this (rdar://137627723). |
330 |
| - |
331 |
| - // Emit unique side-effecting inline asm calls in order to eliminate |
332 |
| - // the possibility that an LLVM optimization or code generation pass |
333 |
| - // will merge these blocks back together again. We emit an empty asm |
334 |
| - // string with the side-effect flag set, and with a unique integer |
335 |
| - // argument. |
336 |
| - llvm::IntegerType *asmArgTy = CGM.Int64Ty; |
337 |
| - llvm::Type *argTys = {asmArgTy}; |
338 |
| - llvm::FunctionType *asmFnTy = |
339 |
| - llvm::FunctionType::get(CGM.VoidTy, argTys, /* isVarArg=*/false); |
340 |
| - // "n" is an input constraint stating that the first argument to the call |
341 |
| - // will be an integer literal. |
342 |
| - llvm::InlineAsm *inlineAsm = |
343 |
| - llvm::InlineAsm::get(asmFnTy, /*AsmString=*/"", /*Constraints=*/"n", |
344 |
| - /*hasSideEffects=*/true); |
345 |
| - |
346 |
| - // Use the builder so that any opt-remarks and attributes are automatically |
347 |
| - // applied by the builder. The current state of the builder is saved so it |
348 |
| - // can be used for creating the asm call and then the builder is reset to |
349 |
| - // its previous state. |
350 |
| - auto OldInsertPoint = Builder.GetInsertPoint(); |
351 |
| - auto* OldInsertBB = Builder.GetInsertBlock(); |
352 |
| - Builder.SetInsertPoint(BB); |
353 |
| - Builder.CreateCall( |
354 |
| - inlineAsm, |
355 |
| - llvm::ConstantInt::get(asmArgTy, CGM.getAndIncrementUniqueTrapCount())); |
356 |
| - Builder.SetInsertPoint(OldInsertBB, OldInsertPoint); |
357 |
| - return BB; |
358 |
| -} |
359 |
| -/* TO_UPSTREAM(BoundsSafety) OFF*/ |
360 |
| - |
361 | 322 | llvm::DebugLoc CodeGenFunction::EmitReturnBlock() {
|
362 | 323 | // For cleanliness, we try to avoid emitting the return block for
|
363 | 324 | // simple cases.
|
|
0 commit comments