summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/OSTargets.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/Targets/OSTargets.h')
-rw-r--r--clang/lib/Basic/Targets/OSTargets.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
index c8d4aaae482..e8715dcf374 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -613,6 +613,53 @@ public:
}
};
+// AIX Target
+template <typename Target>
+class AIXTargetInfo : public OSTargetInfo<Target> {
+protected:
+ void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
+ MacroBuilder &Builder) const override {
+ DefineStd(Builder, "unix", Opts);
+ Builder.defineMacro("_IBMR2");
+ Builder.defineMacro("_POWER");
+
+ // FIXME: Define AIX OS-Version Macros.
+ Builder.defineMacro("_AIX");
+
+ // FIXME: Do not define _LONG_LONG when -fno-long-long is specified.
+ Builder.defineMacro("_LONG_LONG");
+
+ if (Opts.POSIXThreads) {
+ Builder.defineMacro("_THREAD_SAFE");
+ }
+
+ if (this->PointerWidth == 64) {
+ Builder.defineMacro("__64BIT__");
+ }
+
+ // Define _WCHAR_T when it is a fundamental type
+ // (i.e., for C++ without -fno-wchar).
+ if (Opts.CPlusPlus && Opts.WChar) {
+ Builder.defineMacro("_WCHAR_T");
+ }
+ }
+
+public:
+ AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+ : OSTargetInfo<Target>(Triple, Opts) {
+ if (this->PointerWidth == 64) {
+ this->WCharType = this->UnsignedInt;
+ } else {
+ this->WCharType = this->UnsignedShort;
+ }
+ this->UseZeroLengthBitfieldAlignment = true;
+ }
+
+ // AIX sets FLT_EVAL_METHOD to be 1.
+ unsigned getFloatEvalMethod() const override { return 1; }
+ bool hasInt128Type() const override { return false; }
+};
+
// Windows target
template <typename Target>
class LLVM_LIBRARY_VISIBILITY WindowsTargetInfo : public OSTargetInfo<Target> {
OpenPOWER on IntegriCloud