summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp')
-rw-r--r--gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp b/gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
index d94aa5da856..886029ea58d 100644
--- a/gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
+++ b/gnu/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
@@ -13,9 +13,9 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/IPO/CrossDSOCFI.h"
-#include "llvm/ADT/DenseSet.h"
-#include "llvm/ADT/EquivalenceClasses.h"
+#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
@@ -31,7 +31,6 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
using namespace llvm;
@@ -81,7 +80,7 @@ ConstantInt *CrossDSOCFI::extractNumericTypeId(MDNode *MD) {
void CrossDSOCFI::buildCFICheck(Module &M) {
// FIXME: verify that __cfi_check ends up near the end of the code section,
// but before the jump slots created in LowerTypeTests.
- llvm::DenseSet<uint64_t> TypeIds;
+ SetVector<uint64_t> TypeIds;
SmallVector<MDNode *, 2> Types;
for (GlobalObject &GO : M.global_objects()) {
Types.clear();
@@ -115,6 +114,11 @@ void CrossDSOCFI::buildCFICheck(Module &M) {
// linker knows about the symbol; this pass replaces the function body.
F->deleteBody();
F->setAlignment(4096);
+
+ Triple T(M.getTargetTriple());
+ if (T.isARM() || T.isThumb())
+ F->addFnAttr("target-features", "+thumb-mode");
+
auto args = F->arg_begin();
Value &CallSiteTypeId = *(args++);
CallSiteTypeId.setName("CallSiteTypeId");