summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/CodeGen/Passes.h4
-rw-r--r--llvm/include/llvm/Transforms/Instrumentation.h4
-rw-r--r--llvm/lib/CodeGen/CMakeLists.txt33
-rw-r--r--llvm/lib/CodeGen/CodeGen.cpp1
-rw-r--r--llvm/lib/CodeGen/SafeStack.cpp (renamed from llvm/lib/Transforms/Instrumentation/SafeStack.cpp)6
-rw-r--r--llvm/lib/Transforms/Instrumentation/CMakeLists.txt1
-rw-r--r--llvm/lib/Transforms/Instrumentation/Instrumentation.cpp1
-rw-r--r--llvm/tools/opt/opt.cpp1
8 files changed, 26 insertions, 25 deletions
diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h
index 69ad130f761..1ff0171779c 100644
--- a/llvm/include/llvm/CodeGen/Passes.h
+++ b/llvm/include/llvm/CodeGen/Passes.h
@@ -667,6 +667,10 @@ namespace llvm {
Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
bool OnlyOptimizeForSize = false,
bool MergeExternalByDefault = false);
+
+ /// This pass splits the stack into a safe stack and an unsafe stack to
+ /// protect against stack-based overflow vulnerabilities.
+ FunctionPass *createSafeStackPass(const TargetMachine *TM = nullptr);
} // End llvm namespace
/// Target machine pass initializer for passes with dependencies. Use with
diff --git a/llvm/include/llvm/Transforms/Instrumentation.h b/llvm/include/llvm/Transforms/Instrumentation.h
index 38dfeb04ace..d9402631574 100644
--- a/llvm/include/llvm/Transforms/Instrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation.h
@@ -150,10 +150,6 @@ inline ModulePass *createDataFlowSanitizerPassForJIT(
// checking on loads, stores, and other memory intrinsics.
FunctionPass *createBoundsCheckingPass();
-/// \brief This pass splits the stack into a safe stack and an unsafe stack to
-/// protect against stack-based overflow vulnerabilities.
-FunctionPass *createSafeStackPass(const TargetMachine *TM = nullptr);
-
/// \brief Calculate what to divide by to scale counts.
///
/// Given the maximum count, calculate a divisor that will scale all the
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 7f00e8f6758..8e326fae4e3 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -16,15 +16,14 @@ add_llvm_library(LLVMCodeGen
CodeGen.cpp
CodeGenPrepare.cpp
CriticalAntiDepBreaker.cpp
- DFAPacketizer.cpp
DeadMachineInstructionElim.cpp
+ DFAPacketizer.cpp
DwarfEHPrepare.cpp
EarlyIfConversion.cpp
EdgeBundles.cpp
ExecutionDepsFix.cpp
ExpandISelPseudos.cpp
ExpandPostRAPseudos.cpp
- LiveDebugValues.cpp
FaultMaps.cpp
FuncletLayout.cpp
GCMetadata.cpp
@@ -38,57 +37,58 @@ add_llvm_library(LLVMCodeGen
InterferenceCache.cpp
InterleavedAccessPass.cpp
IntrinsicLowering.cpp
- LLVMTargetMachine.cpp
LatencyPriorityQueue.cpp
LexicalScopes.cpp
+ LiveDebugValues.cpp
LiveDebugVariables.cpp
- LiveInterval.cpp
LiveIntervalAnalysis.cpp
+ LiveInterval.cpp
LiveIntervalUnion.cpp
+ LivePhysRegs.cpp
LiveRangeCalc.cpp
LiveRangeEdit.cpp
LiveRegMatrix.cpp
- LivePhysRegs.cpp
LiveStackAnalysis.cpp
LiveVariables.cpp
+ LLVMTargetMachine.cpp
LocalStackSlotAllocation.cpp
LowerEmuTLS.cpp
MachineBasicBlock.cpp
MachineBlockFrequencyInfo.cpp
MachineBlockPlacement.cpp
MachineBranchProbabilityInfo.cpp
- MachineCSE.cpp
MachineCombiner.cpp
MachineCopyPropagation.cpp
- MachineDominators.cpp
+ MachineCSE.cpp
MachineDominanceFrontier.cpp
- MachineFunction.cpp
+ MachineDominators.cpp
MachineFunctionAnalysis.cpp
+ MachineFunction.cpp
MachineFunctionPass.cpp
MachineFunctionPrinterPass.cpp
- MachineInstr.cpp
MachineInstrBundle.cpp
+ MachineInstr.cpp
MachineLICM.cpp
MachineLoopInfo.cpp
MachineModuleInfo.cpp
MachineModuleInfoImpls.cpp
MachinePassRegistry.cpp
MachinePostDominators.cpp
- MachineRegisterInfo.cpp
MachineRegionInfo.cpp
- MachineSSAUpdater.cpp
+ MachineRegisterInfo.cpp
MachineScheduler.cpp
MachineSink.cpp
+ MachineSSAUpdater.cpp
MachineTraceMetrics.cpp
MachineVerifier.cpp
MIRPrinter.cpp
MIRPrintingPass.cpp
OptimizePHIs.cpp
- PHIElimination.cpp
- PHIEliminationUtils.cpp
ParallelCG.cpp
Passes.cpp
PeepholeOptimizer.cpp
+ PHIElimination.cpp
+ PHIEliminationUtils.cpp
PostRASchedulerList.cpp
ProcessImplicitDefs.cpp
PrologEpilogInserter.cpp
@@ -102,21 +102,22 @@ add_llvm_library(LLVMCodeGen
RegisterCoalescer.cpp
RegisterPressure.cpp
RegisterScavenging.cpp
+ SafeStack.cpp
ScheduleDAG.cpp
ScheduleDAGInstrs.cpp
ScheduleDAGPrinter.cpp
ScoreboardHazardRecognizer.cpp
- ShrinkWrap.cpp
ShadowStackGCLowering.cpp
+ ShrinkWrap.cpp
SjLjEHPrepare.cpp
SlotIndexes.cpp
SpillPlacement.cpp
SplitKit.cpp
StackColoring.cpp
- StackProtector.cpp
- StackSlotColoring.cpp
StackMapLivenessAnalysis.cpp
StackMaps.cpp
+ StackProtector.cpp
+ StackSlotColoring.cpp
TailDuplication.cpp
TargetFrameLoweringImpl.cpp
TargetInstrInfo.cpp
diff --git a/llvm/lib/CodeGen/CodeGen.cpp b/llvm/lib/CodeGen/CodeGen.cpp
index dc13b5b11d3..3c2dc85df59 100644
--- a/llvm/lib/CodeGen/CodeGen.cpp
+++ b/llvm/lib/CodeGen/CodeGen.cpp
@@ -68,6 +68,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeStackColoringPass(Registry);
initializeStackMapLivenessPass(Registry);
initializeLiveDebugValuesPass(Registry);
+ initializeSafeStackPass(Registry);
initializeStackProtectorPass(Registry);
initializeStackSlotColoringPass(Registry);
initializeTailDuplicatePassPass(Registry);
diff --git a/llvm/lib/Transforms/Instrumentation/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index ee8d4fad752..7adcdea8d9e 100644
--- a/llvm/lib/Transforms/Instrumentation/SafeStack.cpp
+++ b/llvm/lib/CodeGen/SafeStack.cpp
@@ -15,22 +15,22 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Transforms/Instrumentation.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/CodeGen/Passes.h"
+#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/Constants.h"
+#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
-#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/Function.h"
+#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
-#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
diff --git a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
index cae1e5af7ac..271e3107c8a 100644
--- a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
+++ b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
@@ -7,7 +7,6 @@ add_llvm_library(LLVMInstrumentation
Instrumentation.cpp
InstrProfiling.cpp
PGOInstrumentation.cpp
- SafeStack.cpp
SanitizerCoverage.cpp
ThreadSanitizer.cpp
diff --git a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
index a05a5fa09f9..7a7fc8811d9 100644
--- a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
@@ -67,7 +67,6 @@ void llvm::initializeInstrumentation(PassRegistry &Registry) {
initializeThreadSanitizerPass(Registry);
initializeSanitizerCoverageModulePass(Registry);
initializeDataFlowSanitizerPass(Registry);
- initializeSafeStackPass(Registry);
}
/// LLVMInitializeInstrumentation - C binding for
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index fe1605aa843..dc60f3cdf9b 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -329,6 +329,7 @@ int main(int argc, char **argv) {
initializeRewriteSymbolsPass(Registry);
initializeWinEHPreparePass(Registry);
initializeDwarfEHPreparePass(Registry);
+ initializeSafeStackPass(Registry);
initializeSjLjEHPreparePass(Registry);
#ifdef LINK_POLLY_INTO_TOOLS
OpenPOWER on IntegriCloud