#include "llvm/Support/TargetParser.h"
#include <algorithm>
#include <memory>
-
using namespace clang;
//===----------------------------------------------------------------------===//
template <typename Target>
class WebAssemblyOSTargetInfo : public OSTargetInfo<Target> {
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
- MacroBuilder &Builder) const final {
+ MacroBuilder &Builder) const override final {
// A common platform macro.
if (Opts.POSIXThreads)
Builder.defineMacro("_REENTRANT");
}
// As an optimization, group static init code together in a section.
- const char *getStaticInitSectionSpecifier() const final {
+ const char *getStaticInitSectionSpecifier() const override final {
return ".text.__startup";
}
Features["simd128"] = true;
return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
}
- bool hasFeature(StringRef Feature) const final {
+ bool hasFeature(StringRef Feature) const override final {
return llvm::StringSwitch<bool>(Feature)
.Case("simd128", SIMDLevel >= SIMD128)
.Default(false);
}
bool handleTargetFeatures(std::vector<std::string> &Features,
- DiagnosticsEngine &Diags) final {
+ DiagnosticsEngine &Diags) override final {
for (const auto &Feature : Features) {
if (Feature == "+simd128") {
SIMDLevel = std::max(SIMDLevel, SIMD128);
}
return true;
}
- bool setCPU(const std::string &Name) final {
+ bool setCPU(const std::string &Name) override final {
return llvm::StringSwitch<bool>(Name)
.Case("mvp", true)
.Case("bleeding-edge", true)
.Default(false);
}
void getTargetBuiltins(const Builtin::Info *&Records,
- unsigned &NumRecords) const final {
+ unsigned &NumRecords) const override final {
Records = BuiltinInfo;
NumRecords = clang::WebAssembly::LastTSBuiltin - Builtin::FirstTSBuiltin;
}
- BuiltinVaListKind getBuiltinVaListKind() const final {
+ BuiltinVaListKind getBuiltinVaListKind() const override final {
// TODO: Implement va_list properly.
return VoidPtrBuiltinVaList;
}
void getGCCRegNames(const char *const *&Names,
- unsigned &NumNames) const final {
+ unsigned &NumNames) const override final {
Names = nullptr;
NumNames = 0;
}
void getGCCRegAliases(const GCCRegAlias *&Aliases,
- unsigned &NumAliases) const final {
+ unsigned &NumAliases) const override final {
Aliases = nullptr;
NumAliases = 0;
}
bool
validateAsmConstraint(const char *&Name,
- TargetInfo::ConstraintInfo &Info) const final {
+ TargetInfo::ConstraintInfo &Info) const override final {
return false;
}
- const char *getClobbers() const final { return ""; }
- bool isCLZForZeroUndef() const final { return false; }
- bool hasInt128Type() const final { return true; }
+ const char *getClobbers() const override final { return ""; }
+ bool isCLZForZeroUndef() const override final { return false; }
+ bool hasInt128Type() const override final { return true; }
};
const Builtin::Info WebAssemblyTargetInfo::BuiltinInfo[] = {
virtual const VarDecl *getThreadIDVariable() const = 0;
/// \brief Emit the captured statement body.
- void EmitBody(CodeGenFunction &CGF, const Stmt *S) override;
+ virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) override;
/// \brief Get an LValue for the current ThreadID variable.
/// \return LValue for thread id variable. This LValue always has type int32*.
return OuterRegionInfo->getContextValue();
llvm_unreachable("No context value for inlined OpenMP region");
}
- void setContextValue(llvm::Value *V) override {
+ virtual void setContextValue(llvm::Value *V) override {
if (OuterRegionInfo) {
OuterRegionInfo->setContextValue(V);
return;
}
};
-} // anonymous namespace
+} // namespace
LValue CGOpenMPRegionInfo::getThreadIDVariableLValue(CodeGenFunction &CGF) {
return CGF.MakeNaturalAlignAddrLValue(
CGF.EmitRuntimeCall(Callee, Args);
}
};
-} // anonymous namespace
+} // namespace
void CGOpenMPRuntime::emitCriticalRegion(CodeGenFunction &CGF,
StringRef CriticalName,
/// \brief Function with call of destructors for private variables.
KmpTaskTDestructors,
};
-} // anonymous namespace
+} // namespace
void CGOpenMPRuntime::emitKmpRoutineEntryT(QualType KmpInt32Ty) {
if (!KmpRoutineEntryPtrTy) {
const VarDecl *PrivateElemInit;
};
typedef std::pair<CharUnits /*Align*/, PrivateHelpersTy> PrivateDataTy;
-} // anonymous namespace
+} // namespace
static RecordDecl *
createPrivatesRecordDecl(CodeGenModule &CGM,
}
}
}
+
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/TargetRegistry.h"
#include <memory>
-
using namespace clang;
#define DEBUG_TYPE "pchcontainer"
CodeGenOpts.SplitDwarfFile = OutputFileName;
}
- ~PCHContainerGenerator() override = default;
+ virtual ~PCHContainerGenerator() {}
void Initialize(ASTContext &Context) override {
assert(!Ctx && "initialized multiple times");
}
};
-} // anonymous namespace
+} // namespace
std::unique_ptr<ASTConsumer>
ObjectFilePCHContainerWriter::CreatePCHContainerGenerator(
// As a fallback, treat the buffer as a raw AST.
StreamFile.init((const unsigned char *)Buffer.getBufferStart(),
(const unsigned char *)Buffer.getBufferEnd());
+ return;
}
const llvm::opt::ArgList &Args);
~SHAVEToolChain() override;
- Tool *SelectTool(const JobAction &JA) const override;
+ virtual Tool *SelectTool(const JobAction &JA) const override;
protected:
Tool *getTool(Action::ActionClass AC) const override;
} // end namespace driver
} // end namespace clang
-#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_H
+#endif
/// \brief Puts all tokens into a single line.
unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
- bool DryRun) override {
+ bool DryRun) {
unsigned Penalty = 0;
LineState State = Indenter->getInitialState(FirstIndent, &Line, DryRun);
while (State.NextToken) {
/// \brief Formats the line by finding the best line breaks with line lengths
/// below the column limit.
unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
- bool DryRun) override {
+ bool DryRun) {
LineState State = Indenter->getInitialState(FirstIndent, &Line, DryRun);
// If the ObjC method declaration does not fit on a line, we should format
llvm::SpecificBumpPtrAllocator<StateNode> Allocator;
};
-} // anonymous namespace
+} // namespace
unsigned
UnwrappedLineFormatter::format(const SmallVectorImpl<AnnotatedLine *> &Lines,
#include "llvm/Bitcode/BitstreamReader.h"
#include "llvm/Support/raw_ostream.h"
#include "clang/Lex/ModuleLoader.h"
-
using namespace clang;
namespace {
std::shared_ptr<PCHBuffer> Buffer)
: Buffer(Buffer), OS(OS) {}
- ~RawPCHContainerGenerator() override = default;
+ virtual ~RawPCHContainerGenerator() {}
void HandleTranslationUnit(ASTContext &Ctx) override {
if (Buffer->IsComplete) {
Buffer->Data = std::move(Empty);
}
};
-
-} // anonymous namespace
+}
std::unique_ptr<ASTConsumer> RawPCHContainerWriter::CreatePCHContainerGenerator(
DiagnosticsEngine &Diags, const HeaderSearchOptions &HSO,