mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
Indent anon namespace properly, add copyright block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c3c8703c3b
commit
efddcfa0df
@ -1,4 +1,11 @@
|
|||||||
//===- LoopExtractor.cpp - Extract each loop into a new function ----------===//
|
//===- LoopExtractor.cpp - Extract each loop into a new function ----------===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file was developed by the LLVM research group and is distributed under
|
||||||
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// A pass wrapper around the ExtractLoop() scalar transformation to extract each
|
// A pass wrapper around the ExtractLoop() scalar transformation to extract each
|
||||||
// top-level loop into its own new function. If the loop is the ONLY loop in a
|
// top-level loop into its own new function. If the loop is the ONLY loop in a
|
||||||
@ -16,23 +23,19 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
// FIXME: PassManager should allow Module passes to require FunctionPasses
|
||||||
|
struct LoopExtractor : public FunctionPass {
|
||||||
|
virtual bool run(Module &M);
|
||||||
|
virtual bool runOnFunction(Function &F);
|
||||||
|
|
||||||
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
|
AU.addRequired<LoopInfo>();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// FIXME: PassManager should allow Module passes to require FunctionPasses
|
RegisterOpt<LoopExtractor>
|
||||||
struct LoopExtractor : public FunctionPass {
|
X("loop-extract", "Extract loops into new functions");
|
||||||
|
} // End anonymous namespace
|
||||||
public:
|
|
||||||
LoopExtractor() {}
|
|
||||||
virtual bool run(Module &M);
|
|
||||||
virtual bool runOnFunction(Function &F);
|
|
||||||
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
|
||||||
AU.addRequired<LoopInfo>();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
RegisterOpt<LoopExtractor>
|
|
||||||
X("loop-extract", "Extract loops into new functions");
|
|
||||||
|
|
||||||
bool LoopExtractor::run(Module &M) {
|
bool LoopExtractor::run(Module &M) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
@ -59,8 +62,6 @@ bool LoopExtractor::runOnFunction(Function &F) {
|
|||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End anonymous namespace
|
|
||||||
|
|
||||||
/// createLoopExtractorPass
|
/// createLoopExtractorPass
|
||||||
///
|
///
|
||||||
FunctionPass* llvm::createLoopExtractorPass() {
|
FunctionPass* llvm::createLoopExtractorPass() {
|
||||||
|
Loading…
Reference in New Issue
Block a user