[cfe-commits] r70480 - in /cfe/trunk: lib/Sema/Sema.cpp test/CodeGen/uint128_t.c test/CodeGenCXX/mangle.cpp test/CodeGenObjC/encode-test-5.m test/Sema/types.c
Chris Lattner
sabre at nondot.org
Wed Apr 29 23:18:40 PDT 2009
Author: lattner
Date: Thu Apr 30 01:18:40 2009
New Revision: 70480
URL: http://llvm.org/viewvc/llvm-project?rev=70480&view=rev
Log:
only support int128_t on 64-bit and larger targets. 32-bit targets don't
have support for __divti3 and friends.
Modified:
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/test/CodeGen/uint128_t.c
cfe/trunk/test/CodeGenCXX/mangle.cpp
cfe/trunk/test/CodeGenObjC/encode-test-5.m
cfe/trunk/test/Sema/types.c
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=70480&r1=70479&r2=70480&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Thu Apr 30 01:18:40 2009
@@ -18,6 +18,7 @@
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Basic/TargetInfo.h"
using namespace clang;
/// ConvertQualTypeToStringFn - This function is used to pretty print the
@@ -109,15 +110,17 @@
TUScope = S;
PushDeclContext(S, Context.getTranslationUnitDecl());
- // Install [u]int128_t.
- PushOnScopeChains(TypedefDecl::Create(Context, CurContext,
- SourceLocation(),
- &Context.Idents.get("__int128_t"),
- Context.Int128Ty), TUScope);
- PushOnScopeChains(TypedefDecl::Create(Context, CurContext,
- SourceLocation(),
- &Context.Idents.get("__uint128_t"),
- Context.UnsignedInt128Ty), TUScope);
+ if (PP.getTargetInfo().getPointerWidth(0) >= 64) {
+ // Install [u]int128_t for 64-bit targets.
+ PushOnScopeChains(TypedefDecl::Create(Context, CurContext,
+ SourceLocation(),
+ &Context.Idents.get("__int128_t"),
+ Context.Int128Ty), TUScope);
+ PushOnScopeChains(TypedefDecl::Create(Context, CurContext,
+ SourceLocation(),
+ &Context.Idents.get("__uint128_t"),
+ Context.UnsignedInt128Ty), TUScope);
+ }
if (!PP.getLangOptions().ObjC1) return;
Modified: cfe/trunk/test/CodeGen/uint128_t.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/uint128_t.c?rev=70480&r1=70479&r2=70480&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/uint128_t.c (original)
+++ cfe/trunk/test/CodeGen/uint128_t.c Thu Apr 30 01:18:40 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o -
+// RUN: clang-cc %s -emit-llvm -o - -triple=x86_64-apple-darwin9
typedef unsigned long long uint64_t;
extern uint64_t numer;
Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=70480&r1=70479&r2=70480&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Thu Apr 30 01:18:40 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o %t &&
+// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 &&
// FIXME: This test is intentionally trivial, because we can't yet
// CodeGen anything real in C++.
Modified: cfe/trunk/test/CodeGenObjC/encode-test-5.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/encode-test-5.m?rev=70480&r1=70479&r2=70480&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/encode-test-5.m (original)
+++ cfe/trunk/test/CodeGenObjC/encode-test-5.m Thu Apr 30 01:18:40 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple=x86_64-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
// RUN: grep ji %t | count 1 &&
char *a = @encode(_Complex int);
Modified: cfe/trunk/test/Sema/types.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/types.c?rev=70480&r1=70479&r2=70480&view=diff
==============================================================================
--- cfe/trunk/test/Sema/types.c (original)
+++ cfe/trunk/test/Sema/types.c Thu Apr 30 01:18:40 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -pedantic -verify
+// RUN: clang-cc %s -pedantic -verify -triple=x86_64-apple-darwin9
// rdar://6097662
typedef int (*T)[2];
More information about the cfe-commits
mailing list