mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21411 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/AIXDataTypesFix.h - Fix datatype defs ------*- C++ -*-===//
|
//===-- llvm/Support/AIXDataTypesFix.h - Fix datatype defs ------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file overrides default system-defined types and limits which cannot be
|
// This file overrides default system-defined types and limits which cannot be
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/Annotation.h - Annotation classes ----------*- C++ -*-===//
|
//===-- llvm/Support/Annotation.h - Annotation classes ----------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file contains the declarations for two classes: Annotation & Annotable.
|
// This file contains the declarations for two classes: Annotation & Annotable.
|
||||||
@ -81,7 +81,7 @@ public:
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Annotable - This class is used as a base class for all objects that would
|
// Annotable - This class is used as a base class for all objects that would
|
||||||
// like to have annotation capability. One notable subclass is Value, which
|
// like to have annotation capability. One notable subclass is Value, which
|
||||||
// means annotations can be attached to almost everything in LLVM.
|
// means annotations can be attached to almost everything in LLVM.
|
||||||
//
|
//
|
||||||
// Annotable objects keep their annotation list sorted as annotations are
|
// Annotable objects keep their annotation list sorted as annotations are
|
||||||
@ -157,13 +157,13 @@ public:
|
|||||||
// one-to-one mapping between string Annotation names and Annotation ID numbers.
|
// one-to-one mapping between string Annotation names and Annotation ID numbers.
|
||||||
//
|
//
|
||||||
// Compared to the rest of the Annotation system, these mapping methods are
|
// Compared to the rest of the Annotation system, these mapping methods are
|
||||||
// relatively slow, so they should be avoided by locally caching Annotation
|
// relatively slow, so they should be avoided by locally caching Annotation
|
||||||
// ID #'s. These methods are safe to call at any time, even by static ctors, so
|
// ID #'s. These methods are safe to call at any time, even by static ctors, so
|
||||||
// they should be used by static ctors most of the time.
|
// they should be used by static ctors most of the time.
|
||||||
//
|
//
|
||||||
// This class also provides support for annotations that are created on demand
|
// This class also provides support for annotations that are created on demand
|
||||||
// by the Annotable::getOrCreateAnnotation method. To get this to work, simply
|
// by the Annotable::getOrCreateAnnotation method. To get this to work, simply
|
||||||
// register an annotation handler
|
// register an annotation handler
|
||||||
//
|
//
|
||||||
struct AnnotationManager {
|
struct AnnotationManager {
|
||||||
typedef Annotation *(*Factory)(AnnotationID, const Annotable *, void*);
|
typedef Annotation *(*Factory)(AnnotationID, const Annotable *, void*);
|
||||||
@ -183,7 +183,7 @@ struct AnnotationManager {
|
|||||||
// Annotation creation on demand support...
|
// Annotation creation on demand support...
|
||||||
|
|
||||||
// registerAnnotationFactory - This method is used to register a callback
|
// registerAnnotationFactory - This method is used to register a callback
|
||||||
// function used to create an annotation on demand if it is needed by the
|
// function used to create an annotation on demand if it is needed by the
|
||||||
// Annotable::getOrCreateAnnotation method.
|
// Annotable::getOrCreateAnnotation method.
|
||||||
//
|
//
|
||||||
static void registerAnnotationFactory(AnnotationID ID, Factory Func,
|
static void registerAnnotationFactory(AnnotationID ID, Factory Func,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===//
|
//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines specializations of GraphTraits that allow Function and
|
// This file defines specializations of GraphTraits that allow Function and
|
||||||
@ -34,40 +34,40 @@ class PredIterator : public forward_iterator<_Ptr, ptrdiff_t> {
|
|||||||
public:
|
public:
|
||||||
typedef PredIterator<_Ptr,_USE_iterator> _Self;
|
typedef PredIterator<_Ptr,_USE_iterator> _Self;
|
||||||
typedef typename super::pointer pointer;
|
typedef typename super::pointer pointer;
|
||||||
|
|
||||||
inline void advancePastNonTerminators() {
|
inline void advancePastNonTerminators() {
|
||||||
// Loop to ignore non terminator uses (for example PHI nodes)...
|
// Loop to ignore non terminator uses (for example PHI nodes)...
|
||||||
while (It != BB->use_end() && !isa<TerminatorInst>(*It))
|
while (It != BB->use_end() && !isa<TerminatorInst>(*It))
|
||||||
++It;
|
++It;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PredIterator(_Ptr *bb) : BB(bb), It(bb->use_begin()) {
|
inline PredIterator(_Ptr *bb) : BB(bb), It(bb->use_begin()) {
|
||||||
advancePastNonTerminators();
|
advancePastNonTerminators();
|
||||||
}
|
}
|
||||||
inline PredIterator(_Ptr *bb, bool) : BB(bb), It(bb->use_end()) {}
|
inline PredIterator(_Ptr *bb, bool) : BB(bb), It(bb->use_end()) {}
|
||||||
|
|
||||||
inline bool operator==(const _Self& x) const { return It == x.It; }
|
inline bool operator==(const _Self& x) const { return It == x.It; }
|
||||||
inline bool operator!=(const _Self& x) const { return !operator==(x); }
|
inline bool operator!=(const _Self& x) const { return !operator==(x); }
|
||||||
|
|
||||||
inline pointer operator*() const {
|
inline pointer operator*() const {
|
||||||
assert(It != BB->use_end() && "pred_iterator out of range!");
|
assert(It != BB->use_end() && "pred_iterator out of range!");
|
||||||
return cast<TerminatorInst>(*It)->getParent();
|
return cast<TerminatorInst>(*It)->getParent();
|
||||||
}
|
}
|
||||||
inline pointer *operator->() const { return &(operator*()); }
|
inline pointer *operator->() const { return &(operator*()); }
|
||||||
|
|
||||||
inline _Self& operator++() { // Preincrement
|
inline _Self& operator++() { // Preincrement
|
||||||
assert(It != BB->use_end() && "pred_iterator out of range!");
|
assert(It != BB->use_end() && "pred_iterator out of range!");
|
||||||
++It; advancePastNonTerminators();
|
++It; advancePastNonTerminators();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _Self operator++(int) { // Postincrement
|
inline _Self operator++(int) { // Postincrement
|
||||||
_Self tmp = *this; ++*this; return tmp;
|
_Self tmp = *this; ++*this; return tmp;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
|
typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
|
||||||
typedef PredIterator<const BasicBlock,
|
typedef PredIterator<const BasicBlock,
|
||||||
Value::use_const_iterator> pred_const_iterator;
|
Value::use_const_iterator> pred_const_iterator;
|
||||||
|
|
||||||
inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
|
inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
|
||||||
@ -94,7 +94,7 @@ public:
|
|||||||
typedef SuccIterator<Term_, BB_> _Self;
|
typedef SuccIterator<Term_, BB_> _Self;
|
||||||
typedef typename super::pointer pointer;
|
typedef typename super::pointer pointer;
|
||||||
// TODO: This can be random access iterator, need operator+ and stuff tho
|
// TODO: This can be random access iterator, need operator+ and stuff tho
|
||||||
|
|
||||||
inline SuccIterator(Term_ T) : Term(T), idx(0) { // begin iterator
|
inline SuccIterator(Term_ T) : Term(T), idx(0) { // begin iterator
|
||||||
assert(T && "getTerminator returned null!");
|
assert(T && "getTerminator returned null!");
|
||||||
}
|
}
|
||||||
@ -112,18 +112,18 @@ public:
|
|||||||
/// getSuccessorIndex - This is used to interface between code that wants to
|
/// getSuccessorIndex - This is used to interface between code that wants to
|
||||||
/// operate on terminator instructions directly.
|
/// operate on terminator instructions directly.
|
||||||
unsigned getSuccessorIndex() const { return idx; }
|
unsigned getSuccessorIndex() const { return idx; }
|
||||||
|
|
||||||
inline bool operator==(const _Self& x) const { return idx == x.idx; }
|
inline bool operator==(const _Self& x) const { return idx == x.idx; }
|
||||||
inline bool operator!=(const _Self& x) const { return !operator==(x); }
|
inline bool operator!=(const _Self& x) const { return !operator==(x); }
|
||||||
|
|
||||||
inline pointer operator*() const { return Term->getSuccessor(idx); }
|
inline pointer operator*() const { return Term->getSuccessor(idx); }
|
||||||
inline pointer operator->() const { return operator*(); }
|
inline pointer operator->() const { return operator*(); }
|
||||||
|
|
||||||
inline _Self& operator++() { ++idx; return *this; } // Preincrement
|
inline _Self& operator++() { ++idx; return *this; } // Preincrement
|
||||||
inline _Self operator++(int) { // Postincrement
|
inline _Self operator++(int) { // Postincrement
|
||||||
_Self tmp = *this; ++*this; return tmp;
|
_Self tmp = *this; ++*this; return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _Self& operator--() { --idx; return *this; } // Predecrement
|
inline _Self& operator--() { --idx; return *this; } // Predecrement
|
||||||
inline _Self operator--(int) { // Postdecrement
|
inline _Self operator--(int) { // Postdecrement
|
||||||
_Self tmp = *this; --*this; return tmp;
|
_Self tmp = *this; --*this; return tmp;
|
||||||
@ -153,7 +153,7 @@ inline succ_const_iterator succ_end(const BasicBlock *BB) {
|
|||||||
// GraphTraits specializations for basic block graphs (CFGs)
|
// GraphTraits specializations for basic block graphs (CFGs)
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
// Provide specializations of GraphTraits to be able to treat a function as a
|
// Provide specializations of GraphTraits to be able to treat a function as a
|
||||||
// graph of basic blocks...
|
// graph of basic blocks...
|
||||||
|
|
||||||
template <> struct GraphTraits<BasicBlock*> {
|
template <> struct GraphTraits<BasicBlock*> {
|
||||||
@ -161,10 +161,10 @@ template <> struct GraphTraits<BasicBlock*> {
|
|||||||
typedef succ_iterator ChildIteratorType;
|
typedef succ_iterator ChildIteratorType;
|
||||||
|
|
||||||
static NodeType *getEntryNode(BasicBlock *BB) { return BB; }
|
static NodeType *getEntryNode(BasicBlock *BB) { return BB; }
|
||||||
static inline ChildIteratorType child_begin(NodeType *N) {
|
static inline ChildIteratorType child_begin(NodeType *N) {
|
||||||
return succ_begin(N);
|
return succ_begin(N);
|
||||||
}
|
}
|
||||||
static inline ChildIteratorType child_end(NodeType *N) {
|
static inline ChildIteratorType child_end(NodeType *N) {
|
||||||
return succ_end(N);
|
return succ_end(N);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -175,15 +175,15 @@ template <> struct GraphTraits<const BasicBlock*> {
|
|||||||
|
|
||||||
static NodeType *getEntryNode(const BasicBlock *BB) { return BB; }
|
static NodeType *getEntryNode(const BasicBlock *BB) { return BB; }
|
||||||
|
|
||||||
static inline ChildIteratorType child_begin(NodeType *N) {
|
static inline ChildIteratorType child_begin(NodeType *N) {
|
||||||
return succ_begin(N);
|
return succ_begin(N);
|
||||||
}
|
}
|
||||||
static inline ChildIteratorType child_end(NodeType *N) {
|
static inline ChildIteratorType child_end(NodeType *N) {
|
||||||
return succ_end(N);
|
return succ_end(N);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Provide specializations of GraphTraits to be able to treat a function as a
|
// Provide specializations of GraphTraits to be able to treat a function as a
|
||||||
// graph of basic blocks... and to walk it in inverse order. Inverse order for
|
// graph of basic blocks... and to walk it in inverse order. Inverse order for
|
||||||
// a function is considered to be when traversing the predecessor edges of a BB
|
// a function is considered to be when traversing the predecessor edges of a BB
|
||||||
// instead of the successor edges.
|
// instead of the successor edges.
|
||||||
@ -192,10 +192,10 @@ template <> struct GraphTraits<Inverse<BasicBlock*> > {
|
|||||||
typedef BasicBlock NodeType;
|
typedef BasicBlock NodeType;
|
||||||
typedef pred_iterator ChildIteratorType;
|
typedef pred_iterator ChildIteratorType;
|
||||||
static NodeType *getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
|
static NodeType *getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
|
||||||
static inline ChildIteratorType child_begin(NodeType *N) {
|
static inline ChildIteratorType child_begin(NodeType *N) {
|
||||||
return pred_begin(N);
|
return pred_begin(N);
|
||||||
}
|
}
|
||||||
static inline ChildIteratorType child_end(NodeType *N) {
|
static inline ChildIteratorType child_end(NodeType *N) {
|
||||||
return pred_end(N);
|
return pred_end(N);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -204,12 +204,12 @@ template <> struct GraphTraits<Inverse<const BasicBlock*> > {
|
|||||||
typedef const BasicBlock NodeType;
|
typedef const BasicBlock NodeType;
|
||||||
typedef pred_const_iterator ChildIteratorType;
|
typedef pred_const_iterator ChildIteratorType;
|
||||||
static NodeType *getEntryNode(Inverse<const BasicBlock*> G) {
|
static NodeType *getEntryNode(Inverse<const BasicBlock*> G) {
|
||||||
return G.Graph;
|
return G.Graph;
|
||||||
}
|
}
|
||||||
static inline ChildIteratorType child_begin(NodeType *N) {
|
static inline ChildIteratorType child_begin(NodeType *N) {
|
||||||
return pred_begin(N);
|
return pred_begin(N);
|
||||||
}
|
}
|
||||||
static inline ChildIteratorType child_end(NodeType *N) {
|
static inline ChildIteratorType child_end(NodeType *N) {
|
||||||
return pred_end(N);
|
return pred_end(N);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -220,7 +220,7 @@ template <> struct GraphTraits<Inverse<const BasicBlock*> > {
|
|||||||
// GraphTraits specializations for function basic block graphs (CFGs)
|
// GraphTraits specializations for function basic block graphs (CFGs)
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
// Provide specializations of GraphTraits to be able to treat a function as a
|
// Provide specializations of GraphTraits to be able to treat a function as a
|
||||||
// graph of basic blocks... these are the same as the basic block iterators,
|
// graph of basic blocks... these are the same as the basic block iterators,
|
||||||
// except that the root node is implicitly the first node of the function.
|
// except that the root node is implicitly the first node of the function.
|
||||||
//
|
//
|
||||||
@ -243,7 +243,7 @@ template <> struct GraphTraits<const Function*> :
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Provide specializations of GraphTraits to be able to treat a function as a
|
// Provide specializations of GraphTraits to be able to treat a function as a
|
||||||
// graph of basic blocks... and to walk it in inverse order. Inverse order for
|
// graph of basic blocks... and to walk it in inverse order. Inverse order for
|
||||||
// a function is considered to be when traversing the predecessor edges of a BB
|
// a function is considered to be when traversing the predecessor edges of a BB
|
||||||
// instead of the successor edges.
|
// instead of the successor edges.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/CallSite.h - Abstract Call & Invoke instrs -*- C++ -*-===//
|
//===-- llvm/Support/CallSite.h - Abstract Call & Invoke instrs -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines the CallSite class, which is a handy wrapper for code that
|
// This file defines the CallSite class, which is a handy wrapper for code that
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/Casting.h - Allow flexible, checked, casts -*- C++ -*-===//
|
//===-- llvm/Support/Casting.h - Allow flexible, checked, casts -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines the isa<X>(), cast<X>(), dyn_cast<X>(), cast_or_null<X>(),
|
// This file defines the isa<X>(), cast<X>(), dyn_cast<X>(), cast_or_null<X>(),
|
||||||
@ -48,7 +48,7 @@ template<typename From> struct simplify_type<const From> {
|
|||||||
// if (isa<Type*>(myVal)) { ... }
|
// if (isa<Type*>(myVal)) { ... }
|
||||||
//
|
//
|
||||||
template <typename To, typename From>
|
template <typename To, typename From>
|
||||||
inline bool isa_impl(const From &Val) {
|
inline bool isa_impl(const From &Val) {
|
||||||
return To::classof(&Val);
|
return To::classof(&Val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ struct isa_impl_wrap {
|
|||||||
// When From != SimplifiedType, we can simplify the type some more by using
|
// When From != SimplifiedType, we can simplify the type some more by using
|
||||||
// the simplify_type template.
|
// the simplify_type template.
|
||||||
static bool doit(const From &Val) {
|
static bool doit(const From &Val) {
|
||||||
return isa_impl_cl<const SimpleType>::template
|
return isa_impl_cl<const SimpleType>::template
|
||||||
isa<To>(simplify_type<const From>::getSimplifiedValue(Val));
|
isa<To>(simplify_type<const From>::getSimplifiedValue(Val));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -159,7 +159,7 @@ struct cast_retty_wrap<To, FromTy, FromTy> {
|
|||||||
|
|
||||||
template<class To, class From>
|
template<class To, class From>
|
||||||
struct cast_retty {
|
struct cast_retty {
|
||||||
typedef typename cast_retty_wrap<To, From,
|
typedef typename cast_retty_wrap<To, From,
|
||||||
typename simplify_type<From>::SimpleType>::ret_type ret_type;
|
typename simplify_type<From>::SimpleType>::ret_type ret_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ struct foo {
|
|||||||
}*/
|
}*/
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> inline bool isa_impl<foo,bar>(const bar &Val) {
|
template <> inline bool isa_impl<foo,bar>(const bar &Val) {
|
||||||
cerr << "Classof: " << &Val << "\n";
|
cerr << "Classof: " << &Val << "\n";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -279,7 +279,7 @@ void test(bar &B1, const bar *B2) {
|
|||||||
const foo *F12 = cast_or_null<foo>(B2);
|
const foo *F12 = cast_or_null<foo>(B2);
|
||||||
const foo *F13 = cast_or_null<foo>(B4);
|
const foo *F13 = cast_or_null<foo>(B4);
|
||||||
const foo *F14 = cast_or_null<foo>(fub()); // Shouldn't print.
|
const foo *F14 = cast_or_null<foo>(fub()); // Shouldn't print.
|
||||||
|
|
||||||
// These lines are errors...
|
// These lines are errors...
|
||||||
//foo *F20 = cast<foo>(B2); // Yields const foo*
|
//foo *F20 = cast<foo>(B2); // Yields const foo*
|
||||||
//foo &F21 = cast<foo>(B3); // Yields const foo&
|
//foo &F21 = cast<foo>(B3); // Yields const foo&
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/CommandLine.h - Command line handler --------*- C++ -*-===//
|
//===- llvm/Support/CommandLine.h - Command line handler --------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This class implements a command line argument processor that is useful when
|
// This class implements a command line argument processor that is useful when
|
||||||
@ -126,14 +126,14 @@ class Option {
|
|||||||
// an argument. Should return true if there was an error processing the
|
// an argument. Should return true if there was an error processing the
|
||||||
// argument and the program should exit.
|
// argument and the program should exit.
|
||||||
//
|
//
|
||||||
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
||||||
const std::string &Arg) = 0;
|
const std::string &Arg) = 0;
|
||||||
|
|
||||||
virtual enum NumOccurrences getNumOccurrencesFlagDefault() const {
|
virtual enum NumOccurrences getNumOccurrencesFlagDefault() const {
|
||||||
return Optional;
|
return Optional;
|
||||||
}
|
}
|
||||||
virtual enum ValueExpected getValueExpectedFlagDefault() const {
|
virtual enum ValueExpected getValueExpectedFlagDefault() const {
|
||||||
return ValueOptional;
|
return ValueOptional;
|
||||||
}
|
}
|
||||||
virtual enum OptionHidden getOptionHiddenFlagDefault() const {
|
virtual enum OptionHidden getOptionHiddenFlagDefault() const {
|
||||||
return NotHidden;
|
return NotHidden;
|
||||||
@ -216,14 +216,14 @@ public:
|
|||||||
// Return the width of the option tag for printing...
|
// Return the width of the option tag for printing...
|
||||||
virtual unsigned getOptionWidth() const = 0;
|
virtual unsigned getOptionWidth() const = 0;
|
||||||
|
|
||||||
// printOptionInfo - Print out information about this option. The
|
// printOptionInfo - Print out information about this option. The
|
||||||
// to-be-maintained width is specified.
|
// to-be-maintained width is specified.
|
||||||
//
|
//
|
||||||
virtual void printOptionInfo(unsigned GlobalWidth) const = 0;
|
virtual void printOptionInfo(unsigned GlobalWidth) const = 0;
|
||||||
|
|
||||||
// addOccurrence - Wrapper around handleOccurrence that enforces Flags
|
// addOccurrence - Wrapper around handleOccurrence that enforces Flags
|
||||||
//
|
//
|
||||||
bool addOccurrence(unsigned pos, const char *ArgName,
|
bool addOccurrence(unsigned pos, const char *ArgName,
|
||||||
const std::string &Value);
|
const std::string &Value);
|
||||||
|
|
||||||
// Prints option name followed by message. Always returns true.
|
// Prints option name followed by message. Always returns true.
|
||||||
@ -311,7 +311,7 @@ class ValuesClass {
|
|||||||
std::vector<std::pair<const char *, std::pair<int, const char *> > > Values;
|
std::vector<std::pair<const char *, std::pair<int, const char *> > > Values;
|
||||||
void processValues(va_list Vals);
|
void processValues(va_list Vals);
|
||||||
public:
|
public:
|
||||||
ValuesClass(const char *EnumName, DataType Val, const char *Desc,
|
ValuesClass(const char *EnumName, DataType Val, const char *Desc,
|
||||||
va_list ValueArgs) {
|
va_list ValueArgs) {
|
||||||
// Insert the first value, which is required.
|
// Insert the first value, which is required.
|
||||||
Values.push_back(std::make_pair(EnumName, std::make_pair(Val, Desc)));
|
Values.push_back(std::make_pair(EnumName, std::make_pair(Val, Desc)));
|
||||||
@ -366,14 +366,14 @@ struct generic_parser_base {
|
|||||||
|
|
||||||
// getOption - Return option name N.
|
// getOption - Return option name N.
|
||||||
virtual const char *getOption(unsigned N) const = 0;
|
virtual const char *getOption(unsigned N) const = 0;
|
||||||
|
|
||||||
// getDescription - Return description N
|
// getDescription - Return description N
|
||||||
virtual const char *getDescription(unsigned N) const = 0;
|
virtual const char *getDescription(unsigned N) const = 0;
|
||||||
|
|
||||||
// Return the width of the option tag for printing...
|
// Return the width of the option tag for printing...
|
||||||
virtual unsigned getOptionWidth(const Option &O) const;
|
virtual unsigned getOptionWidth(const Option &O) const;
|
||||||
|
|
||||||
// printOptionInfo - Print out information about this option. The
|
// printOptionInfo - Print out information about this option. The
|
||||||
// to-be-maintained width is specified.
|
// to-be-maintained width is specified.
|
||||||
//
|
//
|
||||||
virtual void printOptionInfo(const Option &O, unsigned GlobalWidth) const;
|
virtual void printOptionInfo(const Option &O, unsigned GlobalWidth) const;
|
||||||
@ -442,7 +442,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse - Return true on error.
|
// parse - Return true on error.
|
||||||
bool parse(Option &O, const char *ArgName, const std::string &Arg,
|
bool parse(Option &O, const char *ArgName, const std::string &Arg,
|
||||||
DataType &V) {
|
DataType &V) {
|
||||||
std::string ArgVal;
|
std::string ArgVal;
|
||||||
if (hasArgStr)
|
if (hasArgStr)
|
||||||
@ -485,12 +485,12 @@ struct basic_parser_impl { // non-template implementation of basic_parser<t>
|
|||||||
enum ValueExpected getValueExpectedFlagDefault() const {
|
enum ValueExpected getValueExpectedFlagDefault() const {
|
||||||
return ValueRequired;
|
return ValueRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize(Option &O) {}
|
void initialize(Option &O) {}
|
||||||
|
|
||||||
// Return the width of the option tag for printing...
|
// Return the width of the option tag for printing...
|
||||||
unsigned getOptionWidth(const Option &O) const;
|
unsigned getOptionWidth(const Option &O) const;
|
||||||
|
|
||||||
// printOptionInfo - Print out information about this option. The
|
// printOptionInfo - Print out information about this option. The
|
||||||
// to-be-maintained width is specified.
|
// to-be-maintained width is specified.
|
||||||
//
|
//
|
||||||
@ -519,7 +519,7 @@ public:
|
|||||||
bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
|
bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
|
||||||
|
|
||||||
enum ValueExpected getValueExpectedFlagDefault() const {
|
enum ValueExpected getValueExpectedFlagDefault() const {
|
||||||
return ValueOptional;
|
return ValueOptional;
|
||||||
}
|
}
|
||||||
|
|
||||||
// getValueName - Do not print =<value> at all
|
// getValueName - Do not print =<value> at all
|
||||||
@ -590,7 +590,7 @@ template<>
|
|||||||
class parser<std::string> : public basic_parser<std::string> {
|
class parser<std::string> : public basic_parser<std::string> {
|
||||||
public:
|
public:
|
||||||
// parse - Return true on error.
|
// parse - Return true on error.
|
||||||
bool parse(Option &O, const char *AN, const std::string &Arg,
|
bool parse(Option &O, const char *AN, const std::string &Arg,
|
||||||
std::string &Value) {
|
std::string &Value) {
|
||||||
Value = Arg;
|
Value = Arg;
|
||||||
return false;
|
return false;
|
||||||
@ -727,12 +727,12 @@ public:
|
|||||||
//
|
//
|
||||||
template <class DataType, bool ExternalStorage = false,
|
template <class DataType, bool ExternalStorage = false,
|
||||||
class ParserClass = parser<DataType> >
|
class ParserClass = parser<DataType> >
|
||||||
class opt : public Option,
|
class opt : public Option,
|
||||||
public opt_storage<DataType, ExternalStorage,
|
public opt_storage<DataType, ExternalStorage,
|
||||||
is_class<DataType>::value> {
|
is_class<DataType>::value> {
|
||||||
ParserClass Parser;
|
ParserClass Parser;
|
||||||
|
|
||||||
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
||||||
const std::string &Arg) {
|
const std::string &Arg) {
|
||||||
typename ParserClass::parser_data_type Val;
|
typename ParserClass::parser_data_type Val;
|
||||||
if (Parser.parse(*this, ArgName, Arg, Val))
|
if (Parser.parse(*this, ArgName, Arg, Val))
|
||||||
@ -884,14 +884,14 @@ class list : public Option, public list_storage<DataType, Storage> {
|
|||||||
std::vector<unsigned> Positions;
|
std::vector<unsigned> Positions;
|
||||||
ParserClass Parser;
|
ParserClass Parser;
|
||||||
|
|
||||||
virtual enum NumOccurrences getNumOccurrencesFlagDefault() const {
|
virtual enum NumOccurrences getNumOccurrencesFlagDefault() const {
|
||||||
return ZeroOrMore;
|
return ZeroOrMore;
|
||||||
}
|
}
|
||||||
virtual enum ValueExpected getValueExpectedFlagDefault() const {
|
virtual enum ValueExpected getValueExpectedFlagDefault() const {
|
||||||
return Parser.getValueExpectedFlagDefault();
|
return Parser.getValueExpectedFlagDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
||||||
const std::string &Arg) {
|
const std::string &Arg) {
|
||||||
typename ParserClass::parser_data_type Val;
|
typename ParserClass::parser_data_type Val;
|
||||||
if (Parser.parse(*this, ArgName, Arg, Val))
|
if (Parser.parse(*this, ArgName, Arg, Val))
|
||||||
@ -915,9 +915,9 @@ class list : public Option, public list_storage<DataType, Storage> {
|
|||||||
public:
|
public:
|
||||||
ParserClass &getParser() { return Parser; }
|
ParserClass &getParser() { return Parser; }
|
||||||
|
|
||||||
unsigned getPosition(unsigned optnum) const {
|
unsigned getPosition(unsigned optnum) const {
|
||||||
assert(optnum < this->size() && "Invalid option index");
|
assert(optnum < this->size() && "Invalid option index");
|
||||||
return Positions[optnum];
|
return Positions[optnum];
|
||||||
}
|
}
|
||||||
|
|
||||||
// One option...
|
// One option...
|
||||||
@ -987,7 +987,7 @@ public:
|
|||||||
|
|
||||||
class alias : public Option {
|
class alias : public Option {
|
||||||
Option *AliasFor;
|
Option *AliasFor;
|
||||||
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
virtual bool handleOccurrence(unsigned pos, const char *ArgName,
|
||||||
const std::string &Arg) {
|
const std::string &Arg) {
|
||||||
return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
|
return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/Compressor.h --------------------------------*- C++ -*-===//
|
//===- llvm/Support/Compressor.h --------------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the llvm::Compressor class.
|
// This file declares the llvm::Compressor class.
|
||||||
@ -23,15 +23,15 @@ namespace llvm {
|
|||||||
/// a block of memory. The algorithm used here is currently bzip2 but that
|
/// a block of memory. The algorithm used here is currently bzip2 but that
|
||||||
/// may change without notice. Should newer algorithms prove to compress
|
/// may change without notice. Should newer algorithms prove to compress
|
||||||
/// bytecode better than bzip2, that newer algorithm will be added, but won't
|
/// bytecode better than bzip2, that newer algorithm will be added, but won't
|
||||||
/// replace bzip2. This interface allows us to abstract the notion of
|
/// replace bzip2. This interface allows us to abstract the notion of
|
||||||
/// compression and deal with alternate compression schemes over time.
|
/// compression and deal with alternate compression schemes over time.
|
||||||
/// The type of compression used can be determined by inspecting the
|
/// The type of compression used can be determined by inspecting the
|
||||||
/// first byte of the compressed output. Currently value '0' means no
|
/// first byte of the compressed output. Currently value '0' means no
|
||||||
/// compression was used (for very small files) and value '2' means bzip2
|
/// compression was used (for very small files) and value '2' means bzip2
|
||||||
/// compression was used. The Compressor is intended for use with memory
|
/// compression was used. The Compressor is intended for use with memory
|
||||||
/// mapped files where the entire data block to be compressed or decompressed
|
/// mapped files where the entire data block to be compressed or decompressed
|
||||||
/// is available in memory. However, output can be gathered in repeated calls
|
/// is available in memory. However, output can be gathered in repeated calls
|
||||||
/// to a callback. Utilities for sending compressed or decompressed output
|
/// to a callback. Utilities for sending compressed or decompressed output
|
||||||
/// to a stream or directly to a memory block are also provided.
|
/// to a stream or directly to a memory block are also provided.
|
||||||
/// @since 1.4
|
/// @since 1.4
|
||||||
/// @brief An abstraction for memory to memory data (de)compression
|
/// @brief An abstraction for memory to memory data (de)compression
|
||||||
@ -39,8 +39,8 @@ namespace llvm {
|
|||||||
/// @name High Level Interface
|
/// @name High Level Interface
|
||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
/// This method compresses a block of memory pointed to by \p in with
|
/// This method compresses a block of memory pointed to by \p in with
|
||||||
/// size \p size to a block of memory, \p out, that is allocated with
|
/// size \p size to a block of memory, \p out, that is allocated with
|
||||||
/// malloc. It is the caller's responsibility to free \p out. The \p hint
|
/// malloc. It is the caller's responsibility to free \p out. The \p hint
|
||||||
/// indicates which type of compression the caller would *prefer*.
|
/// indicates which type of compression the caller would *prefer*.
|
||||||
/// @throws std::string explaining error if a compression error occurs
|
/// @throws std::string explaining error if a compression error occurs
|
||||||
@ -52,10 +52,10 @@ namespace llvm {
|
|||||||
char*&out ///< The returned output buffer
|
char*&out ///< The returned output buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
/// This method compresses a block of memory pointed to by \p in with
|
/// This method compresses a block of memory pointed to by \p in with
|
||||||
/// size \p size to a stream. The stream \p out must be open and ready for
|
/// size \p size to a stream. The stream \p out must be open and ready for
|
||||||
/// writing when this method is called. The stream will not be closed by
|
/// writing when this method is called. The stream will not be closed by
|
||||||
/// this method. The \p hint argument indicates which type of
|
/// this method. The \p hint argument indicates which type of
|
||||||
/// compression the caller would *prefer*.
|
/// compression the caller would *prefer*.
|
||||||
/// @returns The amount of data written to \p out.
|
/// @returns The amount of data written to \p out.
|
||||||
/// @brief Compress memory to a file.
|
/// @brief Compress memory to a file.
|
||||||
@ -65,9 +65,9 @@ namespace llvm {
|
|||||||
std::ostream& out ///< The output stream to write data on
|
std::ostream& out ///< The output stream to write data on
|
||||||
);
|
);
|
||||||
|
|
||||||
/// This method decompresses a block of memory pointed to by \p in with
|
/// This method decompresses a block of memory pointed to by \p in with
|
||||||
/// size \p size to a new block of memory, \p out, \p that was allocated
|
/// size \p size to a new block of memory, \p out, \p that was allocated
|
||||||
/// by malloc. It is the caller's responsibility to free \p out.
|
/// by malloc. It is the caller's responsibility to free \p out.
|
||||||
/// @returns The size of the output buffer \p out.
|
/// @returns The size of the output buffer \p out.
|
||||||
/// @brief Decompress memory to a new memory buffer.
|
/// @brief Decompress memory to a new memory buffer.
|
||||||
static size_t decompressToNewBuffer(
|
static size_t decompressToNewBuffer(
|
||||||
@ -76,10 +76,10 @@ namespace llvm {
|
|||||||
char*&out ///< The returned output buffer
|
char*&out ///< The returned output buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
/// This method decompresses a block of memory pointed to by \p in with
|
/// This method decompresses a block of memory pointed to by \p in with
|
||||||
/// size \p size to a stream. The stream \p out must be open and ready for
|
/// size \p size to a stream. The stream \p out must be open and ready for
|
||||||
/// writing when this method is called. The stream will not be closed by
|
/// writing when this method is called. The stream will not be closed by
|
||||||
/// this method.
|
/// this method.
|
||||||
/// @returns The amount of data written to \p out.
|
/// @returns The amount of data written to \p out.
|
||||||
/// @brief Decompress memory to a stream.
|
/// @brief Decompress memory to a stream.
|
||||||
static size_t decompressToStream(
|
static size_t decompressToStream(
|
||||||
@ -93,10 +93,10 @@ namespace llvm {
|
|||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
/// A callback function type used by the Compressor's low level interface
|
/// A callback function type used by the Compressor's low level interface
|
||||||
/// to get the next chunk of data to which (de)compressed output will be
|
/// to get the next chunk of data to which (de)compressed output will be
|
||||||
/// written. This callback completely abstracts the notion of how to
|
/// written. This callback completely abstracts the notion of how to
|
||||||
/// handle the output data of compression or decompression. The callback
|
/// handle the output data of compression or decompression. The callback
|
||||||
/// is responsible for determining both the storage location and the size
|
/// is responsible for determining both the storage location and the size
|
||||||
/// of the output. The callback may also do other things with the data
|
/// of the output. The callback may also do other things with the data
|
||||||
/// such as write it, transmit it, etc. Note that providing very small
|
/// such as write it, transmit it, etc. Note that providing very small
|
||||||
/// values for \p size will make the compression run very inefficiently.
|
/// values for \p size will make the compression run very inefficiently.
|
||||||
@ -138,7 +138,7 @@ namespace llvm {
|
|||||||
/// Note that the callback function will be called as many times as
|
/// Note that the callback function will be called as many times as
|
||||||
/// necessary to complete the compression of the \p in block but that the
|
/// necessary to complete the compression of the \p in block but that the
|
||||||
/// total size will generally be greater than \p size. It is a good idea
|
/// total size will generally be greater than \p size. It is a good idea
|
||||||
/// to provide as large a value to the callback's \p size parameter as
|
/// to provide as large a value to the callback's \p size parameter as
|
||||||
/// possible so that fewer calls to the callback are made.
|
/// possible so that fewer calls to the callback are made.
|
||||||
/// @throws std::string if an error occurs
|
/// @throws std::string if an error occurs
|
||||||
/// @returns the total size of the decompressed data
|
/// @returns the total size of the decompressed data
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/ConstantRange.h - Represent a range --------*- C++ -*-===//
|
//===-- llvm/Support/ConstantRange.h - Represent a range --------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Represent a range of possible values that may occur when the program is run
|
// Represent a range of possible values that may occur when the program is run
|
||||||
@ -39,7 +39,7 @@ class ConstantRange {
|
|||||||
/// Initialize a full (the default) or empty set for the specified type.
|
/// Initialize a full (the default) or empty set for the specified type.
|
||||||
///
|
///
|
||||||
ConstantRange(const Type *Ty, bool isFullSet = true);
|
ConstantRange(const Type *Ty, bool isFullSet = true);
|
||||||
|
|
||||||
/// Initialize a range to hold the single specified value.
|
/// Initialize a range to hold the single specified value.
|
||||||
///
|
///
|
||||||
ConstantRange(Constant *Value);
|
ConstantRange(Constant *Value);
|
||||||
@ -49,7 +49,7 @@ class ConstantRange {
|
|||||||
/// have different types, or if the constant are not integral values.
|
/// have different types, or if the constant are not integral values.
|
||||||
///
|
///
|
||||||
ConstantRange(Constant *Lower, Constant *Upper);
|
ConstantRange(Constant *Lower, Constant *Upper);
|
||||||
|
|
||||||
/// Initialize a set of values that all satisfy the condition with C.
|
/// Initialize a set of values that all satisfy the condition with C.
|
||||||
///
|
///
|
||||||
ConstantRange(unsigned SetCCOpcode, ConstantIntegral *C);
|
ConstantRange(unsigned SetCCOpcode, ConstantIntegral *C);
|
||||||
@ -65,12 +65,12 @@ class ConstantRange {
|
|||||||
/// getType - Return the LLVM data type of this range.
|
/// getType - Return the LLVM data type of this range.
|
||||||
///
|
///
|
||||||
const Type *getType() const;
|
const Type *getType() const;
|
||||||
|
|
||||||
/// isFullSet - Return true if this set contains all of the elements possible
|
/// isFullSet - Return true if this set contains all of the elements possible
|
||||||
/// for this data-type
|
/// for this data-type
|
||||||
///
|
///
|
||||||
bool isFullSet() const;
|
bool isFullSet() const;
|
||||||
|
|
||||||
/// isEmptySet - Return true if this set contains no members.
|
/// isEmptySet - Return true if this set contains no members.
|
||||||
///
|
///
|
||||||
bool isEmptySet() const;
|
bool isEmptySet() const;
|
||||||
@ -83,12 +83,12 @@ class ConstantRange {
|
|||||||
/// contains - Return true if the specified value is in the set.
|
/// contains - Return true if the specified value is in the set.
|
||||||
///
|
///
|
||||||
bool contains(ConstantInt *Val) const;
|
bool contains(ConstantInt *Val) const;
|
||||||
|
|
||||||
/// getSingleElement - If this set contains a single element, return it,
|
/// getSingleElement - If this set contains a single element, return it,
|
||||||
/// otherwise return null.
|
/// otherwise return null.
|
||||||
///
|
///
|
||||||
ConstantIntegral *getSingleElement() const;
|
ConstantIntegral *getSingleElement() const;
|
||||||
|
|
||||||
/// isSingleElement - Return true if this set contains exactly one member.
|
/// isSingleElement - Return true if this set contains exactly one member.
|
||||||
///
|
///
|
||||||
bool isSingleElement() const { return getSingleElement() != 0; }
|
bool isSingleElement() const { return getSingleElement() != 0; }
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/DotGraphTraits.h - Customize .dot output ---*- C++ -*-===//
|
//===-- llvm/Support/DotGraphTraits.h - Customize .dot output ---*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines a template class that can be used to customize dot output
|
// This file defines a template class that can be used to customize dot output
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/Debug.h - Easy way to add debug output ------*- C++ -*-===//
|
//===- llvm/Support/Debug.h - Easy way to add debug output ------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements a handle way of adding debugging information to your
|
// This file implements a handle way of adding debugging information to your
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/DynamicLinker.h - Portable Dynamic Linker --*- C++ -*-===//
|
//===-- llvm/Support/DynamicLinker.h - Portable Dynamic Linker --*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Lightweight interface to dynamic library linking and loading, and dynamic
|
// Lightweight interface to dynamic library linking and loading, and dynamic
|
||||||
@ -31,7 +31,7 @@ bool LinkDynamicObject (const char *filename, std::string *ErrorMessage);
|
|||||||
/// the currently running process, as reported by the dynamic linker,
|
/// the currently running process, as reported by the dynamic linker,
|
||||||
/// or NULL if the symbol does not exist or some other error has
|
/// or NULL if the symbol does not exist or some other error has
|
||||||
/// occurred.
|
/// occurred.
|
||||||
///
|
///
|
||||||
void *GetAddressOfSymbol (const char *symbolName);
|
void *GetAddressOfSymbol (const char *symbolName);
|
||||||
void *GetAddressOfSymbol (const std::string &symbolName);
|
void *GetAddressOfSymbol (const std::string &symbolName);
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
//===-- llvm/Support/ELF.h - ELF constants and data structures --*- C++ -*-===//
|
//===-- llvm/Support/ELF.h - ELF constants and data structures --*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This header contains common, non-processor-specific data structures and
|
// This header contains common, non-processor-specific data structures and
|
||||||
// constants for the ELF file format.
|
// constants for the ELF file format.
|
||||||
//
|
//
|
||||||
// The details of the ELF32 bits in this file are largely based on
|
// The details of the ELF32 bits in this file are largely based on
|
||||||
// the Tool Interface Standard (TIS) Executable and Linking Format
|
// the Tool Interface Standard (TIS) Executable and Linking Format
|
||||||
// (ELF) Specification Version 1.2, May 1995. The ELF64 stuff is not
|
// (ELF) Specification Version 1.2, May 1995. The ELF64 stuff is not
|
||||||
@ -137,7 +137,7 @@ struct Elf32_Shdr {
|
|||||||
Elf32_Addr sh_addr; // Address where section is to be loaded
|
Elf32_Addr sh_addr; // Address where section is to be loaded
|
||||||
Elf32_Off sh_offset; // File offset of section data, in bytes
|
Elf32_Off sh_offset; // File offset of section data, in bytes
|
||||||
Elf32_Word sh_size; // Size of section, in bytes
|
Elf32_Word sh_size; // Size of section, in bytes
|
||||||
Elf32_Word sh_link; // Section type-specific header table index link
|
Elf32_Word sh_link; // Section type-specific header table index link
|
||||||
Elf32_Word sh_info; // Section type-specific extra information
|
Elf32_Word sh_info; // Section type-specific extra information
|
||||||
Elf32_Word sh_addralign; // Section address alignment
|
Elf32_Word sh_addralign; // Section address alignment
|
||||||
Elf32_Word sh_entsize; // Size of records contained within the section
|
Elf32_Word sh_entsize; // Size of records contained within the section
|
||||||
@ -204,7 +204,7 @@ struct Elf32_Sym {
|
|||||||
unsigned char st_info; // Symbol's type and binding attributes
|
unsigned char st_info; // Symbol's type and binding attributes
|
||||||
unsigned char st_other; // Must be zero; reserved
|
unsigned char st_other; // Must be zero; reserved
|
||||||
Elf32_Half st_shndx; // Which section (header table index) it's defined in
|
Elf32_Half st_shndx; // Which section (header table index) it's defined in
|
||||||
|
|
||||||
// These accessors and mutators correspond to the ELF32_ST_BIND,
|
// These accessors and mutators correspond to the ELF32_ST_BIND,
|
||||||
// ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
|
// ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
|
||||||
unsigned char getBinding () const { return st_info >> 4; }
|
unsigned char getBinding () const { return st_info >> 4; }
|
||||||
@ -238,9 +238,9 @@ enum {
|
|||||||
|
|
||||||
// Relocation entry, without explicit addend.
|
// Relocation entry, without explicit addend.
|
||||||
struct Elf32_Rel {
|
struct Elf32_Rel {
|
||||||
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
|
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
|
||||||
Elf32_Word r_info; // Symbol table index and type of relocation to apply
|
Elf32_Word r_info; // Symbol table index and type of relocation to apply
|
||||||
|
|
||||||
// These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
|
// These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
|
||||||
// and ELF32_R_INFO macros defined in the ELF specification:
|
// and ELF32_R_INFO macros defined in the ELF specification:
|
||||||
Elf32_Word getSymbol () const { return (r_info >> 8); }
|
Elf32_Word getSymbol () const { return (r_info >> 8); }
|
||||||
@ -254,10 +254,10 @@ struct Elf32_Rel {
|
|||||||
|
|
||||||
// Relocation entry with explicit addend.
|
// Relocation entry with explicit addend.
|
||||||
struct Elf32_Rela {
|
struct Elf32_Rela {
|
||||||
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
|
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
|
||||||
Elf32_Word r_info; // Symbol table index and type of relocation to apply
|
Elf32_Word r_info; // Symbol table index and type of relocation to apply
|
||||||
Elf32_Sword r_addend; // Compute value for relocatable field by adding this
|
Elf32_Sword r_addend; // Compute value for relocatable field by adding this
|
||||||
|
|
||||||
// These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
|
// These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
|
||||||
// and ELF32_R_INFO macros defined in the ELF specification:
|
// and ELF32_R_INFO macros defined in the ELF specification:
|
||||||
Elf32_Word getSymbol () const { return (r_info >> 8); }
|
Elf32_Word getSymbol () const { return (r_info >> 8); }
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/FileUtilities.h - File System Utilities -----*- C++ -*-===//
|
//===- llvm/Support/FileUtilities.h - File System Utilities -----*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines a family of utility functions which are useful for doing
|
// This file defines a family of utility functions which are useful for doing
|
||||||
@ -41,7 +41,7 @@ namespace llvm {
|
|||||||
public:
|
public:
|
||||||
FileRemover(const sys::Path &filename, bool deleteIt = true)
|
FileRemover(const sys::Path &filename, bool deleteIt = true)
|
||||||
: Filename(filename), DeleteIt(deleteIt) {}
|
: Filename(filename), DeleteIt(deleteIt) {}
|
||||||
|
|
||||||
~FileRemover() {
|
~FileRemover() {
|
||||||
if (DeleteIt)
|
if (DeleteIt)
|
||||||
try {
|
try {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/GetElementPtrTypeIterator.h -----------------*- C++ -*-===//
|
//===- llvm/Support/GetElementPtrTypeIterator.h -----------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements an iterator for walking through the types indexed by
|
// This file implements an iterator for walking through the types indexed by
|
||||||
@ -42,14 +42,14 @@ namespace llvm {
|
|||||||
return I;
|
return I;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const generic_gep_type_iterator& x) const {
|
bool operator==(const generic_gep_type_iterator& x) const {
|
||||||
return OpIt == x.OpIt;
|
return OpIt == x.OpIt;
|
||||||
}
|
}
|
||||||
bool operator!=(const generic_gep_type_iterator& x) const {
|
bool operator!=(const generic_gep_type_iterator& x) const {
|
||||||
return !operator==(x);
|
return !operator==(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Type *operator*() const {
|
const Type *operator*() const {
|
||||||
return CurTy;
|
return CurTy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ namespace llvm {
|
|||||||
// This is a non-standard operator->. It allows you to call methods on the
|
// This is a non-standard operator->. It allows you to call methods on the
|
||||||
// current type directly.
|
// current type directly.
|
||||||
const Type *operator->() const { return operator*(); }
|
const Type *operator->() const { return operator*(); }
|
||||||
|
|
||||||
Value *getOperand() const { return *OpIt; }
|
Value *getOperand() const { return *OpIt; }
|
||||||
|
|
||||||
generic_gep_type_iterator& operator++() { // Preincrement
|
generic_gep_type_iterator& operator++() { // Preincrement
|
||||||
@ -71,11 +71,11 @@ namespace llvm {
|
|||||||
CurTy = 0;
|
CurTy = 0;
|
||||||
}
|
}
|
||||||
++OpIt;
|
++OpIt;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
generic_gep_type_iterator operator++(int) { // Postincrement
|
generic_gep_type_iterator operator++(int) { // Postincrement
|
||||||
generic_gep_type_iterator tmp = *this; ++*this; return tmp;
|
generic_gep_type_iterator tmp = *this; ++*this; return tmp;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/GraphWriter.h - Write graph to a .dot file -*- C++ -*-===//
|
//===-- llvm/Support/GraphWriter.h - Write graph to a .dot file -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines a simple interface that can be used to print out generic
|
// This file defines a simple interface that can be used to print out generic
|
||||||
@ -99,33 +99,33 @@ public:
|
|||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
writeNode(&*I);
|
writeNode(&*I);
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeNode(NodeType *const *Node) {
|
void writeNode(NodeType *const *Node) {
|
||||||
writeNode(*Node);
|
writeNode(*Node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeNode(NodeType *Node) {
|
void writeNode(NodeType *Node) {
|
||||||
std::string NodeAttributes = DOTTraits::getNodeAttributes(Node);
|
std::string NodeAttributes = DOTTraits::getNodeAttributes(Node);
|
||||||
|
|
||||||
O << "\tNode" << reinterpret_cast<const void*>(Node) << " [shape=record,";
|
O << "\tNode" << reinterpret_cast<const void*>(Node) << " [shape=record,";
|
||||||
if (!NodeAttributes.empty()) O << NodeAttributes << ",";
|
if (!NodeAttributes.empty()) O << NodeAttributes << ",";
|
||||||
O << "label=\"{";
|
O << "label=\"{";
|
||||||
|
|
||||||
if (!DOTTraits::renderGraphFromBottomUp())
|
if (!DOTTraits::renderGraphFromBottomUp())
|
||||||
O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
|
O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
|
||||||
|
|
||||||
// Print out the fields of the current node...
|
// Print out the fields of the current node...
|
||||||
child_iterator EI = GTraits::child_begin(Node);
|
child_iterator EI = GTraits::child_begin(Node);
|
||||||
child_iterator EE = GTraits::child_end(Node);
|
child_iterator EE = GTraits::child_end(Node);
|
||||||
if (EI != EE) {
|
if (EI != EE) {
|
||||||
if (!DOTTraits::renderGraphFromBottomUp()) O << "|";
|
if (!DOTTraits::renderGraphFromBottomUp()) O << "|";
|
||||||
O << "{";
|
O << "{";
|
||||||
|
|
||||||
for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) {
|
for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) {
|
||||||
if (i) O << "|";
|
if (i) O << "|";
|
||||||
O << "<g" << i << ">" << DOTTraits::getEdgeSourceLabel(Node, EI);
|
O << "<g" << i << ">" << DOTTraits::getEdgeSourceLabel(Node, EI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EI != EE)
|
if (EI != EE)
|
||||||
O << "|<g64>truncated...";
|
O << "|<g64>truncated...";
|
||||||
O << "}";
|
O << "}";
|
||||||
@ -133,9 +133,9 @@ public:
|
|||||||
}
|
}
|
||||||
if (DOTTraits::renderGraphFromBottomUp())
|
if (DOTTraits::renderGraphFromBottomUp())
|
||||||
O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
|
O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
|
||||||
|
|
||||||
O << "}\"];\n"; // Finish printing the "node" line
|
O << "}\"];\n"; // Finish printing the "node" line
|
||||||
|
|
||||||
// Output all of the edges now
|
// Output all of the edges now
|
||||||
EI = GTraits::child_begin(Node);
|
EI = GTraits::child_begin(Node);
|
||||||
for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i)
|
for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i)
|
||||||
@ -174,7 +174,7 @@ public:
|
|||||||
O << DOT::EscapeString(Label);
|
O << DOT::EscapeString(Label);
|
||||||
if (NumEdgeSources) {
|
if (NumEdgeSources) {
|
||||||
O << "|{";
|
O << "|{";
|
||||||
|
|
||||||
for (unsigned i = 0; i != NumEdgeSources; ++i) {
|
for (unsigned i = 0; i != NumEdgeSources; ++i) {
|
||||||
if (i) O << "|";
|
if (i) O << "|";
|
||||||
O << "<g" << i << ">";
|
O << "<g" << i << ">";
|
||||||
@ -197,7 +197,7 @@ public:
|
|||||||
O << ":g" << SrcNodePort;
|
O << ":g" << SrcNodePort;
|
||||||
O << " -> Node" << reinterpret_cast<const void*>(DestNodeID);
|
O << " -> Node" << reinterpret_cast<const void*>(DestNodeID);
|
||||||
if (DestNodePort >= 0)
|
if (DestNodePort >= 0)
|
||||||
O << ":g" << DestNodePort;
|
O << ":g" << DestNodePort;
|
||||||
|
|
||||||
if (!Attrs.empty())
|
if (!Attrs.empty())
|
||||||
O << "[" << Attrs << "]";
|
O << "[" << Attrs << "]";
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/InstIterator.h - Classes for inst iteration -*- C++ -*-===//
|
//===- llvm/Support/InstIterator.h - Classes for inst iteration -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file contains definitions of two iterators for iterating over the
|
// This file contains definitions of two iterators for iterating over the
|
||||||
@ -54,8 +54,8 @@ public:
|
|||||||
template<typename A, typename B, typename C, typename D>
|
template<typename A, typename B, typename C, typename D>
|
||||||
InstIterator(InstIterator<A,B,C,D> &II)
|
InstIterator(InstIterator<A,B,C,D> &II)
|
||||||
: BBs(II.BBs), BB(II.BB), BI(II.BI) {}
|
: BBs(II.BBs), BB(II.BB), BI(II.BI) {}
|
||||||
|
|
||||||
template<class M> InstIterator(M &m)
|
template<class M> InstIterator(M &m)
|
||||||
: BBs(&m.getBasicBlockList()), BB(BBs->begin()) { // begin ctor
|
: BBs(&m.getBasicBlockList()), BB(BBs->begin()) { // begin ctor
|
||||||
if (BB != BBs->end()) {
|
if (BB != BBs->end()) {
|
||||||
BI = BB->begin();
|
BI = BB->begin();
|
||||||
@ -63,43 +63,43 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class M> InstIterator(M &m, bool)
|
template<class M> InstIterator(M &m, bool)
|
||||||
: BBs(&m.getBasicBlockList()), BB(BBs->end()) { // end ctor
|
: BBs(&m.getBasicBlockList()), BB(BBs->end()) { // end ctor
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accessors to get at the underlying iterators...
|
// Accessors to get at the underlying iterators...
|
||||||
inline BBIty &getBasicBlockIterator() { return BB; }
|
inline BBIty &getBasicBlockIterator() { return BB; }
|
||||||
inline BIty &getInstructionIterator() { return BI; }
|
inline BIty &getInstructionIterator() { return BI; }
|
||||||
|
|
||||||
inline reference operator*() const { return *BI; }
|
inline reference operator*() const { return *BI; }
|
||||||
inline pointer operator->() const { return &operator*(); }
|
inline pointer operator->() const { return &operator*(); }
|
||||||
|
|
||||||
inline bool operator==(const InstIterator &y) const {
|
inline bool operator==(const InstIterator &y) const {
|
||||||
return BB == y.BB && (BB == BBs->end() || BI == y.BI);
|
return BB == y.BB && (BB == BBs->end() || BI == y.BI);
|
||||||
}
|
}
|
||||||
inline bool operator!=(const InstIterator& y) const {
|
inline bool operator!=(const InstIterator& y) const {
|
||||||
return !operator==(y);
|
return !operator==(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
InstIterator& operator++() {
|
InstIterator& operator++() {
|
||||||
++BI;
|
++BI;
|
||||||
advanceToNextBB();
|
advanceToNextBB();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline InstIterator operator++(int) {
|
inline InstIterator operator++(int) {
|
||||||
InstIterator tmp = *this; ++*this; return tmp;
|
InstIterator tmp = *this; ++*this; return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
InstIterator& operator--() {
|
InstIterator& operator--() {
|
||||||
while (BB == BBs->end() || BI == BB->begin()) {
|
while (BB == BBs->end() || BI == BB->begin()) {
|
||||||
--BB;
|
--BB;
|
||||||
BI = BB->end();
|
BI = BB->end();
|
||||||
}
|
}
|
||||||
--BI;
|
--BI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline InstIterator operator--(int) {
|
inline InstIterator operator--(int) {
|
||||||
InstIterator tmp = *this; --*this; return tmp;
|
InstIterator tmp = *this; --*this; return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool atEnd() const { return BB == BBs->end(); }
|
inline bool atEnd() const { return BB == BBs->end(); }
|
||||||
@ -121,7 +121,7 @@ typedef InstIterator<iplist<BasicBlock>,
|
|||||||
Function::iterator, BasicBlock::iterator,
|
Function::iterator, BasicBlock::iterator,
|
||||||
Instruction> inst_iterator;
|
Instruction> inst_iterator;
|
||||||
typedef InstIterator<const iplist<BasicBlock>,
|
typedef InstIterator<const iplist<BasicBlock>,
|
||||||
Function::const_iterator,
|
Function::const_iterator,
|
||||||
BasicBlock::const_iterator,
|
BasicBlock::const_iterator,
|
||||||
const Instruction> const_inst_iterator;
|
const Instruction> const_inst_iterator;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/InstVisitor.h - Define instruction visitors -*- C++ -*-===//
|
//===- llvm/Support/InstVisitor.h - Define instruction visitors -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This template class is used to define instruction visitors in a typesafe
|
// This template class is used to define instruction visitors in a typesafe
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/LeakDetector.h - Provide leak detection ----*- C++ -*-===//
|
//===-- llvm/Support/LeakDetector.h - Provide leak detection ----*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines a class that can be used to provide very simple memory leak
|
// This file defines a class that can be used to provide very simple memory leak
|
||||||
@ -48,7 +48,7 @@ struct LeakDetector {
|
|||||||
removeGarbageObjectImpl(Object);
|
removeGarbageObjectImpl(Object);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// checkForGarbage - Traverse the internal representation of garbage
|
/// checkForGarbage - Traverse the internal representation of garbage
|
||||||
/// pointers. If there are any pointers that have been add'ed, but not
|
/// pointers. If there are any pointers that have been add'ed, but not
|
||||||
/// remove'd, big obnoxious warnings about memory leaks are issued.
|
/// remove'd, big obnoxious warnings about memory leaks are issued.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/Mangler.h - Self-contained name mangler ----*- C++ -*-===//
|
//===-- llvm/Support/Mangler.h - Self-contained name mangler ----*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Unified name mangler for various backends.
|
// Unified name mangler for various backends.
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
/// doesn't guarantee unique names for values. getValueName already
|
/// doesn't guarantee unique names for values. getValueName already
|
||||||
/// does this for you, so there's no point calling it on the result
|
/// does this for you, so there's no point calling it on the result
|
||||||
/// from getValueName.
|
/// from getValueName.
|
||||||
///
|
///
|
||||||
static std::string makeNameProper(const std::string &x);
|
static std::string makeNameProper(const std::string &x);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/MathExtras.h - Useful math functions -------*- C++ -*-===//
|
//===-- llvm/Support/MathExtras.h - Useful math functions -------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file contains some functions that are useful for math stuff.
|
// This file contains some functions that are useful for math stuff.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/PassNameParser.h ----------------------------*- C++ -*-===//
|
//===- llvm/Support/PassNameParser.h ----------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file the PassNameParser and FilteredPassNameParser<> classes, which are
|
// This file the PassNameParser and FilteredPassNameParser<> classes, which are
|
||||||
@ -34,12 +34,12 @@ namespace llvm {
|
|||||||
// PassNameParser class - Make use of the pass registration mechanism to
|
// PassNameParser class - Make use of the pass registration mechanism to
|
||||||
// automatically add a command line argument to opt for each pass.
|
// automatically add a command line argument to opt for each pass.
|
||||||
//
|
//
|
||||||
class PassNameParser : public PassRegistrationListener,
|
class PassNameParser : public PassRegistrationListener,
|
||||||
public cl::parser<const PassInfo*> {
|
public cl::parser<const PassInfo*> {
|
||||||
cl::Option *Opt;
|
cl::Option *Opt;
|
||||||
public:
|
public:
|
||||||
PassNameParser() : Opt(0) {}
|
PassNameParser() : Opt(0) {}
|
||||||
|
|
||||||
void initialize(cl::Option &O) {
|
void initialize(cl::Option &O) {
|
||||||
Opt = &O;
|
Opt = &O;
|
||||||
cl::parser<const PassInfo*>::initialize(O);
|
cl::parser<const PassInfo*>::initialize(O);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/PatternMatch.h - Match on the LLVM IR ------*- C++ -*-===//
|
//===-- llvm/Support/PatternMatch.h - Match on the LLVM IR ------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file provides a simple and efficient mechanism for performing general
|
// This file provides a simple and efficient mechanism for performing general
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace PatternMatch {
|
namespace PatternMatch {
|
||||||
|
|
||||||
template<typename Val, typename Pattern>
|
template<typename Val, typename Pattern>
|
||||||
bool match(Val *V, const Pattern &P) {
|
bool match(Val *V, const Pattern &P) {
|
||||||
@ -88,7 +88,7 @@ struct BinaryOp_match {
|
|||||||
R.match(CE->getOperand(1));
|
R.match(CE->getOperand(1));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename LHS, typename RHS>
|
template<typename LHS, typename RHS>
|
||||||
inline BinaryOp_match<LHS, RHS, Instruction::Add> m_Add(const LHS &L,
|
inline BinaryOp_match<LHS, RHS, Instruction::Add> m_Add(const LHS &L,
|
||||||
@ -178,7 +178,7 @@ struct BinaryOpClass_match {
|
|||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename LHS, typename RHS>
|
template<typename LHS, typename RHS>
|
||||||
inline BinaryOpClass_match<LHS, RHS, SetCondInst>
|
inline BinaryOpClass_match<LHS, RHS, SetCondInst>
|
||||||
@ -216,7 +216,7 @@ private:
|
|||||||
else
|
else
|
||||||
return LHS == ConstantFP::get(LHS->getType(), -0.0) && L.match(RHS);
|
return LHS == ConstantFP::get(LHS->getType(), -0.0) && L.match(RHS);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename LHS>
|
template<typename LHS>
|
||||||
inline neg_match<LHS> m_Neg(const LHS &L) { return L; }
|
inline neg_match<LHS> m_Neg(const LHS &L) { return L; }
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/PluginLoader.h - Plugin Loader for Tools ---*- C++ -*-===//
|
//===-- llvm/Support/PluginLoader.h - Plugin Loader for Tools ---*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// A tool can #include this file to get a -load option that allows the user to
|
// A tool can #include this file to get a -load option that allows the user to
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/SlowOperationInformer.h - Keep user informed *- C++ -*-===//
|
//===- llvm/Support/SlowOperationInformer.h - Keep user informed *- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines a simple object which can be used to let the user know what
|
// This file defines a simple object which can be used to let the user know what
|
||||||
@ -38,13 +38,13 @@ namespace llvm {
|
|||||||
class SlowOperationInformer {
|
class SlowOperationInformer {
|
||||||
std::string OperationName;
|
std::string OperationName;
|
||||||
unsigned LastPrintAmount;
|
unsigned LastPrintAmount;
|
||||||
|
|
||||||
SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT
|
SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT
|
||||||
void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT
|
void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT
|
||||||
public:
|
public:
|
||||||
SlowOperationInformer(const std::string &Name);
|
SlowOperationInformer(const std::string &Name);
|
||||||
~SlowOperationInformer();
|
~SlowOperationInformer();
|
||||||
|
|
||||||
/// progress - Clients should periodically call this method when they are in
|
/// progress - Clients should periodically call this method when they are in
|
||||||
/// an exception-safe state. The Amount variable should indicate how far
|
/// an exception-safe state. The Amount variable should indicate how far
|
||||||
/// along the operation is, given in 1/10ths of a percent (in other words,
|
/// along the operation is, given in 1/10ths of a percent (in other words,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- StableBasicBlockNumbering.h - Provide BB identifiers -----*- C++ -*-===//
|
//===- StableBasicBlockNumbering.h - Provide BB identifiers -----*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This class provides a *stable* numbering of basic blocks that does not depend
|
// This class provides a *stable* numbering of basic blocks that does not depend
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
|
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file contains functions used to do a variety of low-level, often
|
// This file contains functions used to do a variety of low-level, often
|
||||||
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
/// Determine if the ostream provided is connected to the std::cout and
|
/// Determine if the ostream provided is connected to the std::cout and
|
||||||
/// displayed or not (to a console window). If so, generate a warning message
|
/// displayed or not (to a console window). If so, generate a warning message
|
||||||
/// advising against display of bytecode and return true. Otherwise just return
|
/// advising against display of bytecode and return true. Otherwise just return
|
||||||
/// false
|
/// false
|
||||||
/// @brief Check for output written to a console
|
/// @brief Check for output written to a console
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/ThreadSupport-NoSupport.h - Generic Impl ---*- C++ -*-===//
|
//===-- llvm/Support/ThreadSupport-NoSupport.h - Generic Impl ---*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines a generic ThreadSupport implementation used when there is
|
// This file defines a generic ThreadSupport implementation used when there is
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/ThreadSupport-PThreads.h - PThreads support *- C++ -*-===//
|
//===-- llvm/Support/ThreadSupport-PThreads.h - PThreads support *- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines pthreads implementations of the generic threading
|
// This file defines pthreads implementations of the generic threading
|
||||||
@ -39,7 +39,7 @@ namespace llvm {
|
|||||||
|
|
||||||
errorcode = pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
|
errorcode = pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
|
||||||
assert(errorcode == 0);
|
assert(errorcode == 0);
|
||||||
|
|
||||||
errorcode = pthread_mutex_init(&mutex, &Attr);
|
errorcode = pthread_mutex_init(&mutex, &Attr);
|
||||||
assert(errorcode == 0);
|
assert(errorcode == 0);
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/Timer.h - Interval Timing Support ----------*- C++ -*-===//
|
//===-- llvm/Support/Timer.h - Interval Timing Support ----------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines three classes: Timer, TimeRegion, and TimerGroup,
|
// This file defines three classes: Timer, TimeRegion, and TimerGroup,
|
||||||
@ -74,7 +74,7 @@ public:
|
|||||||
return Elapsed < T.Elapsed;
|
return Elapsed < T.Elapsed;
|
||||||
}
|
}
|
||||||
bool operator>(const Timer &T) const { return T.operator<(*this); }
|
bool operator>(const Timer &T) const { return T.operator<(*this); }
|
||||||
|
|
||||||
/// startTimer - Start the timer running. Time between calls to
|
/// startTimer - Start the timer running. Time between calls to
|
||||||
/// startTimer/stopTimer is counted by the Timer class. Note that these calls
|
/// startTimer/stopTimer is counted by the Timer class. Note that these calls
|
||||||
/// must be correctly paired.
|
/// must be correctly paired.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/ToolRunner.h -------------------------------*- C++ -*-===//
|
//===-- llvm/Support/ToolRunner.h -------------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file exposes an abstraction around a platform C compiler, used to
|
// This file exposes an abstraction around a platform C compiler, used to
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
FileType fileType,
|
FileType fileType,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(), unsigned Timeout = 0);
|
std::vector<std::string>(), unsigned Timeout = 0);
|
||||||
|
|
||||||
/// MakeSharedObject - This compiles the specified file (which is either a .c
|
/// MakeSharedObject - This compiles the specified file (which is either a .c
|
||||||
@ -110,7 +110,7 @@ public:
|
|||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(),
|
std::vector<std::string>(),
|
||||||
unsigned Timeout = 0) = 0;
|
unsigned Timeout = 0) = 0;
|
||||||
};
|
};
|
||||||
@ -140,7 +140,7 @@ public:
|
|||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(),
|
std::vector<std::string>(),
|
||||||
unsigned Timeout = 0);
|
unsigned Timeout = 0);
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ public:
|
|||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(),
|
std::vector<std::string>(),
|
||||||
unsigned Timeout = 0);
|
unsigned Timeout = 0);
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/Support/TypeInfo.h - Support for type_info objects -*- C++ -*-===//
|
//===- llvm/Support/TypeInfo.h - Support for type_info objects -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This class makes std::type_info objects behave like first class objects that
|
// This class makes std::type_info objects behave like first class objects that
|
||||||
@ -45,7 +45,7 @@ struct TypeInfo {
|
|||||||
private:
|
private:
|
||||||
const std::type_info *Info;
|
const std::type_info *Info;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Comparison operators
|
// Comparison operators
|
||||||
inline bool operator==(const TypeInfo &lhs, const TypeInfo &rhs) {
|
inline bool operator==(const TypeInfo &lhs, const TypeInfo &rhs) {
|
||||||
return lhs.get() == rhs.get();
|
return lhs.get() == rhs.get();
|
||||||
@ -62,11 +62,11 @@ inline bool operator!=(const TypeInfo &lhs, const TypeInfo &rhs) {
|
|||||||
inline bool operator>(const TypeInfo &lhs, const TypeInfo &rhs) {
|
inline bool operator>(const TypeInfo &lhs, const TypeInfo &rhs) {
|
||||||
return rhs < lhs;
|
return rhs < lhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator<=(const TypeInfo &lhs, const TypeInfo &rhs) {
|
inline bool operator<=(const TypeInfo &lhs, const TypeInfo &rhs) {
|
||||||
return !(lhs > rhs);
|
return !(lhs > rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator>=(const TypeInfo &lhs, const TypeInfo &rhs) {
|
inline bool operator>=(const TypeInfo &lhs, const TypeInfo &rhs) {
|
||||||
return !(lhs < rhs);
|
return !(lhs < rhs);
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
//===- llvm/Support/type_traits.h - Simplfied type traits -------*- C++ -*-===//
|
//===- llvm/Support/type_traits.h - Simplfied type traits -------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file provides a template class that determines if a type is a class or
|
// This file provides a template class that determines if a type is a class or
|
||||||
// not. The basic mechanism, based on using the pointer to member function of
|
// not. The basic mechanism, based on using the pointer to member function of
|
||||||
// a zero argument to a function was "boosted" from the boost type_traits
|
// a zero argument to a function was "boosted" from the boost type_traits
|
||||||
// library. See http://www.boost.org/ for all the gory details.
|
// library. See http://www.boost.org/ for all the gory details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
@ -27,13 +27,13 @@ namespace llvm {
|
|||||||
namespace dont_use
|
namespace dont_use
|
||||||
{
|
{
|
||||||
// These two functions should never be used. They are helpers to
|
// These two functions should never be used. They are helpers to
|
||||||
// the is_class template below. They cannot be located inside
|
// the is_class template below. They cannot be located inside
|
||||||
// is_class because doing so causes at least GCC to think that
|
// is_class because doing so causes at least GCC to think that
|
||||||
// the value of the "value" enumerator is not constant. Placing
|
// the value of the "value" enumerator is not constant. Placing
|
||||||
// them out here (for some strange reason) allows the sizeof
|
// them out here (for some strange reason) allows the sizeof
|
||||||
// operator against them to magically be constant. This is
|
// operator against them to magically be constant. This is
|
||||||
// important to make the is_class<T>::value idiom zero cost. it
|
// important to make the is_class<T>::value idiom zero cost. it
|
||||||
// evaluates to a constant 1 or 0 depending on whether the
|
// evaluates to a constant 1 or 0 depending on whether the
|
||||||
// parameter T is a class or not (respectively).
|
// parameter T is a class or not (respectively).
|
||||||
template<typename T> char is_class_helper(void(T::*)(void));
|
template<typename T> char is_class_helper(void(T::*)(void));
|
||||||
template<typename T> double is_class_helper(...);
|
template<typename T> double is_class_helper(...);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/System/DynamicLibrary.h - Portable Dynamic Library -*- C++ -*-===//
|
//===-- llvm/System/DynamicLibrary.h - Portable Dynamic Library -*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the sys::DynamicLibrary class.
|
// This file declares the sys::DynamicLibrary class.
|
||||||
@ -21,10 +21,10 @@ namespace llvm {
|
|||||||
namespace sys {
|
namespace sys {
|
||||||
|
|
||||||
/// This class provides a portable interface to dynamic libraries which also
|
/// This class provides a portable interface to dynamic libraries which also
|
||||||
/// might be known as shared libraries, shared objects, dynamic shared
|
/// might be known as shared libraries, shared objects, dynamic shared
|
||||||
/// objects, or dynamic link libraries. Regardless of the terminology or the
|
/// objects, or dynamic link libraries. Regardless of the terminology or the
|
||||||
/// operating system interface, this class provides a portable interface that
|
/// operating system interface, this class provides a portable interface that
|
||||||
/// allows dynamic libraries to be loaded and and searched for externally
|
/// allows dynamic libraries to be loaded and and searched for externally
|
||||||
/// defined symbols. This is typically used to provide "plug-in" support.
|
/// defined symbols. This is typically used to provide "plug-in" support.
|
||||||
/// @since 1.4
|
/// @since 1.4
|
||||||
/// @brief Portable dynamic library abstraction.
|
/// @brief Portable dynamic library abstraction.
|
||||||
@ -34,7 +34,7 @@ namespace sys {
|
|||||||
public:
|
public:
|
||||||
/// Construct a DynamicLibrary that represents the currently executing
|
/// Construct a DynamicLibrary that represents the currently executing
|
||||||
/// program. The program must have been linked with -export-dynamic or
|
/// program. The program must have been linked with -export-dynamic or
|
||||||
/// -dlopen self for this to work. Any symbols retrieved with the
|
/// -dlopen self for this to work. Any symbols retrieved with the
|
||||||
/// GetAddressOfSymbol function will refer to the program not to any
|
/// GetAddressOfSymbol function will refer to the program not to any
|
||||||
/// library.
|
/// library.
|
||||||
/// @throws std::string indicating why the program couldn't be opened.
|
/// @throws std::string indicating why the program couldn't be opened.
|
||||||
@ -49,8 +49,8 @@ namespace sys {
|
|||||||
|
|
||||||
/// After destruction, the symbols of the library will no longer be
|
/// After destruction, the symbols of the library will no longer be
|
||||||
/// available to the program. It is important to make sure the lifespan
|
/// available to the program. It is important to make sure the lifespan
|
||||||
/// of a DynamicLibrary exceeds the lifetime of the pointers returned
|
/// of a DynamicLibrary exceeds the lifetime of the pointers returned
|
||||||
/// by the GetAddressOfSymbol otherwise the program may walk off into
|
/// by the GetAddressOfSymbol otherwise the program may walk off into
|
||||||
/// uncharted territory.
|
/// uncharted territory.
|
||||||
/// @see GetAddressOfSymbol.
|
/// @see GetAddressOfSymbol.
|
||||||
/// @brief Closes the DynamicLibrary
|
/// @brief Closes the DynamicLibrary
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/MappedFile.h - MappedFile OS Concept ---------*- C++ -*-===//
|
//===- llvm/System/MappedFile.h - MappedFile OS Concept ---------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the llvm::sys::MappedFile class.
|
// This file declares the llvm::sys::MappedFile class.
|
||||||
@ -20,14 +20,14 @@ namespace llvm {
|
|||||||
namespace sys {
|
namespace sys {
|
||||||
|
|
||||||
/// Forward declare a class used for holding platform specific information
|
/// Forward declare a class used for holding platform specific information
|
||||||
/// that needs to be
|
/// that needs to be
|
||||||
struct MappedFileInfo;
|
struct MappedFileInfo;
|
||||||
|
|
||||||
/// This class provides an abstraction for a memory mapped file in the
|
/// This class provides an abstraction for a memory mapped file in the
|
||||||
/// operating system's filesystem. It provides platform independent operations
|
/// operating system's filesystem. It provides platform independent operations
|
||||||
/// for mapping a file into memory for both read and write access. This class
|
/// for mapping a file into memory for both read and write access. This class
|
||||||
/// does not provide facilities for finding the file or operating on paths to
|
/// does not provide facilities for finding the file or operating on paths to
|
||||||
/// files. The sys::Path class is used for that.
|
/// files. The sys::Path class is used for that.
|
||||||
/// @since 1.4
|
/// @since 1.4
|
||||||
/// @brief An abstraction for memory mapped files.
|
/// @brief An abstraction for memory mapped files.
|
||||||
class MappedFile {
|
class MappedFile {
|
||||||
@ -85,14 +85,14 @@ namespace sys {
|
|||||||
char* charBase() const { return reinterpret_cast<char*>(base_); }
|
char* charBase() const { return reinterpret_cast<char*>(base_); }
|
||||||
|
|
||||||
/// This function returns a reference to the sys::Path object kept by the
|
/// This function returns a reference to the sys::Path object kept by the
|
||||||
/// MappedFile object. This contains the path to the file that is or
|
/// MappedFile object. This contains the path to the file that is or
|
||||||
/// will be mapped.
|
/// will be mapped.
|
||||||
/// @returns sys::Path containing the path name.
|
/// @returns sys::Path containing the path name.
|
||||||
/// @brief Returns the mapped file's path as a sys::Path
|
/// @brief Returns the mapped file's path as a sys::Path
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
const sys::Path& path() const { return path_; }
|
const sys::Path& path() const { return path_; }
|
||||||
|
|
||||||
/// This function returns the number of bytes in the file.
|
/// This function returns the number of bytes in the file.
|
||||||
/// @throws std::string if an error occurs
|
/// @throws std::string if an error occurs
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
|
|
||||||
@ -106,15 +106,15 @@ namespace sys {
|
|||||||
/// @brief Remove the file mapping from memory.
|
/// @brief Remove the file mapping from memory.
|
||||||
void unmap();
|
void unmap();
|
||||||
|
|
||||||
/// The mapped file is put into memory.
|
/// The mapped file is put into memory.
|
||||||
/// @returns The base memory address of the mapped file.
|
/// @returns The base memory address of the mapped file.
|
||||||
/// @brief Map the file into memory.
|
/// @brief Map the file into memory.
|
||||||
void* map();
|
void* map();
|
||||||
|
|
||||||
/// This method causes the size of the file, and consequently the size
|
/// This method causes the size of the file, and consequently the size
|
||||||
/// of the mapping to be set. This is logically the same as unmap(),
|
/// of the mapping to be set. This is logically the same as unmap(),
|
||||||
/// adjust size of the file, map(). Consequently, when calling this
|
/// adjust size of the file, map(). Consequently, when calling this
|
||||||
/// function, the caller should not rely on previous results of the
|
/// function, the caller should not rely on previous results of the
|
||||||
/// map(), base(), or baseChar() members as they may point to invalid
|
/// map(), base(), or baseChar() members as they may point to invalid
|
||||||
/// areas of memory after this call.
|
/// areas of memory after this call.
|
||||||
/// @throws std::string if an error occurs
|
/// @throws std::string if an error occurs
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/Memory.h - Memory Support --------------------*- C++ -*-===//
|
//===- llvm/System/Memory.h - Memory Support --------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the llvm::sys::Memory class.
|
// This file declares the llvm::sys::Memory class.
|
||||||
@ -42,13 +42,13 @@ namespace sys {
|
|||||||
public:
|
public:
|
||||||
/// This method allocates a block of Read/Write/Execute memory that is
|
/// This method allocates a block of Read/Write/Execute memory that is
|
||||||
/// suitable for executing dynamically generated code (e.g. JIT). An
|
/// suitable for executing dynamically generated code (e.g. JIT). An
|
||||||
/// attempt to allocate \p NumBytes bytes of virtual memory is made.
|
/// attempt to allocate \p NumBytes bytes of virtual memory is made.
|
||||||
/// @throws std::string if an error occurred.
|
/// @throws std::string if an error occurred.
|
||||||
/// @brief Allocate Read/Write/Execute memory.
|
/// @brief Allocate Read/Write/Execute memory.
|
||||||
static MemoryBlock AllocateRWX(unsigned NumBytes);
|
static MemoryBlock AllocateRWX(unsigned NumBytes);
|
||||||
|
|
||||||
/// This method releases a block of Read/Write/Execute memory that was
|
/// This method releases a block of Read/Write/Execute memory that was
|
||||||
/// allocated with the AllocateRWX method. It should not be used to
|
/// allocated with the AllocateRWX method. It should not be used to
|
||||||
/// release any memory block allocated any other way.
|
/// release any memory block allocated any other way.
|
||||||
/// @throws std::string if an error occurred.
|
/// @throws std::string if an error occurred.
|
||||||
/// @brief Release Read/Write/Execute memory.
|
/// @brief Release Read/Write/Execute memory.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/Path.h - Path Operating System Concept -------*- C++ -*-===//
|
//===- llvm/System/Path.h - Path Operating System Concept -------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the llvm::sys::Path class.
|
// This file declares the llvm::sys::Path class.
|
||||||
@ -23,24 +23,24 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace sys {
|
namespace sys {
|
||||||
|
|
||||||
/// This class provides an abstraction for the path to a file or directory
|
/// This class provides an abstraction for the path to a file or directory
|
||||||
/// in the operating system's filesystem and provides various basic operations
|
/// in the operating system's filesystem and provides various basic operations
|
||||||
/// on it. Note that this class only represents the name of a path to a file
|
/// on it. Note that this class only represents the name of a path to a file
|
||||||
/// or directory which may or may not be valid for a given machine's file
|
/// or directory which may or may not be valid for a given machine's file
|
||||||
/// system. A Path ensures that the name it encapsulates is syntactical valid
|
/// system. A Path ensures that the name it encapsulates is syntactical valid
|
||||||
/// for the operating system it is running on but does not ensure correctness
|
/// for the operating system it is running on but does not ensure correctness
|
||||||
/// for any particular file system. A Path either references a file or a
|
/// for any particular file system. A Path either references a file or a
|
||||||
/// directory and the distinction is consistently maintained. Most operations
|
/// directory and the distinction is consistently maintained. Most operations
|
||||||
/// on the class have invariants that require the Path object to be either a
|
/// on the class have invariants that require the Path object to be either a
|
||||||
/// file path or a directory path, but not both. Those operations will also
|
/// file path or a directory path, but not both. Those operations will also
|
||||||
/// leave the object as either a file path or object path. There is exactly
|
/// leave the object as either a file path or object path. There is exactly
|
||||||
/// one invalid Path which is the empty path. The class should never allow any
|
/// one invalid Path which is the empty path. The class should never allow any
|
||||||
/// other syntactically invalid non-empty path name to be assigned. Empty
|
/// other syntactically invalid non-empty path name to be assigned. Empty
|
||||||
/// paths are required in order to indicate an error result. If the path is
|
/// paths are required in order to indicate an error result. If the path is
|
||||||
/// empty, the isValid operation will return false. All operations will fail
|
/// empty, the isValid operation will return false. All operations will fail
|
||||||
/// if isValid is false. Operations that change the path will either return
|
/// if isValid is false. Operations that change the path will either return
|
||||||
/// false if it would cause a syntactically invalid path name (in which case
|
/// false if it would cause a syntactically invalid path name (in which case
|
||||||
/// the Path object is left unchanged) or throw an std::string exception
|
/// the Path object is left unchanged) or throw an std::string exception
|
||||||
/// indicating the error.
|
/// indicating the error.
|
||||||
/// @since 1.4
|
/// @since 1.4
|
||||||
/// @brief An abstraction for operating system paths.
|
/// @brief An abstraction for operating system paths.
|
||||||
@ -54,11 +54,11 @@ namespace sys {
|
|||||||
/// However, to support llvm-ar, the mode, user, and group fields are
|
/// However, to support llvm-ar, the mode, user, and group fields are
|
||||||
/// retained. These pertain to unix security and may not have a meaningful
|
/// retained. These pertain to unix security and may not have a meaningful
|
||||||
/// value on non-Unix platforms. However, the fileSize and modTime fields
|
/// value on non-Unix platforms. However, the fileSize and modTime fields
|
||||||
/// should always be applicabe on all platforms. The structure is
|
/// should always be applicabe on all platforms. The structure is
|
||||||
/// filled in by the getStatusInfo method.
|
/// filled in by the getStatusInfo method.
|
||||||
/// @brief File status structure
|
/// @brief File status structure
|
||||||
struct StatusInfo {
|
struct StatusInfo {
|
||||||
StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999),
|
StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999),
|
||||||
group(999), isDir(false) { }
|
group(999), isDir(false) { }
|
||||||
size_t fileSize; ///< Size of the file in bytes
|
size_t fileSize; ///< Size of the file in bytes
|
||||||
TimeValue modTime; ///< Time of file's modification
|
TimeValue modTime; ///< Time of file's modification
|
||||||
@ -73,7 +73,7 @@ namespace sys {
|
|||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
/// Construct a path to the root directory of the file system. The root
|
/// Construct a path to the root directory of the file system. The root
|
||||||
/// directory is a top level directory above which there are no more
|
/// directory is a top level directory above which there are no more
|
||||||
/// directories. For example, on UNIX, the root directory is /. On Windows
|
/// directories. For example, on UNIX, the root directory is /. On Windows
|
||||||
/// it is C:\. Other operating systems may have different notions of
|
/// it is C:\. Other operating systems may have different notions of
|
||||||
/// what the root directory is.
|
/// what the root directory is.
|
||||||
@ -81,8 +81,8 @@ namespace sys {
|
|||||||
static Path GetRootDirectory();
|
static Path GetRootDirectory();
|
||||||
|
|
||||||
/// Construct a path to a unique temporary directory that is created in
|
/// Construct a path to a unique temporary directory that is created in
|
||||||
/// a "standard" place for the operating system. The directory is
|
/// a "standard" place for the operating system. The directory is
|
||||||
/// guaranteed to be created on exit from this function. If the directory
|
/// guaranteed to be created on exit from this function. If the directory
|
||||||
/// cannot be created, the function will throw an exception.
|
/// cannot be created, the function will throw an exception.
|
||||||
/// @throws std::string indicating why the directory could not be created.
|
/// @throws std::string indicating why the directory could not be created.
|
||||||
/// @brief Constrct a path to an new, unique, existing temporary
|
/// @brief Constrct a path to an new, unique, existing temporary
|
||||||
@ -100,7 +100,7 @@ namespace sys {
|
|||||||
/// Construct a vector of sys::Path that contains the "standard" bytecode
|
/// Construct a vector of sys::Path that contains the "standard" bytecode
|
||||||
/// library paths suitable for linking into an llvm program. This function
|
/// library paths suitable for linking into an llvm program. This function
|
||||||
/// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the value
|
/// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the value
|
||||||
/// of LLVM_LIBDIR. It also must provide the System library paths as
|
/// of LLVM_LIBDIR. It also must provide the System library paths as
|
||||||
/// returned by GetSystemLibraryPaths.
|
/// returned by GetSystemLibraryPaths.
|
||||||
/// @see GetSystemLibraryPaths
|
/// @see GetSystemLibraryPaths
|
||||||
/// @brief Construct a list of directories in which bytecode could be
|
/// @brief Construct a list of directories in which bytecode could be
|
||||||
@ -112,9 +112,9 @@ namespace sys {
|
|||||||
/// @brief Find a library.
|
/// @brief Find a library.
|
||||||
static Path FindLibrary(std::string& short_name);
|
static Path FindLibrary(std::string& short_name);
|
||||||
|
|
||||||
/// Construct a path to the default LLVM configuration directory. The
|
/// Construct a path to the default LLVM configuration directory. The
|
||||||
/// implementation must ensure that this is a well-known (same on many
|
/// implementation must ensure that this is a well-known (same on many
|
||||||
/// systems) directory in which llvm configuration files exist. For
|
/// systems) directory in which llvm configuration files exist. For
|
||||||
/// example, on Unix, the /etc/llvm directory has been selected.
|
/// example, on Unix, the /etc/llvm directory has been selected.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @brief Construct a path to the default LLVM configuration directory
|
/// @brief Construct a path to the default LLVM configuration directory
|
||||||
@ -130,8 +130,8 @@ namespace sys {
|
|||||||
|
|
||||||
/// Construct a path to the current user's home directory. The
|
/// Construct a path to the current user's home directory. The
|
||||||
/// implementation must use an operating system specific mechanism for
|
/// implementation must use an operating system specific mechanism for
|
||||||
/// determining the user's home directory. For example, the environment
|
/// determining the user's home directory. For example, the environment
|
||||||
/// variable "HOME" could be used on Unix. If a given operating system
|
/// variable "HOME" could be used on Unix. If a given operating system
|
||||||
/// does not have the concept of a user's home directory, this static
|
/// does not have the concept of a user's home directory, this static
|
||||||
/// constructor must provide the same result as GetRootDirectory.
|
/// constructor must provide the same result as GetRootDirectory.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
@ -139,9 +139,9 @@ namespace sys {
|
|||||||
static Path GetUserHomeDirectory();
|
static Path GetUserHomeDirectory();
|
||||||
|
|
||||||
/// Return the suffix commonly used on file names that contain a shared
|
/// Return the suffix commonly used on file names that contain a shared
|
||||||
/// object, shared archive, or dynamic link library. Such files are
|
/// object, shared archive, or dynamic link library. Such files are
|
||||||
/// linked at runtime into a process and their code images are shared
|
/// linked at runtime into a process and their code images are shared
|
||||||
/// between processes.
|
/// between processes.
|
||||||
/// @returns The dynamic link library suffix for the current platform.
|
/// @returns The dynamic link library suffix for the current platform.
|
||||||
/// @brief Return the dynamic link library suffix.
|
/// @brief Return the dynamic link library suffix.
|
||||||
static std::string GetDLLSuffix();
|
static std::string GetDLLSuffix();
|
||||||
@ -201,8 +201,8 @@ namespace sys {
|
|||||||
/// @returns true if \p this path is lexicographically less than \p that.
|
/// @returns true if \p this path is lexicographically less than \p that.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @brief Less Than Operator
|
/// @brief Less Than Operator
|
||||||
bool operator< (const Path& that) const {
|
bool operator< (const Path& that) const {
|
||||||
return 0 > path.compare( that.path );
|
return 0 > path.compare( that.path );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
@ -213,8 +213,8 @@ namespace sys {
|
|||||||
/// determine if the current value of \p this is a syntactically valid
|
/// determine if the current value of \p this is a syntactically valid
|
||||||
/// path name for the operating system. The path name does not need to
|
/// path name for the operating system. The path name does not need to
|
||||||
/// exist, validity is simply syntactical. Empty paths are always invalid.
|
/// exist, validity is simply syntactical. Empty paths are always invalid.
|
||||||
/// @returns true iff the path name is syntactically legal for the
|
/// @returns true iff the path name is syntactically legal for the
|
||||||
/// host operating system.
|
/// host operating system.
|
||||||
/// @brief Determine if a path is syntactically valid or not.
|
/// @brief Determine if a path is syntactically valid or not.
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
@ -244,12 +244,12 @@ namespace sys {
|
|||||||
/// This function determines if the path name in this object references
|
/// This function determines if the path name in this object references
|
||||||
/// the root (top level directory) of the file system. The details of what
|
/// the root (top level directory) of the file system. The details of what
|
||||||
/// is considered the "root" may vary from system to system so this method
|
/// is considered the "root" may vary from system to system so this method
|
||||||
/// will do the necessary checking.
|
/// will do the necessary checking.
|
||||||
/// @returns true iff the path name references the root directory.
|
/// @returns true iff the path name references the root directory.
|
||||||
/// @brief Determines if the path references the root directory.
|
/// @brief Determines if the path references the root directory.
|
||||||
bool isRootDirectory() const;
|
bool isRootDirectory() const;
|
||||||
|
|
||||||
/// This function opens the file associated with the path name provided by
|
/// This function opens the file associated with the path name provided by
|
||||||
/// the Path object and reads its magic number. If the magic number at the
|
/// the Path object and reads its magic number. If the magic number at the
|
||||||
/// start of the file matches \p magic, true is returned. In all other
|
/// start of the file matches \p magic, true is returned. In all other
|
||||||
/// cases (file not found, file not accessible, etc.) it returns false.
|
/// cases (file not found, file not accessible, etc.) it returns false.
|
||||||
@ -274,7 +274,7 @@ namespace sys {
|
|||||||
|
|
||||||
/// This function determines if the path name in the object references an
|
/// This function determines if the path name in the object references an
|
||||||
/// LLVM Bytecode file by looking at its magic number.
|
/// LLVM Bytecode file by looking at its magic number.
|
||||||
/// @returns true if the file starts with the magic number for LLVM
|
/// @returns true if the file starts with the magic number for LLVM
|
||||||
/// bytecode files.
|
/// bytecode files.
|
||||||
/// @brief Determine if the path references a bytecode file.
|
/// @brief Determine if the path references a bytecode file.
|
||||||
bool isBytecodeFile() const;
|
bool isBytecodeFile() const;
|
||||||
@ -282,7 +282,7 @@ namespace sys {
|
|||||||
/// This function determines if the path name in the object references a
|
/// This function determines if the path name in the object references a
|
||||||
/// native Dynamic Library (shared library, shared object) by looking at
|
/// native Dynamic Library (shared library, shared object) by looking at
|
||||||
/// the file's magic number. The Path object must reference a file, not a
|
/// the file's magic number. The Path object must reference a file, not a
|
||||||
/// directory.
|
/// directory.
|
||||||
/// @return strue if the file starts with the magid number for a native
|
/// @return strue if the file starts with the magid number for a native
|
||||||
/// shared library.
|
/// shared library.
|
||||||
/// @brief Determine if the path reference a dynamic library.
|
/// @brief Determine if the path reference a dynamic library.
|
||||||
@ -297,7 +297,7 @@ namespace sys {
|
|||||||
bool exists() const;
|
bool exists() const;
|
||||||
|
|
||||||
/// This function determines if the path name references a readable file
|
/// This function determines if the path name references a readable file
|
||||||
/// or directory in the file system. Unlike isFile and isDirectory, this
|
/// or directory in the file system. Unlike isFile and isDirectory, this
|
||||||
/// function actually checks for the existence and readability (by the
|
/// function actually checks for the existence and readability (by the
|
||||||
/// current program) of the file or directory.
|
/// current program) of the file or directory.
|
||||||
/// @returns true if the pathname references a readable file.
|
/// @returns true if the pathname references a readable file.
|
||||||
@ -306,7 +306,7 @@ namespace sys {
|
|||||||
bool readable() const;
|
bool readable() const;
|
||||||
|
|
||||||
/// This function determines if the path name references a writable file
|
/// This function determines if the path name references a writable file
|
||||||
/// or directory in the file system. Unlike isFile and isDirectory, this
|
/// or directory in the file system. Unlike isFile and isDirectory, this
|
||||||
/// function actually checks for the existence and writability (by the
|
/// function actually checks for the existence and writability (by the
|
||||||
/// current program) of the file or directory.
|
/// current program) of the file or directory.
|
||||||
/// @returns true if the pathname references a writable file.
|
/// @returns true if the pathname references a writable file.
|
||||||
@ -314,12 +314,12 @@ namespace sys {
|
|||||||
/// in the file system.
|
/// in the file system.
|
||||||
bool writable() const;
|
bool writable() const;
|
||||||
|
|
||||||
/// This function determines if the path name references an executable
|
/// This function determines if the path name references an executable
|
||||||
/// file in the file system. Unlike isFile and isDirectory, this
|
/// file in the file system. Unlike isFile and isDirectory, this
|
||||||
/// function actually checks for the existence and executability (by
|
/// function actually checks for the existence and executability (by
|
||||||
/// the current program) of the file.
|
/// the current program) of the file.
|
||||||
/// @returns true if the pathname references an executable file.
|
/// @returns true if the pathname references an executable file.
|
||||||
/// @brief Determines if the path is an executable file in the file
|
/// @brief Determines if the path is an executable file in the file
|
||||||
/// system.
|
/// system.
|
||||||
bool executable() const;
|
bool executable() const;
|
||||||
|
|
||||||
@ -353,26 +353,26 @@ namespace sys {
|
|||||||
/// @brief Build a list of directory's contents.
|
/// @brief Build a list of directory's contents.
|
||||||
bool getDirectoryContents(std::set<Path>& paths) const;
|
bool getDirectoryContents(std::set<Path>& paths) const;
|
||||||
|
|
||||||
/// This method attempts to destroy the directory named by the last in
|
/// This method attempts to destroy the directory named by the last in
|
||||||
/// the Path name. If \p remove_contents is false, an attempt will be
|
/// the Path name. If \p remove_contents is false, an attempt will be
|
||||||
/// made to remove just the directory that this Path object refers to
|
/// made to remove just the directory that this Path object refers to
|
||||||
/// (the final Path component). If \p remove_contents is true, an attempt
|
/// (the final Path component). If \p remove_contents is true, an attempt
|
||||||
/// will be made to remove the entire contents of the directory,
|
/// will be made to remove the entire contents of the directory,
|
||||||
/// recursively.
|
/// recursively.
|
||||||
/// @param destroy_contents Indicates whether the contents of a destroyed
|
/// @param destroy_contents Indicates whether the contents of a destroyed
|
||||||
/// directory should also be destroyed (recursively).
|
/// directory should also be destroyed (recursively).
|
||||||
/// @returns false if the Path does not refer to a directory, true
|
/// @returns false if the Path does not refer to a directory, true
|
||||||
/// otherwise.
|
/// otherwise.
|
||||||
/// @throws std::string if there is an error.
|
/// @throws std::string if there is an error.
|
||||||
/// @brief Removes the file or directory from the filesystem.
|
/// @brief Removes the file or directory from the filesystem.
|
||||||
bool destroyDirectory( bool destroy_contents = false ) const;
|
bool destroyDirectory( bool destroy_contents = false ) const;
|
||||||
|
|
||||||
/// This method attempts to destroy the file named by the last item in the
|
/// This method attempts to destroy the file named by the last item in the
|
||||||
/// Path name.
|
/// Path name.
|
||||||
/// @returns false if the Path does not refer to a file, true otherwise.
|
/// @returns false if the Path does not refer to a file, true otherwise.
|
||||||
/// @throws std::string if there is an error.
|
/// @throws std::string if there is an error.
|
||||||
/// @brief Destroy the file this Path refers to.
|
/// @brief Destroy the file this Path refers to.
|
||||||
bool destroyFile() const;
|
bool destroyFile() const;
|
||||||
|
|
||||||
/// Obtain a 'C' string for the path name.
|
/// Obtain a 'C' string for the path name.
|
||||||
/// @returns a 'C' string containing the path name.
|
/// @returns a 'C' string containing the path name.
|
||||||
@ -385,20 +385,20 @@ namespace sys {
|
|||||||
public:
|
public:
|
||||||
/// The path name is cleared and becomes empty. This is an invalid
|
/// The path name is cleared and becomes empty. This is an invalid
|
||||||
/// path name but is the *only* invalid path name. This is provided
|
/// path name but is the *only* invalid path name. This is provided
|
||||||
/// so that path objects can be used to indicate the lack of a
|
/// so that path objects can be used to indicate the lack of a
|
||||||
/// valid path being found.
|
/// valid path being found.
|
||||||
void clear() { path.clear(); }
|
void clear() { path.clear(); }
|
||||||
|
|
||||||
/// This function returns status information about the file. The type of
|
/// This function returns status information about the file. The type of
|
||||||
/// path (file or directory) is updated to reflect the actual contents
|
/// path (file or directory) is updated to reflect the actual contents
|
||||||
/// of the file system. If the file does not exist, false is returned.
|
/// of the file system. If the file does not exist, false is returned.
|
||||||
/// For other (hard I/O) errors, a std::string is throwing indicating the
|
/// For other (hard I/O) errors, a std::string is throwing indicating the
|
||||||
/// problem.
|
/// problem.
|
||||||
/// @throws std::string if an error occurs.
|
/// @throws std::string if an error occurs.
|
||||||
/// @brief Get file status.
|
/// @brief Get file status.
|
||||||
void getStatusInfo(StatusInfo& info) const;
|
void getStatusInfo(StatusInfo& info) const;
|
||||||
|
|
||||||
/// This function returns the last modified time stamp for the file
|
/// This function returns the last modified time stamp for the file
|
||||||
/// referenced by this path. The Path may reference a file or a directory.
|
/// referenced by this path. The Path may reference a file or a directory.
|
||||||
/// If the file does not exist, a ZeroTime timestamp is returned.
|
/// If the file does not exist, a ZeroTime timestamp is returned.
|
||||||
/// @returns last modified timestamp of the file/directory or ZeroTime
|
/// @returns last modified timestamp of the file/directory or ZeroTime
|
||||||
@ -407,7 +407,7 @@ namespace sys {
|
|||||||
StatusInfo info; getStatusInfo(info); return info.modTime;
|
StatusInfo info; getStatusInfo(info); return info.modTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This function returns the size of the file referenced by this path.
|
/// This function returns the size of the file referenced by this path.
|
||||||
/// @brief Get file size.
|
/// @brief Get file size.
|
||||||
inline size_t getSize() const {
|
inline size_t getSize() const {
|
||||||
StatusInfo info; getStatusInfo(info); return info.fileSize;
|
StatusInfo info; getStatusInfo(info); return info.fileSize;
|
||||||
@ -424,14 +424,14 @@ namespace sys {
|
|||||||
void makeWriteable();
|
void makeWriteable();
|
||||||
|
|
||||||
/// This method attempts to make the file referenced by the Path object
|
/// This method attempts to make the file referenced by the Path object
|
||||||
/// available for execution so that the executable() method will return
|
/// available for execution so that the executable() method will return
|
||||||
/// true.
|
/// true.
|
||||||
/// @brief Make the file readable;
|
/// @brief Make the file readable;
|
||||||
void makeExecutable();
|
void makeExecutable();
|
||||||
|
|
||||||
/// This method attempts to set the Path object to \p unverified_path
|
/// This method attempts to set the Path object to \p unverified_path
|
||||||
/// and interpret the name as a directory name. The \p unverified_path
|
/// and interpret the name as a directory name. The \p unverified_path
|
||||||
/// is verified. If verification succeeds then \p unverified_path
|
/// is verified. If verification succeeds then \p unverified_path
|
||||||
/// is accepted as a directory and true is returned. Otherwise,
|
/// is accepted as a directory and true is returned. Otherwise,
|
||||||
/// the Path object remains unchanged and false is returned.
|
/// the Path object remains unchanged and false is returned.
|
||||||
/// @returns true if the path was set, false otherwise.
|
/// @returns true if the path was set, false otherwise.
|
||||||
@ -441,8 +441,8 @@ namespace sys {
|
|||||||
bool setDirectory(const std::string& unverified_path);
|
bool setDirectory(const std::string& unverified_path);
|
||||||
|
|
||||||
/// This method attempts to set the Path object to \p unverified_path
|
/// This method attempts to set the Path object to \p unverified_path
|
||||||
/// and interpret the name as a file name. The \p unverified_path
|
/// and interpret the name as a file name. The \p unverified_path
|
||||||
/// is verified. If verification succeeds then \p unverified_path
|
/// is verified. If verification succeeds then \p unverified_path
|
||||||
/// is accepted as a file name and true is returned. Otherwise,
|
/// is accepted as a file name and true is returned. Otherwise,
|
||||||
/// the Path object remains unchanged and false is returned.
|
/// the Path object remains unchanged and false is returned.
|
||||||
/// @returns true if the path was set, false otherwise.
|
/// @returns true if the path was set, false otherwise.
|
||||||
@ -452,7 +452,7 @@ namespace sys {
|
|||||||
bool setFile(const std::string& unverified_path);
|
bool setFile(const std::string& unverified_path);
|
||||||
|
|
||||||
/// The \p dirname is added to the end of the Path if it is a legal
|
/// The \p dirname is added to the end of the Path if it is a legal
|
||||||
/// directory name for the operating system. The precondition for this
|
/// directory name for the operating system. The precondition for this
|
||||||
/// function is that the Path must reference a directory name (i.e.
|
/// function is that the Path must reference a directory name (i.e.
|
||||||
/// isDirectory() returns true).
|
/// isDirectory() returns true).
|
||||||
/// @param dirname A string providing the directory name to
|
/// @param dirname A string providing the directory name to
|
||||||
@ -464,7 +464,7 @@ namespace sys {
|
|||||||
|
|
||||||
/// One directory component is removed from the Path name. The Path must
|
/// One directory component is removed from the Path name. The Path must
|
||||||
/// refer to a non-root directory name (i.e. isDirectory() returns true
|
/// refer to a non-root directory name (i.e. isDirectory() returns true
|
||||||
/// but isRootDirectory() returns false). Upon exit, the Path will
|
/// but isRootDirectory() returns false). Upon exit, the Path will
|
||||||
/// refer to the directory above it.
|
/// refer to the directory above it.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @returns false if the directory name could not be removed.
|
/// @returns false if the directory name could not be removed.
|
||||||
@ -473,7 +473,7 @@ namespace sys {
|
|||||||
|
|
||||||
/// The \p filename is added to the end of the Path if it is a legal
|
/// The \p filename is added to the end of the Path if it is a legal
|
||||||
/// directory name for the operating system. The precondition for this
|
/// directory name for the operating system. The precondition for this
|
||||||
/// function is that the Path reference a directory name (i.e.
|
/// function is that the Path reference a directory name (i.e.
|
||||||
/// isDirectory() returns true).
|
/// isDirectory() returns true).
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @returns false if the file name could not be added.
|
/// @returns false if the file name could not be added.
|
||||||
@ -481,7 +481,7 @@ namespace sys {
|
|||||||
bool appendFile( const std::string& filename );
|
bool appendFile( const std::string& filename );
|
||||||
|
|
||||||
/// One file component is removed from the Path name. The Path must
|
/// One file component is removed from the Path name. The Path must
|
||||||
/// refer to a file (i.e. isFile() returns true). Upon exit,
|
/// refer to a file (i.e. isFile() returns true). Upon exit,
|
||||||
/// the Path will refer to the directory above it.
|
/// the Path will refer to the directory above it.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @returns false if the file name could not be removed
|
/// @returns false if the file name could not be removed
|
||||||
@ -490,19 +490,19 @@ namespace sys {
|
|||||||
|
|
||||||
/// A period and the \p suffix are appended to the end of the pathname.
|
/// A period and the \p suffix are appended to the end of the pathname.
|
||||||
/// The precondition for this function is that the Path reference a file
|
/// The precondition for this function is that the Path reference a file
|
||||||
/// name (i.e. isFile() returns true). If the Path is not a file, no
|
/// name (i.e. isFile() returns true). If the Path is not a file, no
|
||||||
/// action is taken and the function returns false. If the path would
|
/// action is taken and the function returns false. If the path would
|
||||||
/// become invalid for the host operating system, false is returned.
|
/// become invalid for the host operating system, false is returned.
|
||||||
/// @returns false if the suffix could not be added, true if it was.
|
/// @returns false if the suffix could not be added, true if it was.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @brief Adds a period and the \p suffix to the end of the pathname.
|
/// @brief Adds a period and the \p suffix to the end of the pathname.
|
||||||
bool appendSuffix(const std::string& suffix);
|
bool appendSuffix(const std::string& suffix);
|
||||||
|
|
||||||
/// The suffix of the filename is removed. The suffix begins with and
|
/// The suffix of the filename is removed. The suffix begins with and
|
||||||
/// includes the last . character in the filename after the last directory
|
/// includes the last . character in the filename after the last directory
|
||||||
/// separator and extends until the end of the name. If no . character is
|
/// separator and extends until the end of the name. If no . character is
|
||||||
/// after the last directory separator, then the file name is left
|
/// after the last directory separator, then the file name is left
|
||||||
/// unchanged (i.e. it was already without a suffix) but the function
|
/// unchanged (i.e. it was already without a suffix) but the function
|
||||||
/// returns false.
|
/// returns false.
|
||||||
/// @returns false if there was no suffix to remove, true otherwise.
|
/// @returns false if there was no suffix to remove, true otherwise.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
@ -510,9 +510,9 @@ namespace sys {
|
|||||||
bool elideSuffix();
|
bool elideSuffix();
|
||||||
|
|
||||||
/// The current Path name is made unique in the file system. Upon return,
|
/// The current Path name is made unique in the file system. Upon return,
|
||||||
/// the Path will have been changed to make a unique file in the file
|
/// the Path will have been changed to make a unique file in the file
|
||||||
/// system or it will not have been changed if the current path name is
|
/// system or it will not have been changed if the current path name is
|
||||||
/// already unique.
|
/// already unique.
|
||||||
/// @throws std::string if an unrecoverable error occurs.
|
/// @throws std::string if an unrecoverable error occurs.
|
||||||
/// @brief Make the current path name unique in the file system.
|
/// @brief Make the current path name unique in the file system.
|
||||||
void makeUnique( bool reuse_current = true );
|
void makeUnique( bool reuse_current = true );
|
||||||
@ -522,9 +522,9 @@ namespace sys {
|
|||||||
/// whether intermediate directories are created or not. if \p
|
/// whether intermediate directories are created or not. if \p
|
||||||
/// create_parents is true, then an attempt will be made to create all
|
/// create_parents is true, then an attempt will be made to create all
|
||||||
/// intermediate directories. If \p create_parents is false, then only the
|
/// intermediate directories. If \p create_parents is false, then only the
|
||||||
/// final directory component of the Path name will be created. The
|
/// final directory component of the Path name will be created. The
|
||||||
/// created directory will have no entries.
|
/// created directory will have no entries.
|
||||||
/// @returns false if the Path does not reference a directory, true
|
/// @returns false if the Path does not reference a directory, true
|
||||||
/// otherwise.
|
/// otherwise.
|
||||||
/// @param create_parents Determines whether non-existent directory
|
/// @param create_parents Determines whether non-existent directory
|
||||||
/// components other than the last one (the "parents") are created or not.
|
/// components other than the last one (the "parents") are created or not.
|
||||||
@ -534,7 +534,7 @@ namespace sys {
|
|||||||
|
|
||||||
/// This method attempts to create a file in the file system with the same
|
/// This method attempts to create a file in the file system with the same
|
||||||
/// name as the Path object. The intermediate directories must all exist
|
/// name as the Path object. The intermediate directories must all exist
|
||||||
/// at the time this method is called. Use createDirectories to
|
/// at the time this method is called. Use createDirectories to
|
||||||
/// accomplish that. The created file will be empty upon return from this
|
/// accomplish that. The created file will be empty upon return from this
|
||||||
/// function.
|
/// function.
|
||||||
/// @returns false if the Path does not reference a file, true otherwise.
|
/// @returns false if the Path does not reference a file, true otherwise.
|
||||||
@ -542,8 +542,8 @@ namespace sys {
|
|||||||
/// @brief Create the file this Path refers to.
|
/// @brief Create the file this Path refers to.
|
||||||
bool createFile();
|
bool createFile();
|
||||||
|
|
||||||
/// This is like createFile except that it creates a temporary file. A
|
/// This is like createFile except that it creates a temporary file. A
|
||||||
/// unique temporary file name is generated based on the contents of
|
/// unique temporary file name is generated based on the contents of
|
||||||
/// \p this before the call. The new name is assigned to \p this and the
|
/// \p this before the call. The new name is assigned to \p this and the
|
||||||
/// file is created. Note that this will both change the Path object
|
/// file is created. Note that this will both change the Path object
|
||||||
/// *and* create the corresponding file. This function will ensure that
|
/// *and* create the corresponding file. This function will ensure that
|
||||||
@ -561,7 +561,7 @@ namespace sys {
|
|||||||
bool renameFile(const Path& newName);
|
bool renameFile(const Path& newName);
|
||||||
|
|
||||||
/// This method sets the access time, modification time, and permission
|
/// This method sets the access time, modification time, and permission
|
||||||
/// mode of the file associated with \p this as given by \p si.
|
/// mode of the file associated with \p this as given by \p si.
|
||||||
/// @returns false if the Path does not refer to a file, true otherwise.
|
/// @returns false if the Path does not refer to a file, true otherwise.
|
||||||
/// @throws std::string if the file could not be modified
|
/// @throws std::string if the file could not be modified
|
||||||
/// @brief Set file times and mode.
|
/// @brief Set file times and mode.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/Process.h ------------------------------------*- C++ -*-===//
|
//===- llvm/System/Process.h ------------------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the llvm::sys::Process class.
|
// This file declares the llvm::sys::Process class.
|
||||||
@ -20,7 +20,7 @@ namespace llvm {
|
|||||||
namespace sys {
|
namespace sys {
|
||||||
|
|
||||||
/// This class provides an abstraction for getting information about the
|
/// This class provides an abstraction for getting information about the
|
||||||
/// currently executing process.
|
/// currently executing process.
|
||||||
/// @since 1.4
|
/// @since 1.4
|
||||||
/// @brief An abstraction for operating system processes.
|
/// @brief An abstraction for operating system processes.
|
||||||
class Process {
|
class Process {
|
||||||
@ -36,20 +36,20 @@ namespace sys {
|
|||||||
|
|
||||||
/// This static function will return the total amount of memory allocated
|
/// This static function will return the total amount of memory allocated
|
||||||
/// by the process. This only counts the memory allocated via the malloc,
|
/// by the process. This only counts the memory allocated via the malloc,
|
||||||
/// calloc and realloc functions and includes any "free" holes in the
|
/// calloc and realloc functions and includes any "free" holes in the
|
||||||
/// allocated space.
|
/// allocated space.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
/// @brief Return process memory usage.
|
/// @brief Return process memory usage.
|
||||||
static size_t GetMallocUsage();
|
static size_t GetMallocUsage();
|
||||||
|
|
||||||
/// This static function will return the total memory usage of the
|
/// This static function will return the total memory usage of the
|
||||||
/// process. This includes code, data, stack and mapped pages usage. Notei
|
/// process. This includes code, data, stack and mapped pages usage. Notei
|
||||||
/// that the value returned here is not necessarily the Running Set Size,
|
/// that the value returned here is not necessarily the Running Set Size,
|
||||||
/// it is the total virtual memory usage, regardless of mapped state of
|
/// it is the total virtual memory usage, regardless of mapped state of
|
||||||
/// that memory.
|
/// that memory.
|
||||||
static size_t GetTotalMemoryUsage();
|
static size_t GetTotalMemoryUsage();
|
||||||
|
|
||||||
/// This static function will set \p user_time to the amount of CPU time
|
/// This static function will set \p user_time to the amount of CPU time
|
||||||
/// spent in user (non-kernel) mode and \p sys_time to the amount of CPU
|
/// spent in user (non-kernel) mode and \p sys_time to the amount of CPU
|
||||||
/// time spent in system (kernel) mode. If the operating system does not
|
/// time spent in system (kernel) mode. If the operating system does not
|
||||||
/// support collection of these metrics, a zero TimeValue will be for both
|
/// support collection of these metrics, a zero TimeValue will be for both
|
||||||
@ -57,24 +57,24 @@ namespace sys {
|
|||||||
static void GetTimeUsage(
|
static void GetTimeUsage(
|
||||||
TimeValue& elapsed,
|
TimeValue& elapsed,
|
||||||
///< Returns the TimeValue::now() giving current time
|
///< Returns the TimeValue::now() giving current time
|
||||||
TimeValue& user_time,
|
TimeValue& user_time,
|
||||||
///< Returns the current amount of user time for the process
|
///< Returns the current amount of user time for the process
|
||||||
TimeValue& sys_time
|
TimeValue& sys_time
|
||||||
///< Returns the current amount of system time for the process
|
///< Returns the current amount of system time for the process
|
||||||
);
|
);
|
||||||
|
|
||||||
/// This static function will return the process' current user id number.
|
/// This static function will return the process' current user id number.
|
||||||
/// Not all operating systems support this feature. Where it is not
|
/// Not all operating systems support this feature. Where it is not
|
||||||
/// supported, the function should return 65536 as the value.
|
/// supported, the function should return 65536 as the value.
|
||||||
static int GetCurrentUserId();
|
static int GetCurrentUserId();
|
||||||
|
|
||||||
/// This static function will return the process' current group id number.
|
/// This static function will return the process' current group id number.
|
||||||
/// Not all operating systems support this feature. Where it is not
|
/// Not all operating systems support this feature. Where it is not
|
||||||
/// supported, the function should return 65536 as the value.
|
/// supported, the function should return 65536 as the value.
|
||||||
static int GetCurrentGroupId();
|
static int GetCurrentGroupId();
|
||||||
|
|
||||||
/// This function makes the necessary calls to the operating system to
|
/// This function makes the necessary calls to the operating system to
|
||||||
/// prevent core files or any other kind of large memory dumps that can
|
/// prevent core files or any other kind of large memory dumps that can
|
||||||
/// occur when a program fails.
|
/// occur when a program fails.
|
||||||
/// @brief Prevent core file generation.
|
/// @brief Prevent core file generation.
|
||||||
static void PreventCoreFiles();
|
static void PreventCoreFiles();
|
||||||
@ -84,12 +84,12 @@ namespace sys {
|
|||||||
/// or pipe.
|
/// or pipe.
|
||||||
static bool StandardInIsUserInput();
|
static bool StandardInIsUserInput();
|
||||||
|
|
||||||
/// This function determines if the standard output is connected to a
|
/// This function determines if the standard output is connected to a
|
||||||
/// "tty" or "console" window. That is, the output would be displayed to
|
/// "tty" or "console" window. That is, the output would be displayed to
|
||||||
/// the user rather than being put on a pipe or stored in a file.
|
/// the user rather than being put on a pipe or stored in a file.
|
||||||
static bool StandardOutIsDisplayed();
|
static bool StandardOutIsDisplayed();
|
||||||
|
|
||||||
/// This function determines if the standard error is connected to a
|
/// This function determines if the standard error is connected to a
|
||||||
/// "tty" or "console" window. That is, the output would be displayed to
|
/// "tty" or "console" window. That is, the output would be displayed to
|
||||||
/// the user rather than being put on a pipe or stored in a file.
|
/// the user rather than being put on a pipe or stored in a file.
|
||||||
static bool StandardErrIsDisplayed();
|
static bool StandardErrIsDisplayed();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/Program.h ------------------------------------*- C++ -*-===//
|
//===- llvm/System/Program.h ------------------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file declares the llvm::sys::Program class.
|
// This file declares the llvm::sys::Program class.
|
||||||
@ -31,8 +31,8 @@ namespace sys {
|
|||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
/// This static constructor (factory) will attempt to locate a program in
|
/// This static constructor (factory) will attempt to locate a program in
|
||||||
/// the operating system's file system using some pre-determined set of
|
/// the operating system's file system using some pre-determined set of
|
||||||
/// locations to search (e.g. the PATH on Unix).
|
/// locations to search (e.g. the PATH on Unix).
|
||||||
/// @returns A Path object initialized to the path of the program or a
|
/// @returns A Path object initialized to the path of the program or a
|
||||||
/// Path object that is empty (invalid) if the program could not be found.
|
/// Path object that is empty (invalid) if the program could not be found.
|
||||||
/// @throws nothing
|
/// @throws nothing
|
||||||
@ -41,11 +41,11 @@ namespace sys {
|
|||||||
|
|
||||||
/// This function executes the program using the \p arguments provided and
|
/// This function executes the program using the \p arguments provided and
|
||||||
/// waits for the program to exit. This function will block the current
|
/// waits for the program to exit. This function will block the current
|
||||||
/// program until the invoked program exits. The invoked program will
|
/// program until the invoked program exits. The invoked program will
|
||||||
/// inherit the stdin, stdout, and stderr file descriptors, the
|
/// inherit the stdin, stdout, and stderr file descriptors, the
|
||||||
/// environment and other configuration settings of the invoking program.
|
/// environment and other configuration settings of the invoking program.
|
||||||
/// If Path::executable() does not return true when this function is
|
/// If Path::executable() does not return true when this function is
|
||||||
/// called then a std::string is thrown.
|
/// called then a std::string is thrown.
|
||||||
/// @param path A sys::Path object providing the path of the program to be
|
/// @param path A sys::Path object providing the path of the program to be
|
||||||
/// executed. It is presumed this is the result of the FindProgramByName
|
/// executed. It is presumed this is the result of the FindProgramByName
|
||||||
/// method.
|
/// method.
|
||||||
@ -56,21 +56,21 @@ namespace sys {
|
|||||||
/// @brief Executes the program with the given set of \p args.
|
/// @brief Executes the program with the given set of \p args.
|
||||||
static int ExecuteAndWait(
|
static int ExecuteAndWait(
|
||||||
const Path& path, ///< The path to the program to execute
|
const Path& path, ///< The path to the program to execute
|
||||||
const char** args, ///< A vector of strings that are passed to the
|
const char** args, ///< A vector of strings that are passed to the
|
||||||
///< program. The first element should be the name of the program.
|
///< program. The first element should be the name of the program.
|
||||||
///< The list *must* be terminated by a null char* entry.
|
///< The list *must* be terminated by a null char* entry.
|
||||||
const char ** env = 0, ///< An optional vector of strings to use for
|
const char ** env = 0, ///< An optional vector of strings to use for
|
||||||
///< the program's environment. If not provided, the current program's
|
///< the program's environment. If not provided, the current program's
|
||||||
///< environment will be used.
|
///< environment will be used.
|
||||||
const sys::Path** redirects = 0, ///< An optional array of pointers to
|
const sys::Path** redirects = 0, ///< An optional array of pointers to
|
||||||
///< Paths. If the array is null, no redirection is done. The array
|
///< Paths. If the array is null, no redirection is done. The array
|
||||||
///< should have a size of at least three. If the pointer in the array
|
///< should have a size of at least three. If the pointer in the array
|
||||||
///< are not null, then the inferior process's stdin(0), stdout(1),
|
///< are not null, then the inferior process's stdin(0), stdout(1),
|
||||||
///< and stderr(2) will be redirected to the corresponding Paths.
|
///< and stderr(2) will be redirected to the corresponding Paths.
|
||||||
unsigned secondsToWait = 0 ///< If non-zero, this specifies the amount
|
unsigned secondsToWait = 0 ///< If non-zero, this specifies the amount
|
||||||
///< of time to wait for the child process to exit. If the time
|
///< of time to wait for the child process to exit. If the time
|
||||||
///< expires, the child is killed and this call returns. If zero,
|
///< expires, the child is killed and this call returns. If zero,
|
||||||
///< this function will wait until the child finishes or forever if
|
///< this function will wait until the child finishes or forever if
|
||||||
///< it doesn't.
|
///< it doesn't.
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/Signals.h - Signal Handling support ----------*- C++ -*-===//
|
//===- llvm/System/Signals.h - Signal Handling support ----------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file defines some helpful functions for dealing with the possibility of
|
// This file defines some helpful functions for dealing with the possibility of
|
||||||
@ -20,7 +20,7 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace sys {
|
namespace sys {
|
||||||
|
|
||||||
/// This function registers signal handlers to ensure that if a signal gets
|
/// This function registers signal handlers to ensure that if a signal gets
|
||||||
/// delivered that the named file is removed.
|
/// delivered that the named file is removed.
|
||||||
/// @brief Remove a file if a fatal signal occurs.
|
/// @brief Remove a file if a fatal signal occurs.
|
||||||
void RemoveFileOnSignal(const Path &Filename);
|
void RemoveFileOnSignal(const Path &Filename);
|
||||||
@ -31,7 +31,7 @@ namespace sys {
|
|||||||
/// @brief Remove a directory if a fatal signal occurs.
|
/// @brief Remove a directory if a fatal signal occurs.
|
||||||
void RemoveDirectoryOnSignal(const Path& path);
|
void RemoveDirectoryOnSignal(const Path& path);
|
||||||
|
|
||||||
/// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the
|
/// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the
|
||||||
/// process, print a stack trace and then exit.
|
/// process, print a stack trace and then exit.
|
||||||
/// @brief Print a stack trace if a fatal signal occurs.
|
/// @brief Print a stack trace if a fatal signal occurs.
|
||||||
void PrintStackTraceOnErrorSignal();
|
void PrintStackTraceOnErrorSignal();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- TimeValue.h - Declare OS TimeValue Concept --------------*- C++ -*-===//
|
//===-- TimeValue.h - Declare OS TimeValue Concept --------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by Reid Spencer and is distributed under the
|
// This file was developed by Reid Spencer and is distributed under the
|
||||||
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This header file declares the operating system TimeValue concept.
|
// This header file declares the operating system TimeValue concept.
|
||||||
@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace sys {
|
namespace sys {
|
||||||
/// This class is used where a precise fixed point in time is required. The
|
/// This class is used where a precise fixed point in time is required. The
|
||||||
/// range of TimeValue spans many hundreds of billions of years both past and
|
/// range of TimeValue spans many hundreds of billions of years both past and
|
||||||
/// present. The precision of TimeValue is to the nanosecond. However, the
|
/// present. The precision of TimeValue is to the nanosecond. However, the
|
||||||
/// actual precision of its values will be determined by the resolution of
|
/// actual precision of its values will be determined by the resolution of
|
||||||
/// the system clock. The TimeValue class is used in conjunction with several
|
/// the system clock. The TimeValue class is used in conjunction with several
|
||||||
/// other lib/System interfaces to specify the time at which a call should
|
/// other lib/System interfaces to specify the time at which a call should
|
||||||
/// timeout, etc.
|
/// timeout, etc.
|
||||||
/// @since 1.4
|
/// @since 1.4
|
||||||
/// @brief Provides an abstraction for a fixed point in time.
|
/// @brief Provides an abstraction for a fixed point in time.
|
||||||
@ -82,9 +82,9 @@ namespace sys {
|
|||||||
/// @name Constructors
|
/// @name Constructors
|
||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
/// Caller provides the exact value in seconds and nanoseconds. The
|
/// Caller provides the exact value in seconds and nanoseconds. The
|
||||||
/// \p nanos argument defaults to zero for convenience.
|
/// \p nanos argument defaults to zero for convenience.
|
||||||
/// @brief Explicit constructor
|
/// @brief Explicit constructor
|
||||||
explicit TimeValue (SecondsType seconds, NanoSecondsType nanos = 0)
|
explicit TimeValue (SecondsType seconds, NanoSecondsType nanos = 0)
|
||||||
: seconds_( seconds ), nanos_( nanos ) { this->normalize(); }
|
: seconds_( seconds ), nanos_( nanos ) { this->normalize(); }
|
||||||
|
|
||||||
@ -92,10 +92,10 @@ namespace sys {
|
|||||||
/// fractional part representing nanoseconds.
|
/// fractional part representing nanoseconds.
|
||||||
/// @brief Double Constructor.
|
/// @brief Double Constructor.
|
||||||
explicit TimeValue( double new_time )
|
explicit TimeValue( double new_time )
|
||||||
: seconds_( 0 ) , nanos_ ( 0 ) {
|
: seconds_( 0 ) , nanos_ ( 0 ) {
|
||||||
SecondsType integer_part = static_cast<SecondsType>( new_time );
|
SecondsType integer_part = static_cast<SecondsType>( new_time );
|
||||||
seconds_ = integer_part;
|
seconds_ = integer_part;
|
||||||
nanos_ = static_cast<NanoSecondsType>( (new_time -
|
nanos_ = static_cast<NanoSecondsType>( (new_time -
|
||||||
static_cast<double>(integer_part)) * NANOSECONDS_PER_SECOND );
|
static_cast<double>(integer_part)) * NANOSECONDS_PER_SECOND );
|
||||||
this->normalize();
|
this->normalize();
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ namespace sys {
|
|||||||
/// @brief True iff *this == that.
|
/// @brief True iff *this == that.
|
||||||
/// @brief True if this == that.
|
/// @brief True if this == that.
|
||||||
int operator == (const TimeValue &that) const {
|
int operator == (const TimeValue &that) const {
|
||||||
return (this->seconds_ == that.seconds_) &&
|
return (this->seconds_ == that.seconds_) &&
|
||||||
(this->nanos_ == that.nanos_);
|
(this->nanos_ == that.nanos_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,14 +198,14 @@ namespace sys {
|
|||||||
SecondsType seconds() const { return seconds_; }
|
SecondsType seconds() const { return seconds_; }
|
||||||
|
|
||||||
/// Returns only the nanoseconds component of the TimeValue. The seconds
|
/// Returns only the nanoseconds component of the TimeValue. The seconds
|
||||||
/// portion is ignored.
|
/// portion is ignored.
|
||||||
/// @brief Retrieve the nanoseconds component.
|
/// @brief Retrieve the nanoseconds component.
|
||||||
NanoSecondsType nanoseconds() const { return nanos_; }
|
NanoSecondsType nanoseconds() const { return nanos_; }
|
||||||
|
|
||||||
/// Returns only the fractional portion of the TimeValue rounded down to the
|
/// Returns only the fractional portion of the TimeValue rounded down to the
|
||||||
/// nearest microsecond (divide by one thousand).
|
/// nearest microsecond (divide by one thousand).
|
||||||
/// @brief Retrieve the fractional part as microseconds;
|
/// @brief Retrieve the fractional part as microseconds;
|
||||||
uint32_t microseconds() const {
|
uint32_t microseconds() const {
|
||||||
return nanos_ / NANOSECONDS_PER_MICROSECOND;
|
return nanos_ / NANOSECONDS_PER_MICROSECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,17 +222,17 @@ namespace sys {
|
|||||||
/// systems and is therefore provided.
|
/// systems and is therefore provided.
|
||||||
/// @brief Convert to a number of microseconds (can overflow)
|
/// @brief Convert to a number of microseconds (can overflow)
|
||||||
uint64_t usec() const {
|
uint64_t usec() const {
|
||||||
return seconds_ * MICROSECONDS_PER_SECOND +
|
return seconds_ * MICROSECONDS_PER_SECOND +
|
||||||
( nanos_ / NANOSECONDS_PER_MICROSECOND );
|
( nanos_ / NANOSECONDS_PER_MICROSECOND );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the TimeValue as a number of milliseconds. Note that the value
|
/// Returns the TimeValue as a number of milliseconds. Note that the value
|
||||||
/// returned can overflow because the range of a uint64_t is smaller than
|
/// returned can overflow because the range of a uint64_t is smaller than
|
||||||
/// the range of a TimeValue. Nevertheless, this is useful on some operating
|
/// the range of a TimeValue. Nevertheless, this is useful on some operating
|
||||||
/// systems and is therefore provided.
|
/// systems and is therefore provided.
|
||||||
/// @brief Convert to a number of milliseconds (can overflow)
|
/// @brief Convert to a number of milliseconds (can overflow)
|
||||||
uint64_t msec() const {
|
uint64_t msec() const {
|
||||||
return seconds_ * MILLISECONDS_PER_SECOND +
|
return seconds_ * MILLISECONDS_PER_SECOND +
|
||||||
( nanos_ / NANOSECONDS_PER_MILLISECOND );
|
( nanos_ / NANOSECONDS_PER_MILLISECOND );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,8 +245,8 @@ namespace sys {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts the TimeValue into the corresponding number of seconds
|
/// Converts the TimeValue into the corresponding number of seconds
|
||||||
/// since the epoch (00:00:00 Jan 1,1970).
|
/// since the epoch (00:00:00 Jan 1,1970).
|
||||||
uint64_t toEpochTime() const {
|
uint64_t toEpochTime() const {
|
||||||
return seconds_ - PosixZeroTime.seconds_;
|
return seconds_ - PosixZeroTime.seconds_;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ namespace sys {
|
|||||||
/// @brief Converts from microsecond format to TimeValue format
|
/// @brief Converts from microsecond format to TimeValue format
|
||||||
void usec( int64_t microseconds ) {
|
void usec( int64_t microseconds ) {
|
||||||
this->seconds_ = microseconds / MICROSECONDS_PER_SECOND;
|
this->seconds_ = microseconds / MICROSECONDS_PER_SECOND;
|
||||||
this->nanos_ = NanoSecondsType(microseconds % MICROSECONDS_PER_SECOND) *
|
this->nanos_ = NanoSecondsType(microseconds % MICROSECONDS_PER_SECOND) *
|
||||||
NANOSECONDS_PER_MICROSECOND;
|
NANOSECONDS_PER_MICROSECOND;
|
||||||
this->normalize();
|
this->normalize();
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ namespace sys {
|
|||||||
/// @brief Converts from millisecond format to TimeValue format
|
/// @brief Converts from millisecond format to TimeValue format
|
||||||
void msec( int64_t milliseconds ) {
|
void msec( int64_t milliseconds ) {
|
||||||
this->seconds_ = milliseconds / MILLISECONDS_PER_SECOND;
|
this->seconds_ = milliseconds / MILLISECONDS_PER_SECOND;
|
||||||
this->nanos_ = NanoSecondsType(milliseconds % MILLISECONDS_PER_SECOND) *
|
this->nanos_ = NanoSecondsType(milliseconds % MILLISECONDS_PER_SECOND) *
|
||||||
NANOSECONDS_PER_MILLISECOND;
|
NANOSECONDS_PER_MILLISECOND;
|
||||||
this->normalize();
|
this->normalize();
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===-- llvm/Support/ToolRunner.h -------------------------------*- C++ -*-===//
|
//===-- llvm/Support/ToolRunner.h -------------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file was developed by the LLVM research group and is distributed under
|
// 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.
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file exposes an abstraction around a platform C compiler, used to
|
// This file exposes an abstraction around a platform C compiler, used to
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
FileType fileType,
|
FileType fileType,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(), unsigned Timeout = 0);
|
std::vector<std::string>(), unsigned Timeout = 0);
|
||||||
|
|
||||||
/// MakeSharedObject - This compiles the specified file (which is either a .c
|
/// MakeSharedObject - This compiles the specified file (which is either a .c
|
||||||
@ -110,7 +110,7 @@ public:
|
|||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(),
|
std::vector<std::string>(),
|
||||||
unsigned Timeout = 0) = 0;
|
unsigned Timeout = 0) = 0;
|
||||||
};
|
};
|
||||||
@ -140,7 +140,7 @@ public:
|
|||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(),
|
std::vector<std::string>(),
|
||||||
unsigned Timeout = 0);
|
unsigned Timeout = 0);
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ public:
|
|||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const std::string &OutputFile,
|
const std::string &OutputFile,
|
||||||
const std::vector<std::string> &SharedLibs =
|
const std::vector<std::string> &SharedLibs =
|
||||||
std::vector<std::string>(),
|
std::vector<std::string>(),
|
||||||
unsigned Timeout = 0);
|
unsigned Timeout = 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user