Eugene.Zelenko created this revision.
Eugene.Zelenko added reviewers: hans, aaron.ballman.
Eugene.Zelenko added a subscriber: cfe-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Herald added a subscriber: klimek.
Some Include What You Use suggestions were used too.
I checked this patch on my own build on RHEL 6. Regressions were OK.
Repository:
rL LLVM
http://reviews.llvm.org/D18424
Files:
include/clang-c/Index.h
include/clang/Analysis/Analyses/ThreadSafetyTIL.h
include/clang/Basic/Linkage.h
include/clang/Basic/TargetBuiltins.h
lib/CodeGen/CGOpenCLRuntime.cpp
lib/Driver/Types.cpp
lib/Frontend/CodeGenOptions.cpp
lib/Frontend/CompilerInstance.cpp
lib/Lex/HeaderSearch.cpp
lib/Lex/ModuleMap.cpp
lib/Sema/DelayedDiagnostic.cpp
lib/Serialization/ASTWriter.cpp
lib/Tooling/Core/QualTypeNames.cpp
tools/libclang/CIndexDiagnostic.h
Index: lib/Serialization/ASTWriter.cpp
===================================================================
--- lib/Serialization/ASTWriter.cpp
+++ lib/Serialization/ASTWriter.cpp
@@ -58,8 +58,10 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include <algorithm>
-#include <cstdio>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
+#include <deque>
+#include <limits>
#include <utility>
using namespace clang;
@@ -483,6 +485,7 @@
void TypeLocWriter::VisitQualifiedTypeLoc(QualifiedTypeLoc TL) {
// nothing to do
}
+
void TypeLocWriter::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {
Writer.AddSourceLocation(TL.getBuiltinLoc(), Record);
if (TL.needsExtraLocalData()) {
@@ -492,31 +495,40 @@
Record.push_back(TL.hasModeAttr());
}
}
+
void TypeLocWriter::VisitComplexTypeLoc(ComplexTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitPointerTypeLoc(PointerTypeLoc TL) {
Writer.AddSourceLocation(TL.getStarLoc(), Record);
}
+
void TypeLocWriter::VisitDecayedTypeLoc(DecayedTypeLoc TL) {
// nothing to do
}
+
void TypeLocWriter::VisitAdjustedTypeLoc(AdjustedTypeLoc TL) {
// nothing to do
}
+
void TypeLocWriter::VisitBlockPointerTypeLoc(BlockPointerTypeLoc TL) {
Writer.AddSourceLocation(TL.getCaretLoc(), Record);
}
+
void TypeLocWriter::VisitLValueReferenceTypeLoc(LValueReferenceTypeLoc TL) {
Writer.AddSourceLocation(TL.getAmpLoc(), Record);
}
+
void TypeLocWriter::VisitRValueReferenceTypeLoc(RValueReferenceTypeLoc TL) {
Writer.AddSourceLocation(TL.getAmpAmpLoc(), Record);
}
+
void TypeLocWriter::VisitMemberPointerTypeLoc(MemberPointerTypeLoc TL) {
Writer.AddSourceLocation(TL.getStarLoc(), Record);
Writer.AddTypeSourceInfo(TL.getClassTInfo(), Record);
}
+
void TypeLocWriter::VisitArrayTypeLoc(ArrayTypeLoc TL) {
Writer.AddSourceLocation(TL.getLBracketLoc(), Record);
Writer.AddSourceLocation(TL.getRBracketLoc(), Record);
@@ -524,29 +536,37 @@
if (TL.getSizeExpr())
Writer.AddStmt(TL.getSizeExpr());
}
+
void TypeLocWriter::VisitConstantArrayTypeLoc(ConstantArrayTypeLoc TL) {
VisitArrayTypeLoc(TL);
}
+
void TypeLocWriter::VisitIncompleteArrayTypeLoc(IncompleteArrayTypeLoc TL) {
VisitArrayTypeLoc(TL);
}
+
void TypeLocWriter::VisitVariableArrayTypeLoc(VariableArrayTypeLoc TL) {
VisitArrayTypeLoc(TL);
}
+
void TypeLocWriter::VisitDependentSizedArrayTypeLoc(
DependentSizedArrayTypeLoc TL) {
VisitArrayTypeLoc(TL);
}
+
void TypeLocWriter::VisitDependentSizedExtVectorTypeLoc(
DependentSizedExtVectorTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitVectorTypeLoc(VectorTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitExtVectorTypeLoc(ExtVectorTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitFunctionTypeLoc(FunctionTypeLoc TL) {
Writer.AddSourceLocation(TL.getLocalRangeBegin(), Record);
Writer.AddSourceLocation(TL.getLParenLoc(), Record);
@@ -555,47 +575,59 @@
for (unsigned i = 0, e = TL.getNumParams(); i != e; ++i)
Writer.AddDeclRef(TL.getParam(i), Record);
}
+
void TypeLocWriter::VisitFunctionProtoTypeLoc(FunctionProtoTypeLoc TL) {
VisitFunctionTypeLoc(TL);
}
+
void TypeLocWriter::VisitFunctionNoProtoTypeLoc(FunctionNoProtoTypeLoc TL) {
VisitFunctionTypeLoc(TL);
}
+
void TypeLocWriter::VisitUnresolvedUsingTypeLoc(UnresolvedUsingTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitTypedefTypeLoc(TypedefTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL) {
Writer.AddSourceLocation(TL.getTypeofLoc(), Record);
Writer.AddSourceLocation(TL.getLParenLoc(), Record);
Writer.AddSourceLocation(TL.getRParenLoc(), Record);
}
+
void TypeLocWriter::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) {
Writer.AddSourceLocation(TL.getTypeofLoc(), Record);
Writer.AddSourceLocation(TL.getLParenLoc(), Record);
Writer.AddSourceLocation(TL.getRParenLoc(), Record);
Writer.AddTypeSourceInfo(TL.getUnderlyingTInfo(), Record);
}
+
void TypeLocWriter::VisitDecltypeTypeLoc(DecltypeTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL) {
Writer.AddSourceLocation(TL.getKWLoc(), Record);
Writer.AddSourceLocation(TL.getLParenLoc(), Record);
Writer.AddSourceLocation(TL.getRParenLoc(), Record);
Writer.AddTypeSourceInfo(TL.getUnderlyingTInfo(), Record);
}
+
void TypeLocWriter::VisitAutoTypeLoc(AutoTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitRecordTypeLoc(RecordTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitEnumTypeLoc(EnumTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitAttributedTypeLoc(AttributedTypeLoc TL) {
Writer.AddSourceLocation(TL.getAttrNameLoc(), Record);
if (TL.hasAttrOperand()) {
@@ -611,17 +643,21 @@
Writer.AddSourceLocation(TL.getAttrEnumOperandLoc(), Record);
}
}
+
void TypeLocWriter::VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitSubstTemplateTypeParmTypeLoc(
SubstTemplateTypeParmTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitSubstTemplateTypeParmPackTypeLoc(
SubstTemplateTypeParmPackTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitTemplateSpecializationTypeLoc(
TemplateSpecializationTypeLoc TL) {
Writer.AddSourceLocation(TL.getTemplateKeywordLoc(), Record);
@@ -632,22 +668,27 @@
Writer.AddTemplateArgumentLocInfo(TL.getArgLoc(i).getArgument().getKind(),
TL.getArgLoc(i).getLocInfo(), Record);
}
+
void TypeLocWriter::VisitParenTypeLoc(ParenTypeLoc TL) {
Writer.AddSourceLocation(TL.getLParenLoc(), Record);
Writer.AddSourceLocation(TL.getRParenLoc(), Record);
}
+
void TypeLocWriter::VisitElaboratedTypeLoc(ElaboratedTypeLoc TL) {
Writer.AddSourceLocation(TL.getElaboratedKeywordLoc(), Record);
Writer.AddNestedNameSpecifierLoc(TL.getQualifierLoc(), Record);
}
+
void TypeLocWriter::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {
Writer.AddSourceLocation(TL.getElaboratedKeywordLoc(), Record);
Writer.AddNestedNameSpecifierLoc(TL.getQualifierLoc(), Record);
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitDependentTemplateSpecializationTypeLoc(
DependentTemplateSpecializationTypeLoc TL) {
Writer.AddSourceLocation(TL.getElaboratedKeywordLoc(), Record);
@@ -660,12 +701,15 @@
Writer.AddTemplateArgumentLocInfo(TL.getArgLoc(I).getArgument().getKind(),
TL.getArgLoc(I).getLocInfo(), Record);
}
+
void TypeLocWriter::VisitPackExpansionTypeLoc(PackExpansionTypeLoc TL) {
Writer.AddSourceLocation(TL.getEllipsisLoc(), Record);
}
+
void TypeLocWriter::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+
void TypeLocWriter::VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) {
Record.push_back(TL.hasBaseTypeAsWritten());
Writer.AddSourceLocation(TL.getTypeArgsLAngleLoc(), Record);
@@ -677,14 +721,17 @@
for (unsigned i = 0, e = TL.getNumProtocols(); i != e; ++i)
Writer.AddSourceLocation(TL.getProtocolLoc(i), Record);
}
+
void TypeLocWriter::VisitObjCObjectPointerTypeLoc(ObjCObjectPointerTypeLoc TL) {
Writer.AddSourceLocation(TL.getStarLoc(), Record);
}
+
void TypeLocWriter::VisitAtomicTypeLoc(AtomicTypeLoc TL) {
Writer.AddSourceLocation(TL.getKWLoc(), Record);
Writer.AddSourceLocation(TL.getLParenLoc(), Record);
Writer.AddSourceLocation(TL.getRParenLoc(), Record);
}
+
void TypeLocWriter::VisitPipeTypeLoc(PipeTypeLoc TL) {
Writer.AddSourceLocation(TL.getKWLoc(), Record);
}
Index: lib/Tooling/Core/QualTypeNames.cpp
===================================================================
--- lib/Tooling/Core/QualTypeNames.cpp
+++ lib/Tooling/Core/QualTypeNames.cpp
@@ -17,7 +17,8 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
-#include <stdio.h>
+#include <cassert>
+#include <cstdio>
#include <memory>
namespace clang {
Index: lib/CodeGen/CGOpenCLRuntime.cpp
===================================================================
--- lib/CodeGen/CGOpenCLRuntime.cpp
+++ lib/CodeGen/CGOpenCLRuntime.cpp
@@ -17,7 +17,8 @@
#include "CodeGenFunction.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
-#include <assert.h>
+#include <cassert>
+#include <cstdint>
using namespace clang;
using namespace CodeGen;
Index: lib/Driver/Types.cpp
===================================================================
--- lib/Driver/Types.cpp
+++ lib/Driver/Types.cpp
@@ -9,9 +9,10 @@
#include "clang/Driver/Types.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringSwitch.h"
#include <cassert>
-#include <string.h>
+#include <cstring>
using namespace clang::driver;
using namespace clang::driver::types;
Index: lib/Lex/ModuleMap.cpp
===================================================================
--- lib/Lex/ModuleMap.cpp
+++ lib/Lex/ModuleMap.cpp
@@ -11,6 +11,7 @@
// of a module as it relates to headers.
//
//===----------------------------------------------------------------------===//
+
#include "clang/Lex/ModuleMap.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/Diagnostic.h"
@@ -30,10 +31,11 @@
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
-#include <stdlib.h>
-#if defined(LLVM_ON_UNIX)
-#include <limits.h>
-#endif
+#include <algorithm>
+#include <cassert>
+#include <cstring>
+#include <system_error>
+
using namespace clang;
Module::ExportDecl
@@ -669,7 +671,6 @@
} else
ModuleMapFile = getModuleMapFileForUniquing(Parent);
-
// Look for an umbrella header.
SmallString<128> UmbrellaName = StringRef(FrameworkDir->getName());
llvm::sys::path::append(UmbrellaName, "Headers", ModuleName + ".h");
@@ -1088,7 +1089,7 @@
bool parseModuleMapFile();
};
-}
+} // end namespace clang
SourceLocation ModuleMapParser::consumeToken() {
retry:
@@ -1282,7 +1283,7 @@
/// \brief The 'exhaustive' attribute.
AT_exhaustive
};
-}
+} // end anonymous namespaces
/// \brief Parse a module declaration.
///
@@ -1404,7 +1405,6 @@
if (parseOptionalAttributes(Attrs))
return;
-
// Parse the opening brace.
if (!Tok.is(MMToken::LBrace)) {
Diags.Report(Tok.getLocation(), diag::err_mmap_expected_lbrace)
@@ -2251,7 +2251,7 @@
Done = true;
break;
- case MMToken::ExcludeKeyword: {
+ case MMToken::ExcludeKeyword:
if (ActiveModule) {
Diags.Report(Tok.getLocation(), diag::err_mmap_expected_inferred_member)
<< (ActiveModule != nullptr);
@@ -2270,7 +2270,6 @@
.push_back(Tok.getString());
consumeToken();
break;
- }
case MMToken::ExportKeyword:
if (!ActiveModule) {
Index: lib/Lex/HeaderSearch.cpp
===================================================================
--- lib/Lex/HeaderSearch.cpp
+++ lib/Lex/HeaderSearch.cpp
@@ -1,4 +1,4 @@
-//===--- HeaderSearch.cpp - Resolve Header File Locations ---===//
+//===--- HeaderSearch.cpp - Resolve Header File Locations -----------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -27,10 +27,11 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <cassert>
#include <cstdio>
-#if defined(LLVM_ON_UNIX)
-#include <limits.h>
-#endif
+#include <cstring>
+
using namespace clang;
const IdentifierInfo *
@@ -529,7 +530,6 @@
ModMap.setTarget(Target);
}
-
//===----------------------------------------------------------------------===//
// Header File Location.
//===----------------------------------------------------------------------===//
@@ -1296,7 +1296,6 @@
return ModMap.findModule(Name);
}
-
HeaderSearch::LoadModuleMapResult
HeaderSearch::loadModuleMapFile(StringRef DirName, bool IsSystem,
bool IsFramework) {
Index: lib/Sema/DelayedDiagnostic.cpp
===================================================================
--- lib/Sema/DelayedDiagnostic.cpp
+++ lib/Sema/DelayedDiagnostic.cpp
@@ -14,8 +14,10 @@
// This file also defines AccessedEntity.
//
//===----------------------------------------------------------------------===//
+
#include "clang/Sema/DelayedDiagnostic.h"
-#include <string.h>
+#include <cstring>
+
using namespace clang;
using namespace sema;
Index: lib/Frontend/CompilerInstance.cpp
===================================================================
--- lib/Frontend/CompilerInstance.cpp
+++ lib/Frontend/CompilerInstance.cpp
@@ -46,8 +46,12 @@
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include <sys/stat.h>
+#include <algorithm>
+#include <cerrno>
+#include <ctime>
+#include <limits>
#include <system_error>
-#include <time.h>
+#include <utility>
using namespace clang;
@@ -124,6 +128,7 @@
IntrusiveRefCntPtr<ASTReader> CompilerInstance::getModuleManager() const {
return ModuleManager;
}
+
void CompilerInstance::setModuleManager(IntrusiveRefCntPtr<ASTReader> Reader) {
ModuleManager = Reader;
}
@@ -1752,4 +1757,5 @@
return false;
}
+
void CompilerInstance::resetAndLeakSema() { BuryPointer(takeSema()); }
Index: lib/Frontend/CodeGenOptions.cpp
===================================================================
--- lib/Frontend/CodeGenOptions.cpp
+++ lib/Frontend/CodeGenOptions.cpp
@@ -8,7 +8,8 @@
//===----------------------------------------------------------------------===//
#include "clang/Frontend/CodeGenOptions.h"
-#include <string.h>
+#include "llvm/ADT/StringRef.h"
+#include <cstring>
namespace clang {
@@ -29,4 +30,4 @@
return false;
}
-} // end namespace clang
+} // end namespace clang
Index: tools/libclang/CIndexDiagnostic.h
===================================================================
--- tools/libclang/CIndexDiagnostic.h
+++ tools/libclang/CIndexDiagnostic.h
@@ -10,13 +10,14 @@
|* Implements the diagnostic functions of the Clang C interface. *|
|* *|
\*===----------------------------------------------------------------------===*/
+
#ifndef LLVM_CLANG_TOOLS_LIBCLANG_CINDEXDIAGNOSTIC_H
#define LLVM_CLANG_TOOLS_LIBCLANG_CINDEXDIAGNOSTIC_H
#include "clang-c/Index.h"
+#include <cassert>
#include <memory>
#include <vector>
-#include <assert.h>
namespace clang {
@@ -27,6 +28,7 @@
class CXDiagnosticSetImpl {
std::vector<std::unique_ptr<CXDiagnosticImpl>> Diagnostics;
const bool IsExternallyManaged;
+
public:
CXDiagnosticSetImpl(bool isManaged = false)
: IsExternallyManaged(isManaged) {}
@@ -162,4 +164,4 @@
} // end namespace clang
-#endif
+#endif // LLVM_CLANG_TOOLS_LIBCLANG_CINDEXDIAGNOSTIC_H
Index: include/clang-c/Index.h
===================================================================
--- include/clang-c/Index.h
+++ include/clang-c/Index.h
@@ -16,7 +16,11 @@
#ifndef LLVM_CLANG_C_INDEX_H
#define LLVM_CLANG_C_INDEX_H
+#ifdef __cplusplus
+#include <ctime>
+#else
#include <time.h>
+#endif
#include "clang-c/Platform.h"
#include "clang-c/CXErrorCode.h"
@@ -5145,7 +5149,7 @@
CXEval_UnExposed = 0
-} CXEvalResultKind ;
+} CXEvalResultKind;
/**
* \brief Evaluation result of a cursor
@@ -5943,4 +5947,5 @@
#ifdef __cplusplus
}
#endif
-#endif
+
+#endif /* LLVM_CLANG_C_INDEX_H */
Index: include/clang/Analysis/Analyses/ThreadSafetyTIL.h
===================================================================
--- include/clang/Analysis/Analyses/ThreadSafetyTIL.h
+++ include/clang/Analysis/Analyses/ThreadSafetyTIL.h
@@ -1,4 +1,4 @@
-//===- ThreadSafetyTIL.h ---------------------------------------*- C++ --*-===//
+//===- ThreadSafetyTIL.h ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -53,15 +53,13 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
-#include <stdint.h>
+#include <cstdint>
#include <utility>
-
namespace clang {
namespace threadSafety {
namespace til {
-
/// Enum for the different distinct classes of SExpr
enum TIL_Opcode {
#define TIL_OPCODE_DEF(X) COP_##X,
@@ -121,7 +119,6 @@
/// Return the name of a binary opcode.
StringRef getBinaryOpcodeString(TIL_BinaryOpcode Op);
-
/// ValueTypes are data types that can actually be held in registers.
/// All variables and expressions must have a value type.
/// Pointer types are further subdivided into the various heap-allocated
@@ -164,7 +161,6 @@
unsigned char VectSize; // 0 for scalar, otherwise num elements in vector
};
-
inline ValueType::SizeType ValueType::getSizeType(unsigned nbytes) {
switch (nbytes) {
case 1: return ST_8;
@@ -176,7 +172,6 @@
}
}
-
template<>
inline ValueType ValueType::getValueType<void>() {
return ValueType(BT_Void, ST_0, false, 0);
@@ -252,10 +247,8 @@
return ValueType(BT_Pointer, getSizeType(sizeof(void*)), false, 0);
}
-
class BasicBlock;
-
/// Base class for AST nodes in the typed intermediate language.
class SExpr {
public:
@@ -315,21 +308,19 @@
void *operator new(size_t) = delete;
};
-
// Contains various helper functions for SExprs.
namespace ThreadSafetyTIL {
inline bool isTrivial(const SExpr *E) {
unsigned Op = E->opcode();
return Op == COP_Variable || Op == COP_Literal || Op == COP_LiteralPtr;
}
-}
+} // end namespace ThreadSafetyTIL
// Nodes which declare variables
class Function;
class SFunction;
class Let;
-
/// A named variable, e.g. "x".
///
/// There are two distinct places in which a Variable can appear in the AST.
@@ -408,7 +399,6 @@
const clang::ValueDecl *Cvdecl; // The clang declaration for this variable.
};
-
/// Placeholder for an expression that has not yet been created.
/// Used to implement lazy copy and rewriting strategies.
class Future : public SExpr {
@@ -467,7 +457,6 @@
SExpr *Result;
};
-
/// Placeholder for expressions that cannot be represented in the TIL.
class Undefined : public SExpr {
public:
@@ -490,7 +479,6 @@
const clang::Stmt *Cstmt;
};
-
/// Placeholder for a wildcard that matches any other expression.
class Wildcard : public SExpr {
public:
@@ -509,7 +497,6 @@
}
};
-
template <class T> class LiteralT;
// Base class for literal values.
@@ -548,7 +535,6 @@
const clang::Expr *Cexpr;
};
-
// Derived class for literal values, which stores the actual value.
template<class T>
class LiteralT : public Literal {
@@ -563,8 +549,6 @@
T Val;
};
-
-
template <class V>
typename V::R_SExpr Literal::traverse(V &Vs, typename V::R_Ctx Ctx) {
if (Cexpr)
@@ -621,7 +605,6 @@
return Vs.reduceLiteral(*this);
}
-
/// A Literal pointer to an object allocated in memory.
/// At compile time, pointer literals are represented by symbolic names.
class LiteralPtr : public SExpr {
@@ -648,7 +631,6 @@
const clang::ValueDecl *Cvdecl;
};
-
/// A function -- a.k.a. lambda abstraction.
/// Functions with multiple arguments are created by currying,
/// e.g. (Function (x: Int) (Function (y: Int) (Code { return x + y })))
@@ -699,7 +681,6 @@
SExpr* Body;
};
-
/// A self-applicable function.
/// A self-applicable function can be applied to itself. It's useful for
/// implementing objects and late binding.
@@ -751,7 +732,6 @@
SExpr* Body;
};
-
/// A block of code -- e.g. the body of a function.
class Code : public SExpr {
public:
@@ -787,7 +767,6 @@
SExpr* Body;
};
-
/// A typed, writable location in memory
class Field : public SExpr {
public:
@@ -823,7 +802,6 @@
SExpr* Body;
};
-
/// Apply an argument to a function.
/// Note that this does not actually call the function. Functions are curried,
/// so this returns a closure in which the first parameter has been applied.
@@ -864,7 +842,6 @@
SExpr* Arg;
};
-
/// Apply a self-argument to a self-applicable function.
class SApply : public SExpr {
public:
@@ -903,7 +880,6 @@
SExpr* Arg;
};
-
/// Project a named slot from a C++ struct or class.
class Project : public SExpr {
public:
@@ -957,7 +933,6 @@
const clang::ValueDecl *Cvdecl;
};
-
/// Call a function (after all arguments have been applied).
class Call : public SExpr {
public:
@@ -988,7 +963,6 @@
const clang::CallExpr *Cexpr;
};
-
/// Allocate memory for a new value on the heap or stack.
class Alloc : public SExpr {
public:
@@ -1025,7 +999,6 @@
SExpr* Dtype;
};
-
/// Load a value from memory.
class Load : public SExpr {
public:
@@ -1052,7 +1025,6 @@
SExpr* Ptr;
};
-
/// Store a value to memory.
/// The destination is a pointer to a field, the source is the value to store.
class Store : public SExpr {
@@ -1088,7 +1060,6 @@
SExpr* Source;
};
-
/// If p is a reference to an array, then p[i] is a reference to the i'th
/// element of the array.
class ArrayIndex : public SExpr {
@@ -1125,7 +1096,6 @@
SExpr* Index;
};
-
/// Pointer arithmetic, restricted to arrays only.
/// If p is a reference to an array, then p + n, where n is an integer, is
/// a reference to a subarray.
@@ -1163,7 +1133,6 @@
SExpr* Index;
};
-
/// Simple arithmetic unary operations, e.g. negate and not.
/// These operations have no side-effects.
class UnaryOp : public SExpr {
@@ -1201,7 +1170,6 @@
SExpr* Expr0;
};
-
/// Simple arithmetic binary operations, e.g. +, -, etc.
/// These operations have no side effects.
class BinaryOp : public SExpr {
@@ -1251,7 +1219,6 @@
SExpr* Expr1;
};
-
/// Cast expressions.
/// Cast expressions are essentially unary operations, but we treat them
/// as a distinct AST node because they only change the type of the result.
@@ -1288,10 +1255,8 @@
SExpr* Expr0;
};
-
class SCFG;
-
/// Phi Node, for code in SSA form.
/// Each Phi node has an array of possible values that it can take,
/// depending on where control flow comes from.
@@ -1351,7 +1316,6 @@
const clang::ValueDecl* Cvdecl;
};
-
/// Base class for basic block terminators: Branch, Goto, and Return.
class Terminator : public SExpr {
public:
@@ -1372,7 +1336,6 @@
}
};
-
/// Jump to another basic block.
/// A goto instruction is essentially a tail-recursive call into another
/// block. In addition to the block pointer, it specifies an index into the
@@ -1415,7 +1378,6 @@
unsigned Index;
};
-
/// A conditional branch to two other blocks.
/// Note that unlike Goto, Branch does not have an index. The target blocks
/// must be child-blocks, and cannot have Phi nodes.
@@ -1467,7 +1429,6 @@
BasicBlock *Branches[2];
};
-
/// Return from the enclosing function, passing the return value to the caller.
/// Only the exit block should end with a return statement.
class Return : public Terminator {
@@ -1500,7 +1461,6 @@
SExpr* Retval;
};
-
inline ArrayRef<BasicBlock*> Terminator::successors() {
switch (opcode()) {
case COP_Goto: return cast<Goto>(this)->successors();
@@ -1511,7 +1471,6 @@
}
}
-
/// A basic block is part of an SCFG. It can be treated as a function in
/// continuation passing style. A block consists of a sequence of phi nodes,
/// which are "arguments" to the function, followed by a sequence of
@@ -1663,7 +1622,6 @@
void computeDominator();
void computePostDominator();
-private:
MemRegionRef Arena; // The arena used to allocate this block.
SCFG *CFGPtr; // The CFG that contains this block.
int BlockID : 31; // unique id for this BB in the containing CFG.
@@ -1679,7 +1637,6 @@
TopologyNode PostDominatorNode; // The post-dominator tree
};
-
/// An SCFG is a control-flow graph. It consists of a set of basic blocks,
/// each of which terminates in a branch to another basic block. There is one
/// entry point, and one exit point.
@@ -1772,7 +1729,6 @@
private:
void renumberInstrs(); // assign unique ids to all instructions
-private:
MemRegionRef Arena;
BlockArray Blocks;
BasicBlock *Entry;
@@ -1781,8 +1737,6 @@
bool Normal;
};
-
-
/// An identifier, e.g. 'foo' or 'x'.
/// This is a pseduo-term; it will be lowered to a variable or projection.
class Identifier : public SExpr {
@@ -1808,7 +1762,6 @@
StringRef Name;
};
-
/// An if-then-else expression.
/// This is a pseduo-term; it will be lowered to a branch in a CFG.
class IfThenElse : public SExpr {
@@ -1856,7 +1809,6 @@
SExpr* ElseExpr;
};
-
/// A let-expression, e.g. let x=t; u.
/// This is a pseduo-term; it will be lowered to instructions in a CFG.
class Let : public SExpr {
@@ -1904,15 +1856,12 @@
SExpr* Body;
};
-
-
const SExpr *getCanonicalVal(const SExpr *E);
SExpr* simplifyToCanonicalVal(SExpr *E);
void simplifyIncompleteArg(til::Phi *Ph);
-
} // end namespace til
} // end namespace threadSafety
} // end namespace clang
-#endif
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_THREADSAFETYTIL_H
Index: include/clang/Basic/Linkage.h
===================================================================
--- include/clang/Basic/Linkage.h
+++ include/clang/Basic/Linkage.h
@@ -11,11 +11,12 @@
/// \brief Defines the Linkage enumeration and various utility functions.
///
//===----------------------------------------------------------------------===//
+
#ifndef LLVM_CLANG_BASIC_LINKAGE_H
#define LLVM_CLANG_BASIC_LINKAGE_H
-#include <assert.h>
-#include <stdint.h>
+#include <cassert>
+#include <cstdint>
#include <utility>
namespace clang {
Index: include/clang/Basic/TargetBuiltins.h
===================================================================
--- include/clang/Basic/TargetBuiltins.h
+++ include/clang/Basic/TargetBuiltins.h
@@ -16,7 +16,7 @@
#ifndef LLVM_CLANG_BASIC_TARGETBUILTINS_H
#define LLVM_CLANG_BASIC_TARGETBUILTINS_H
-#include <stdint.h>
+#include <cstdint>
#include "clang/Basic/Builtins.h"
#undef PPC
@@ -198,4 +198,4 @@
} // end namespace clang.
-#endif
+#endif // LLVM_CLANG_BASIC_TARGETBUILTINS_H
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits