Update prebuilt Clang to match Android kernel.
Bug: 132428451
Change-Id: I8f6e2cb23f381fc0c02ddea99b867e58e925e5be
diff --git a/linux-x64/clang/include/llvm/IR/InstVisitor.h b/linux-x64/clang/include/llvm/IR/InstVisitor.h
index 55536f2..fbeb2ca 100644
--- a/linux-x64/clang/include/llvm/IR/InstVisitor.h
+++ b/linux-x64/clang/include/llvm/IR/InstVisitor.h
@@ -1,9 +1,8 @@
//===- InstVisitor.h - Instruction visitor templates ------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -166,15 +165,6 @@
// Specific Instruction type classes... note that all of the casts are
// necessary because we use the instruction classes as opaque types...
//
- RetTy visitReturnInst(ReturnInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitBranchInst(BranchInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitSwitchInst(SwitchInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitIndirectBrInst(IndirectBrInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitResumeInst(ResumeInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitCleanupReturnInst(CleanupReturnInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitCatchReturnInst(CatchReturnInst &I) { DELEGATE(TerminatorInst); }
- RetTy visitCatchSwitchInst(CatchSwitchInst &I) { DELEGATE(TerminatorInst);}
RetTy visitICmpInst(ICmpInst &I) { DELEGATE(CmpInst);}
RetTy visitFCmpInst(FCmpInst &I) { DELEGATE(CmpInst);}
RetTy visitAllocaInst(AllocaInst &I) { DELEGATE(UnaryInstruction);}
@@ -227,36 +217,76 @@
RetTy visitVACopyInst(VACopyInst &I) { DELEGATE(IntrinsicInst); }
RetTy visitIntrinsicInst(IntrinsicInst &I) { DELEGATE(CallInst); }
- // Call and Invoke are slightly different as they delegate first through
- // a generic CallSite visitor.
+ // Call, Invoke and CallBr are slightly different as they delegate first
+ // through a generic CallSite visitor.
RetTy visitCallInst(CallInst &I) {
return static_cast<SubClass*>(this)->visitCallSite(&I);
}
RetTy visitInvokeInst(InvokeInst &I) {
return static_cast<SubClass*>(this)->visitCallSite(&I);
}
+ RetTy visitCallBrInst(CallBrInst &I) {
+ return static_cast<SubClass *>(this)->visitCallSite(&I);
+ }
+
+ // While terminators don't have a distinct type modeling them, we support
+ // intercepting them with dedicated a visitor callback.
+ RetTy visitReturnInst(ReturnInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitBranchInst(BranchInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitSwitchInst(SwitchInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitIndirectBrInst(IndirectBrInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitResumeInst(ResumeInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitUnreachableInst(UnreachableInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitCleanupReturnInst(CleanupReturnInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitCatchReturnInst(CatchReturnInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitCatchSwitchInst(CatchSwitchInst &I) {
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+ }
+ RetTy visitTerminator(Instruction &I) { DELEGATE(Instruction);}
// Next level propagators: If the user does not overload a specific
// instruction type, they can overload one of these to get the whole class
// of instructions...
//
RetTy visitCastInst(CastInst &I) { DELEGATE(UnaryInstruction);}
+ RetTy visitUnaryOperator(UnaryOperator &I) { DELEGATE(UnaryInstruction);}
RetTy visitBinaryOperator(BinaryOperator &I) { DELEGATE(Instruction);}
RetTy visitCmpInst(CmpInst &I) { DELEGATE(Instruction);}
- RetTy visitTerminatorInst(TerminatorInst &I) { DELEGATE(Instruction);}
RetTy visitUnaryInstruction(UnaryInstruction &I){ DELEGATE(Instruction);}
- // Provide a special visitor for a 'callsite' that visits both calls and
- // invokes. When unimplemented, properly delegates to either the terminator or
- // regular instruction visitor.
+ // The next level delegation for `CallBase` is slightly more complex in order
+ // to support visiting cases where the call is also a terminator.
+ RetTy visitCallBase(CallBase &I) {
+ if (isa<InvokeInst>(I) || isa<CallBrInst>(I))
+ return static_cast<SubClass *>(this)->visitTerminator(I);
+
+ DELEGATE(Instruction);
+ }
+
+ // Provide a legacy visitor for a 'callsite' that visits calls, invokes,
+ // and calbrs.
+ //
+ // Prefer overriding the type system based `CallBase` instead.
RetTy visitCallSite(CallSite CS) {
assert(CS);
Instruction &I = *CS.getInstruction();
- if (CS.isCall())
- DELEGATE(Instruction);
-
- assert(CS.isInvoke());
- DELEGATE(TerminatorInst);
+ DELEGATE(CallBase);
}
// If the user wants a 'default' case, they can choose to override this