[PATCH] D155335: Revert 245d10b7a2c12ec25e7b5860a38c61991543a739

2023-07-14 Thread Sterling Augustine via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb9543f7de697: Revert [clang][Interp][NFC] Trim 
Source.h includes (authored by saugustine).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155335/new/

https://reviews.llvm.org/D155335

Files:
  clang/lib/AST/Interp/Source.h


Index: clang/lib/AST/Interp/Source.h
===
--- clang/lib/AST/Interp/Source.h
+++ clang/lib/AST/Interp/Source.h
@@ -14,17 +14,11 @@
 #define LLVM_CLANG_AST_INTERP_SOURCE_H
 
 #include "PrimType.h"
-#include "llvm/ADT/PointerUnion.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
 #include "llvm/Support/Endian.h"
 
 namespace clang {
-
-class Decl;
-class Stmt;
-class SourceLocation;
-class Expr;
-class SourceRange;
-
 namespace interp {
 class Function;
 


Index: clang/lib/AST/Interp/Source.h
===
--- clang/lib/AST/Interp/Source.h
+++ clang/lib/AST/Interp/Source.h
@@ -14,17 +14,11 @@
 #define LLVM_CLANG_AST_INTERP_SOURCE_H
 
 #include "PrimType.h"
-#include "llvm/ADT/PointerUnion.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
 #include "llvm/Support/Endian.h"
 
 namespace clang {
-
-class Decl;
-class Stmt;
-class SourceLocation;
-class Expr;
-class SourceRange;
-
 namespace interp {
 class Function;
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155335: Replace forward-declarations with proper headers for Decl and Stmt

2023-07-14 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine updated this revision to Diff 540552.
saugustine added a comment.

Switch to pure revert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155335/new/

https://reviews.llvm.org/D155335

Files:
  clang/lib/AST/Interp/Source.h


Index: clang/lib/AST/Interp/Source.h
===
--- clang/lib/AST/Interp/Source.h
+++ clang/lib/AST/Interp/Source.h
@@ -14,17 +14,11 @@
 #define LLVM_CLANG_AST_INTERP_SOURCE_H
 
 #include "PrimType.h"
-#include "llvm/ADT/PointerUnion.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
 #include "llvm/Support/Endian.h"
 
 namespace clang {
-
-class Decl;
-class Stmt;
-class SourceLocation;
-class Expr;
-class SourceRange;
-
 namespace interp {
 class Function;
 


Index: clang/lib/AST/Interp/Source.h
===
--- clang/lib/AST/Interp/Source.h
+++ clang/lib/AST/Interp/Source.h
@@ -14,17 +14,11 @@
 #define LLVM_CLANG_AST_INTERP_SOURCE_H
 
 #include "PrimType.h"
-#include "llvm/ADT/PointerUnion.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
 #include "llvm/Support/Endian.h"
 
 namespace clang {
-
-class Decl;
-class Stmt;
-class SourceLocation;
-class Expr;
-class SourceRange;
-
 namespace interp {
 class Function;
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155335: This fixes an issue with 245d10b7a2c12ec25e7b5860a38c61991543a739, where on slightly older versions of clang, we get the below error and several others similar.

2023-07-14 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
Herald added a subscriber: ChuanqiXu.
Herald added a project: All.
saugustine requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In file included from .../clang/lib/AST/Interp/Source.h:17:
In file included from .../llvm/include/llvm/ADT/PointerUnion.h:19:
In file included from .../llvm/include/llvm/ADT/PointerIntPair.h:18:
.../llvm/include/llvm/Support/PointerLikeTypeTraits.h:61:28: error: invalid 
application of 'alignof' to an incomplete type 'clang::Decl'

  61 |   detail::ConstantLog2::value;
 |^~

.../llvm/include/llvm/Support/PointerLikeTypeTraits.h:101:56: note: in 
instantiation of static data member 'llvm::PointerLikeTypeTraits::NumLowBitsAvailable' requested here

  101 |   static constexpr int NumLowBitsAvailable = 
NonConst::NumLowBitsAvailable;
  |^

.../llvm/include/llvm/ADT/PointerUnion.h:38:54: note: in instantiation of 
static data member 'llvm::PointerLikeTypeTraits::NumLowBitsAvailable' requested here

  38 | return 
std::min({PointerLikeTypeTraits::NumLowBitsAvailable...});
 |  ^

.../llvm/include/llvm/ADT/PointerUnion.h:52:48: note: in instantiation of 
function template specialization 
'llvm::pointer_union_detail::lowBitsAvailable' requested here

  52 | static constexpr int NumLowBitsAvailable = 
lowBitsAvailable();
 |^

.../llvm/include/llvm/ADT/PointerIntPair.h:169:28: note: in instantiation of 
static data member 'llvm::pointer_union_detail::PointerUnionUIntTraits::NumLowBitsAvailable' requested here

  169 |   static_assert(PtrTraits::NumLowBitsAvailable <
  |^

.../llvm/include/llvm/ADT/PointerIntPair.h:111:13: note: in instantiation of 
template class 'llvm::PointerIntPairInfo>' requested here

  111 | Value = Info::updateInt(Info::updatePointer(0, PtrVal),
  | ^

.../llvm/include/llvm/ADT/PointerIntPair.h:89:5: note: in instantiation of 
member function 'llvm::PointerIntPair>::setPointerAndInt' requested here

  89 | setPointerAndInt(PtrVal, IntVal);
 | ^

.../llvm/include/llvm/ADT/PointerUnion.h:77:16: note: in instantiation of 
member function 'llvm::PointerIntPair>::PointerIntPair' requested here

  77 | : Base(ValTy(const_cast(
 |^

.../clang/lib/AST/Interp/Source.h:76:31: note: in instantiation of member 
function 
'llvm::pointer_union_detail::PointerUnionMembers, llvm::PointerIntPair>, 1, const clang::Stmt *>::PointerUnionMembers' requested here

  76 |   SourceInfo(const Stmt *E) : Source(E) {}
 |   ^

.../clang/lib/AST/Interp/Source.h:22:7: note: forward declaration of 
'clang::Decl'

  22 | class Decl;
 |   ^


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155335

Files:
  clang/lib/AST/Interp/Source.h


Index: clang/lib/AST/Interp/Source.h
===
--- clang/lib/AST/Interp/Source.h
+++ clang/lib/AST/Interp/Source.h
@@ -14,17 +14,13 @@
 #define LLVM_CLANG_AST_INTERP_SOURCE_H
 
 #include "PrimType.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/Support/Endian.h"
 
 namespace clang {
 
-class Decl;
-class Stmt;
-class SourceLocation;
-class Expr;
-class SourceRange;
-
 namespace interp {
 class Function;
 


Index: clang/lib/AST/Interp/Source.h
===
--- clang/lib/AST/Interp/Source.h
+++ clang/lib/AST/Interp/Source.h
@@ -14,17 +14,13 @@
 #define LLVM_CLANG_AST_INTERP_SOURCE_H
 
 #include "PrimType.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/Support/Endian.h"
 
 namespace clang {
 
-class Decl;
-class Stmt;
-class SourceLocation;
-class Expr;
-class SourceRange;
-
 namespace interp {
 class Function;
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150892: [clang][ExprConstant] fix __builtin_object_size for flexible array members

2023-05-22 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

This change causes an assertion failure on the following test case. The memset 
is important for some reason.

  saugustine@saugustine-desktop:~/llvm/build $ cat t.c
  struct foo {
unsigned char x;
unsigned char   data[];
  };
  
  extern void *memset (void *__s, int __c, unsigned long __n);
  
  void bar(void)
  {
struct foo bat;
memset(, 0, sizeof(bat));
  }
  saugustine@saugustine-desktop:~/llvm/build $ ./bin/clang -c t.c
  clang: 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/AST/Decl.cpp:2786:
 clang::CharUnits clang::VarDecl::getFlexibleArrayInitChars(const 
clang::ASTContext &) const: Assertion `hasInit() && "Expect initializer to 
check for flexible array init"' failed.
  PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ 
and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.Program arguments: ./bin/clang -c t.c
  1.t.c:11:30: current parser token ')'
  2.t.c:9:1: parsing function body 'bar'
  3.t.c:9:1: in compound statement ('{}')
   #0 0x55bf947c1d7d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
/usr/local/google/home/saugustine/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:602:11
   #1 0x55bf947c21fb PrintStackTraceSignalHandler(void*) 
/usr/local/google/home/saugustine/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:675:1
   #2 0x55bf947c0496 llvm::sys::RunSignalHandlers() 
/usr/local/google/home/saugustine/llvm/llvm-project/llvm/lib/Support/Signals.cpp:104:5
   #3 0x55bf947c15ee llvm::sys::CleanupOnSignal(unsigned long) 
/usr/local/google/home/saugustine/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:368:1
   #4 0x55bf946ff954 (anonymous 
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) 
/usr/local/google/home/saugustine/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:0:7
   #5 0x55bf946ffd12 CrashRecoverySignalHandler(int) 
/usr/local/google/home/saugustine/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:391:1
   #6 0x7f95ab65af90 (/lib/x86_64-linux-gnu/libc.so.6+0x3bf90)
   #7 0x7f95ab6a9ccc __pthread_kill_implementation 
./nptl/./nptl/pthread_kill.c:44:76
   #8 0x7f95ab65aef2 raise ./signal/../sysdeps/posix/raise.c:27:6
   #9 0x7f95ab645472 abort ./stdlib/./stdlib/abort.c:81:7
  #10 0x7f95ab645395 _nl_load_domain ./intl/./intl/loadmsgcat.c:1177:9
  #11 0x7f95ab653df2 (/lib/x86_64-linux-gnu/libc.so.6+0x34df2)
  #12 0x55bf9a6a62cf 
clang::VarDecl::getFlexibleArrayInitChars(clang::ASTContext const&) const 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/AST/Decl.cpp:0:3
  #13 0x55bf9a89094b determineEndOffset((anonymous namespace)::EvalInfo&, 
clang::SourceLocation, unsigned int, (anonymous namespace)::LValue const&, 
clang::CharUnits&)::$_15::operator()(clang::QualType, clang::CharUnits&) const 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/AST/ExprConstant.cpp:11741:21
  #14 0x55bf9a89024e determineEndOffset((anonymous namespace)::EvalInfo&, 
clang::SourceLocation, unsigned int, (anonymous namespace)::LValue const&, 
clang::CharUnits&) 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/AST/ExprConstant.cpp:11763:5
  #15 0x55bf9a7dbb62 tryEvaluateBuiltinObjectSize(clang::Expr const*, 
unsigned int, (anonymous namespace)::EvalInfo&, unsigned long&) 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/AST/ExprConstant.cpp:11848:7
  #16 0x55bf9a7db953 clang::Expr::tryEvaluateObjectSize(unsigned long&, 
clang::ASTContext&, unsigned int) const 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/AST/ExprConstant.cpp:16274:3
  #17 0x55bf98a86e07 
clang::Sema::checkFortifiedBuiltinMemoryFunction(clang::FunctionDecl*, 
clang::CallExpr*)::$_1::operator()(unsigned int) const 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/Sema/SemaChecking.cpp::9
  #18 0x55bf98a86913 
clang::Sema::checkFortifiedBuiltinMemoryFunction(clang::FunctionDecl*, 
clang::CallExpr*) 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/Sema/SemaChecking.cpp:1318:21
  #19 0x55bf98fdcb51 clang::Sema::BuildResolvedCallExpr(clang::Expr*, 
clang::NamedDecl*, clang::SourceLocation, llvm::ArrayRef, 
clang::SourceLocation, clang::Expr*, bool, clang::CallExpr::ADLCallKind) 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/Sema/SemaExpr.cpp:7463:9
  #20 0x55bf98fbbf78 clang::Sema::BuildCallExpr(clang::Scope*, 
clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef, 
clang::SourceLocation, clang::Expr*, bool, bool) 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/lib/Sema/SemaExpr.cpp:7112:10
  #21 0x55bf98fda08f clang::Sema::ActOnCallExpr(clang::Scope*, 
clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef, 
clang::SourceLocation, clang::Expr*) 

[PATCH] D138792: [AArch64] Improve TargetParser API

2022-12-04 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

We are seeing constexpr failures with this change. They look like this:

  In file included from 
llvm-project/llvm/lib/Support/AArch64TargetParser.cpp:14:
  In file included from 
llvm-project/llvm/include/llvm/Support/AArch64TargetParser.h:160:
  llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def:20:47: error: 
constexpr variable cannot have non-literal type 'const ArchInfo'
  AARCH64_ARCH(0, 0, InvalidProfile, "invalid", INVALID, "+",

I intend to revert this change early 5 December. Please let me know if that 
will be an issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138792/new/

https://reviews.llvm.org/D138792

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135097: Remove redundant option '-menable-unsafe-fp-math'.

2022-10-14 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

The newly added test func-attr.c fails when run in opt mode. If it is expected 
to run only at a certain optimization level, it should probably include that 
level in the test itself. I don't think it seriously blocks anything, but would 
be good to fix.

  /usr/local/google/home/saugustine/llvm/build/bin/clang -O2 -c -ffast-math 
-emit-llvm -S -o - 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c
  | /usr/local/google/home/saugustine/llvm/build/bin/FileCheck 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c
  
/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c:11:11:
 error: CHECK: expected string not found in input
  // CHECK: define{{.*}} float @foo(float noundef %a, float noundef %b) 
[[FAST_ATTRS:#[0-9]+]]
^
  :1:1: note: scanning from here
  ; ModuleID = 
'/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c'
  ^
  :7:1: note: possible intended match here
  define dso_local float @foo(float noundef %a, float noundef %b) 
local_unnamed_addr #0 {
  ^
  
  Input file: 
  Check file: 
/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c
  
  -dump-input=help explains the following input dump.
  
  Input was:
  <<
  1: ; ModuleID = 
'/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c'
 
  check:11'0 
X~
 error: no match found
  2: source_filename = 
"/usr/local/google/home/saugustine/llvm/llvm-project/clang/test/CodeGen/func-attr.c"
 
  check:11'0 
~~~
  3: target datalayout = 
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 
  check:11'0 
~
  4: target triple = "x86_64-unknown-linux-gnu" 
  check:11'0 ~~~
  5:  
  check:11'0 ~
  6: ; Function Attrs: mustprogress nofree norecurse nosync 
nounwind readnone willreturn uwtable 
  check:11'0 

  7: define dso_local float @foo(float noundef %a, float noundef 
%b) local_unnamed_addr #0 { 
  check:11'0 

  check:11'1 ?  
  possible intended match
  8: entry: 
  check:11'0 ~~~
  9:  %add = fadd fast float %b, %a 
  check:11'0 ~~~
 10:  ret float %add 
  check:11'0 
 11: } 
  check:11'0 ~~
 12:  
  check:11'0 ~
  .
  .
  .
  >>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135097/new/

https://reviews.llvm.org/D135097

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-16 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

This change ends up leaving some unhandled enum with switches inside lldb, and 
it isn't obvious to me how to fix them. Can you take a quick look?

  
llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4098:11: 
error: enumeration value 'BTFTagAttributed' not handled in switch 
[-Werror,-Wswitch]
switch (qual_type->getTypeClass()) {
^
  
llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4757:11: 
error: enumeration value 'BTFTagAttributed' not handled in switch 
[-Werror,-Wswitch]
switch (qual_type->getTypeClass()) {
^
  
llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:5140:11: 
error: enumeration value 'BTFTagAttributed' not handled in switch 
[-Werror,-Wswitch]
switch (qual_type->getTypeClass()) {
^
  3 errors generated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120296/new/

https://reviews.llvm.org/D120296

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D103039: [AST] fully-qualify template args of outer types in getFullyQualifiedType

2021-06-03 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

Committed as 3e55f55048387a8efef01e445d46fc5cf100285d 
.

Thanks again for the fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103039/new/

https://reviews.llvm.org/D103039

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D103039: [AST] fully-qualify template args of outer types in getFullyQualifiedType

2021-06-02 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine accepted this revision.
saugustine added a comment.
This revision is now accepted and ready to land.

This is a long-standing bug that needed to be fixed. Thank you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103039/new/

https://reviews.llvm.org/D103039

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D85176: [Coverage] Emit gap region after conditions when macro is present.

2021-02-18 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

This commit introduced an unused variable warning when built without asserts. 
(CoverageMappingGen.cpp:984) I have fixed it with  rG4544a63b7705 
.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85176/new/

https://reviews.llvm.org/D85176

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D85231: Protect against filenames with no extension at all.

2020-08-04 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

The darwin-dsymutil.c tests this code path right now on line 33. I found this 
error by running it under asan; otherwise it was fully latent.

It seems pretty clear to me that when End == -1 (StringRef::npos), creating a 
string ref from that is obviously a bug.

I'm not even sure how to check for a failure. clang will almost never crash; 
there is just a very subtle bounds violation or empty stringref. How it 
manifests itself depends on subsequent usage of the stringref, and stack layout.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85231/new/

https://reviews.llvm.org/D85231

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D85231: Protect against filenames with no extension at all.

2020-08-04 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
saugustine added a reviewer: echristo.
Herald added a reviewer: JDevlieghere.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
saugustine requested review of this revision.

Such as the one in the darwin-dsymutil.c test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85231

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -4675,6 +4675,8 @@
 std::string::size_type End = std::string::npos;
 if (!types::appendSuffixForType(JA.getType()))
   End = BaseName.rfind('.');
+if (End == StringRef::npos)
+  End = BaseName.size();
 SmallString<128> Suffixed(BaseName.substr(0, End));
 Suffixed += OffloadingPrefix;
 if (MultipleArchs && !BoundArch.empty()) {


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -4675,6 +4675,8 @@
 std::string::size_type End = std::string::npos;
 if (!types::appendSuffixForType(JA.getType()))
   End = BaseName.rfind('.');
+if (End == StringRef::npos)
+  End = BaseName.size();
 SmallString<128> Suffixed(BaseName.substr(0, End));
 Suffixed += OffloadingPrefix;
 if (MultipleArchs && !BoundArch.empty()) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D84058: Pass -rtlib=libgcc in tests conditioned on the default.

2020-07-17 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

This is a reasonable workaround, as it seems to be checking the position of 
various arguments, and as things work today, lgcc and the compiler-rt variants 
appear in exactly the same places.

If we wanted to be really strict, we would add some new test that tested that 
the two different libraries appeared in exactly the same places, but I believe 
if this became not true we would see many other failures.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84058/new/

https://reviews.llvm.org/D84058



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81752: Revert "[analyzer][NFC] Don't allow dependency checkers to emit diagnostics"

2020-06-12 Thread Sterling Augustine via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe64059828f19: Revert [analyzer][NFC] Dont allow 
dependency checkers to emit diagnostics (authored by saugustine).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81752/new/

https://reviews.llvm.org/D81752

Files:
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
  clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
  clang/lib/StaticAnalyzer/Core/BugReporter.cpp
  clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp

Index: clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
===
--- clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
+++ clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
@@ -94,10 +94,6 @@
 // Methods of CmdLineOption, PackageInfo and CheckerInfo.
 //===--===//
 
-LLVM_DUMP_METHOD void CheckerRegistry::CmdLineOption::dump() const {
-  dumpToStream(llvm::errs());
-}
-
 LLVM_DUMP_METHOD void
 CheckerRegistry::CmdLineOption::dumpToStream(llvm::raw_ostream ) const {
   // The description can be just checked in Checkers.inc, the point here is to
@@ -119,10 +115,6 @@
   llvm_unreachable("Unhandled CheckerRegistry::StateFromCmdLine enum");
 }
 
-LLVM_DUMP_METHOD void CheckerRegistry::CheckerInfo::dump() const {
-  dumpToStream(llvm::errs());
-}
-
 LLVM_DUMP_METHOD void
 CheckerRegistry::CheckerInfo::dumpToStream(llvm::raw_ostream ) const {
   // The description can be just checked in Checkers.inc, the point here is to
@@ -145,10 +137,6 @@
   }
 }
 
-LLVM_DUMP_METHOD void CheckerRegistry::PackageInfo::dump() const {
-  dumpToStream(llvm::errs());
-}
-
 LLVM_DUMP_METHOD void
 CheckerRegistry::PackageInfo::dumpToStream(llvm::raw_ostream ) const {
   Out << FullName << "\n";
Index: clang/lib/StaticAnalyzer/Core/BugReporter.cpp
===
--- clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -40,7 +40,6 @@
 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
-#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
@@ -2107,32 +2106,6 @@
 // Methods for BugReport and subclasses.
 //===--===//
 
-static bool isDependency(const CheckerRegistry ,
- StringRef CheckerName) {
-  for (const std::pair  : Registry.Dependencies) {
-if (Pair.second == CheckerName)
-  return true;
-  }
-  return false;
-}
-
-PathSensitiveBugReport::PathSensitiveBugReport(
-const BugType , StringRef shortDesc, StringRef desc,
-const ExplodedNode *errorNode, PathDiagnosticLocation LocationToUnique,
-const Decl *DeclToUnique)
-: BugReport(Kind::PathSensitive, bt, shortDesc, desc), ErrorNode(errorNode),
-  ErrorNodeRange(getStmt() ? getStmt()->getSourceRange() : SourceRange()),
-  UniqueingLocation(LocationToUnique), UniqueingDecl(DeclToUnique) {
-  assert(!isDependency(ErrorNode->getState()
-   ->getAnalysisManager()
-   .getCheckerManager()
-   ->getCheckerRegistry(),
-   bt.getCheckerName()) &&
- "Some checkers depend on this one! We don't allow dependency "
- "checkers to emit warnings, because checkers should depend on "
- "*modeling*, not *diagnostics*.");
-}
-
 void PathSensitiveBugReport::addVisitor(
 std::unique_ptr visitor) {
   if (!visitor)
@@ -2221,12 +2194,12 @@
   return;
 case bugreporter::TrackingKind::Condition:
   return;
-}
+  }
 
-llvm_unreachable(
-"BugReport::markInteresting currently can only handle 2 different "
-"tracking kinds! Please define what tracking kind should this entitiy"
-"have, if it was already marked as interesting with a different kind!");
+  llvm_unreachable(
+  "BugReport::markInteresting currently can only handle 2 different "
+  "tracking kinds! Please define what tracking kind should this entitiy"
+  "have, if it was already marked as interesting with a different kind!");
 }
 
 void PathSensitiveBugReport::markInteresting(SymbolRef sym,
Index: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
===
--- clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
+++ clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
@@ -135,7 +135,7 @@
  "Invalid development status!");
 }
 
-LLVM_DUMP_METHOD void dump() const;
+LLVM_DUMP_METHOD void dump() 

[PATCH] D81752: Revert "[analyzer][NFC] Don't allow dependency checkers to emit diagnostics"

2020-06-12 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
saugustine added reviewers: echristo, Szelethus, martong.
Herald added subscribers: cfe-commits, ASDenysPetrov, Charusso, dkrupp, 
donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, 
xazax.hun.
Herald added a project: clang.

This reverts commit 33fb9cbe211d1b43d4b84edf34e11001f04cddf0 
.

That commit violates layering by adding a dependency from StaticAnalyzer/Core
back to StaticAnalyzer/FrontEnd, creating a circular dependency.

I can't see a clean way to fix it except refactoring.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81752

Files:
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
  clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
  clang/lib/StaticAnalyzer/Core/BugReporter.cpp
  clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp

Index: clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
===
--- clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
+++ clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
@@ -94,10 +94,6 @@
 // Methods of CmdLineOption, PackageInfo and CheckerInfo.
 //===--===//
 
-LLVM_DUMP_METHOD void CheckerRegistry::CmdLineOption::dump() const {
-  dumpToStream(llvm::errs());
-}
-
 LLVM_DUMP_METHOD void
 CheckerRegistry::CmdLineOption::dumpToStream(llvm::raw_ostream ) const {
   // The description can be just checked in Checkers.inc, the point here is to
@@ -119,10 +115,6 @@
   llvm_unreachable("Unhandled CheckerRegistry::StateFromCmdLine enum");
 }
 
-LLVM_DUMP_METHOD void CheckerRegistry::CheckerInfo::dump() const {
-  dumpToStream(llvm::errs());
-}
-
 LLVM_DUMP_METHOD void
 CheckerRegistry::CheckerInfo::dumpToStream(llvm::raw_ostream ) const {
   // The description can be just checked in Checkers.inc, the point here is to
@@ -145,10 +137,6 @@
   }
 }
 
-LLVM_DUMP_METHOD void CheckerRegistry::PackageInfo::dump() const {
-  dumpToStream(llvm::errs());
-}
-
 LLVM_DUMP_METHOD void
 CheckerRegistry::PackageInfo::dumpToStream(llvm::raw_ostream ) const {
   Out << FullName << "\n";
Index: clang/lib/StaticAnalyzer/Core/BugReporter.cpp
===
--- clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -40,7 +40,6 @@
 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
-#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
@@ -2107,32 +2106,6 @@
 // Methods for BugReport and subclasses.
 //===--===//
 
-static bool isDependency(const CheckerRegistry ,
- StringRef CheckerName) {
-  for (const std::pair  : Registry.Dependencies) {
-if (Pair.second == CheckerName)
-  return true;
-  }
-  return false;
-}
-
-PathSensitiveBugReport::PathSensitiveBugReport(
-const BugType , StringRef shortDesc, StringRef desc,
-const ExplodedNode *errorNode, PathDiagnosticLocation LocationToUnique,
-const Decl *DeclToUnique)
-: BugReport(Kind::PathSensitive, bt, shortDesc, desc), ErrorNode(errorNode),
-  ErrorNodeRange(getStmt() ? getStmt()->getSourceRange() : SourceRange()),
-  UniqueingLocation(LocationToUnique), UniqueingDecl(DeclToUnique) {
-  assert(!isDependency(ErrorNode->getState()
-   ->getAnalysisManager()
-   .getCheckerManager()
-   ->getCheckerRegistry(),
-   bt.getCheckerName()) &&
- "Some checkers depend on this one! We don't allow dependency "
- "checkers to emit warnings, because checkers should depend on "
- "*modeling*, not *diagnostics*.");
-}
-
 void PathSensitiveBugReport::addVisitor(
 std::unique_ptr visitor) {
   if (!visitor)
@@ -2221,12 +2194,12 @@
   return;
 case bugreporter::TrackingKind::Condition:
   return;
-}
+  }
 
-llvm_unreachable(
-"BugReport::markInteresting currently can only handle 2 different "
-"tracking kinds! Please define what tracking kind should this entitiy"
-"have, if it was already marked as interesting with a different kind!");
+  llvm_unreachable(
+  "BugReport::markInteresting currently can only handle 2 different "
+  "tracking kinds! Please define what tracking kind should this entitiy"
+  "have, if it was already marked as interesting with a different kind!");
 }
 
 void PathSensitiveBugReport::markInteresting(SymbolRef sym,
Index: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h

[PATCH] D78126: [analyzer][NFC] Don't allow dependency checkers to emit diagnostics

2020-06-12 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added inline comments.



Comment at: clang/lib/StaticAnalyzer/Core/BugReporter.cpp:43
 #include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
+#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
 #include "llvm/ADT/ArrayRef.h"

Unfortunately, this include creates a circular dependency from 
StaticAnalyzer/Core to StaticAnalyzer/Frontend back to StaticAnalyzer/Core.

I'm hoping to figure out a fix that doesn't involve reverting it, but if you 
have a quick fix, that would be really great.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78126/new/

https://reviews.llvm.org/D78126



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81522: Fix variables used only in asserts.

2020-06-09 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
saugustine edited the summary of this revision.
saugustine added a reviewer: baloghadamsoftware.
Herald added a subscriber: rnkovacs.

Fix variables used only in asserts.

For post-commit review.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81522

Files:
  clang/unittests/StaticAnalyzer/ParamRegionTest.cpp


Index: clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
===
--- clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
+++ clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
@@ -20,8 +20,8 @@
 const StackFrameContext *SFC,
 const ParmVarDecl *PVD) {
 for (const auto *D2: PVD->redecls()) {
-  const auto *PVD2 = cast(D2);
-  assert(MRMgr.getVarRegion(PVD, SFC) == MRMgr.getVarRegion(PVD2, SFC));
+  assert(MRMgr.getVarRegion(PVD, SFC) ==
+ MRMgr.getVarRegion(cast(D2), SFC));
 }
   }
 
@@ -33,29 +33,26 @@
 
 if (const auto *FD = dyn_cast(D)) {
   for (const auto *P : FD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *CD = dyn_cast(D)) {
   for (const auto *P : CD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *MD = dyn_cast(D)) {
   for (const auto *P : MD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 }


Index: clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
===
--- clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
+++ clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
@@ -20,8 +20,8 @@
 const StackFrameContext *SFC,
 const ParmVarDecl *PVD) {
 for (const auto *D2: PVD->redecls()) {
-  const auto *PVD2 = cast(D2);
-  assert(MRMgr.getVarRegion(PVD, SFC) == MRMgr.getVarRegion(PVD2, SFC));
+  assert(MRMgr.getVarRegion(PVD, SFC) ==
+ MRMgr.getVarRegion(cast(D2), SFC));
 }
   }
 
@@ -33,29 +33,26 @@
 
 if (const auto *FD = dyn_cast(D)) {
   for (const auto *P : FD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *CD = dyn_cast(D)) {
   for (const auto *P : CD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *MD = dyn_cast(D)) {
   for (const auto *P : MD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81522: Fix variables used only in asserts.

2020-06-09 Thread Sterling Augustine via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGccd192204da4: Fix variables used only in asserts. (authored 
by saugustine).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81522/new/

https://reviews.llvm.org/D81522

Files:
  clang/unittests/StaticAnalyzer/ParamRegionTest.cpp


Index: clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
===
--- clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
+++ clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
@@ -20,8 +20,8 @@
 const StackFrameContext *SFC,
 const ParmVarDecl *PVD) {
 for (const auto *D2: PVD->redecls()) {
-  const auto *PVD2 = cast(D2);
-  assert(MRMgr.getVarRegion(PVD, SFC) == MRMgr.getVarRegion(PVD2, SFC));
+  assert(MRMgr.getVarRegion(PVD, SFC) ==
+ MRMgr.getVarRegion(cast(D2), SFC));
 }
   }
 
@@ -33,29 +33,26 @@
 
 if (const auto *FD = dyn_cast(D)) {
   for (const auto *P : FD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *CD = dyn_cast(D)) {
   for (const auto *P : CD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *MD = dyn_cast(D)) {
   for (const auto *P : MD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 }


Index: clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
===
--- clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
+++ clang/unittests/StaticAnalyzer/ParamRegionTest.cpp
@@ -20,8 +20,8 @@
 const StackFrameContext *SFC,
 const ParmVarDecl *PVD) {
 for (const auto *D2: PVD->redecls()) {
-  const auto *PVD2 = cast(D2);
-  assert(MRMgr.getVarRegion(PVD, SFC) == MRMgr.getVarRegion(PVD2, SFC));
+  assert(MRMgr.getVarRegion(PVD, SFC) ==
+ MRMgr.getVarRegion(cast(D2), SFC));
 }
   }
 
@@ -33,29 +33,26 @@
 
 if (const auto *FD = dyn_cast(D)) {
   for (const auto *P : FD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *CD = dyn_cast(D)) {
   for (const auto *P : CD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 } else if (const auto *MD = dyn_cast(D)) {
   for (const auto *P : MD->parameters()) {
-const TypedValueRegion *Reg = MRMgr.getVarRegion(P, SFC);
 if (SFC->inTopFrame())
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 else
-  assert(isa(Reg));
+  assert(isa(MRMgr.getVarRegion(P, SFC)));
 checkForSameParamRegions(MRMgr, SFC, P);
   }
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-06-09 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

Unfortunately, after this change there are several variables only used in 
asserts, which creates build failures when assertions are disabled.

I will be submitting https://reviews.llvm.org/D81522 shortly to fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80286/new/

https://reviews.llvm.org/D80286



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81432: Add #includes so that ROCm.h is compilable stand-alone.

2020-06-08 Thread Sterling Augustine via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf07b3d41e739: Add #includes so that ROCm.h is compilable 
stand-alone. (authored by saugustine).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81432/new/

https://reviews.llvm.org/D81432

Files:
  clang/lib/Driver/ToolChains/ROCm.h


Index: clang/lib/Driver/ToolChains/ROCm.h
===
--- clang/lib/Driver/ToolChains/ROCm.h
+++ clang/lib/Driver/ToolChains/ROCm.h
@@ -10,9 +10,14 @@
 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
 
 #include "clang/Basic/Cuda.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Driver/Driver.h"
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Option/ArgList.h"
 
 namespace clang {
 namespace driver {


Index: clang/lib/Driver/ToolChains/ROCm.h
===
--- clang/lib/Driver/ToolChains/ROCm.h
+++ clang/lib/Driver/ToolChains/ROCm.h
@@ -10,9 +10,14 @@
 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
 
 #include "clang/Basic/Cuda.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Driver/Driver.h"
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Option/ArgList.h"
 
 namespace clang {
 namespace driver {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81432: Add #includes so that ROCm.h is compilable stand-alone.

2020-06-08 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

For post-commit review.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81432/new/

https://reviews.llvm.org/D81432



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81432: Add #includes so that ROCm.h is compilable stand-alone.

2020-06-08 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
saugustine added reviewers: jyknight, echristo.
saugustine added a comment.

For post-commit review.


ROCm.h had been getting the declarations for various data structures
by being #included next to them, rather than #includeing them itself.

This change fixes that by explicitly including the appropriate headers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81432

Files:
  clang/lib/Driver/ToolChains/ROCm.h


Index: clang/lib/Driver/ToolChains/ROCm.h
===
--- clang/lib/Driver/ToolChains/ROCm.h
+++ clang/lib/Driver/ToolChains/ROCm.h
@@ -10,9 +10,14 @@
 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
 
 #include "clang/Basic/Cuda.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Driver/Driver.h"
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Option/ArgList.h"
 
 namespace clang {
 namespace driver {


Index: clang/lib/Driver/ToolChains/ROCm.h
===
--- clang/lib/Driver/ToolChains/ROCm.h
+++ clang/lib/Driver/ToolChains/ROCm.h
@@ -10,9 +10,14 @@
 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
 
 #include "clang/Basic/Cuda.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Driver/Driver.h"
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Option/ArgList.h"
 
 namespace clang {
 namespace driver {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70416: [Driver] Make -static-libgcc imply static libunwind

2020-04-23 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added inline comments.



Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1215
+else
+  CmdArgs.push_back("-l:libunwind.so");
 break;

itollefsen wrote:
> If you are building with `-DLIBUNWIND_ENABLE_SHARED:OFF 
> -DLIBUNWIND_ENABLE_STATIC:ON`, there's no shared version available. And vice 
> versa. This doesn't account for that.
Although true, I don't believe this is any different from the parallel libgcc 
situation. libgcc_eh is the static version, and will never be satisfied by the 
dynamic version. libgcc_s is the dynamic version, and can never satisfy the 
static version. See lines 1204-1208 above.

The case where you ask for a static compiler-rt but still want a dynamic unwind 
library is new. I'm not opposed to supporting it, but "what gcc does" isn't a 
terrible standard.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70416/new/

https://reviews.llvm.org/D70416



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73967: Implement _ExtInt as an extended int type specifier.

2020-04-17 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

Reverted in a4b88c044980337bb14390be654fe76864aa60ec 
. Happy to 
approve an updated change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73967/new/

https://reviews.llvm.org/D73967



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73967: Implement _ExtInt as an extended int type specifier.

2020-04-17 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

This change breaks the lldb build with

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:3958:11: error: 
enumeration values 'DependentExtInt' and 'ExtInt' not handled in switch 
[-Werror,-Wswitch]

  switch (qual_type->getTypeClass()) {
  ^

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4633:11: error: 
enumeration values 'DependentExtInt' and 'ExtInt' not handled in switch 
[-Werror,-Wswitch]

  switch (qual_type->getTypeClass()) {
  ^

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4889:11: error: 
enumeration values 'DependentExtInt' and 'ExtInt' not handled in switch 
[-Werror,-Wswitch]

  switch (qual_type->getTypeClass()) {

I would fix it, but I don't know the lldb code well enough.

I am reverting this change shortly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73967/new/

https://reviews.llvm.org/D73967



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75890: [libunwind] Remove __FILE__ and __LINE__ from error reporting

2020-03-10 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine accepted this revision.
saugustine added a comment.

This looks fine to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75890/new/

https://reviews.llvm.org/D75890



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70849: [AST] Traverse the class type loc inside the member pointer type loc.

2019-12-05 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added inline comments.



Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:1169
 DEF_TRAVERSE_TYPELOC(MemberPointerType, {
-  TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0)));
+  if (auto *TSI = TL.getClassTInfo())
+TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));

ilya-biryukov wrote:
> Can this actually happen in practice?
> Did we try doing **only** `TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()))` and 
> seeing whether this fails?
> 
> The code in `MemberPointerTypeLoc` suggests this can happen, but would be 
> interesting to find examples when it happens.
This can happen when traversing a TypeNodeLoc, and the assertion will fail. I'm 
reverting this change for now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70849/new/

https://reviews.llvm.org/D70849



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D71005: [AST] Enable expression of OpenCL language address spaces an attribute

2019-12-05 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

When I try to run tablegen on this file for clang/docs (as described in 
clang/docs/InternalsManual.rst), I get an error, introduced by this change:

$ ./bin/clang-tblgen -gen-attr-docs -I ../llvm-project/clang/include 
../llvm-project/clang/include/clang/Basic/Attr.td -o /tmp/AttributeReference.rst

../llvm-project/clang/include/clang/Basic/Attr.td:1137:1: error: This attribute 
requires a heading to be specified
def OpenCLConstantAddressSpace : TypeAttr {
^

I'm at a loss as to what is wrong, but I would like to revert this change until 
it is fixed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71005/new/

https://reviews.llvm.org/D71005



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70416: [Driver] Make -static-libgcc imply static libunwind

2019-11-19 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In D70416#1750978 , @joerg wrote:

> This is normally done by using `-Bstatic`/`-Bdynamic` around the library. See 
> `tools::addOpenMPRuntime`.


Historically, the unwind library is a little different. Gcc uses -llibgcc_eh 
for static links (which is only resolved by libgcc_eh.a) and libgcc_s.so for 
dynamic links (which is only resolved by libgcc_s.so, which in turn pulls in 
libgcc.a for certain things).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70416/new/

https://reviews.llvm.org/D70416



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64062: Remove __VERSION__

2019-07-13 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

From the failure mode I was seeing, any value at all for __VERSION__ will be 
fine, as long as it is a valid preprocessor string.

It would also solve this particular problem to not define __GNUC__, but I as 
that would create other, more severe, problems, as long as clang identifies 
itself as __GNUC__, we should maintain compatibility with it.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64062/new/

https://reviews.llvm.org/D64062



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64062: Remove __VERSION__

2019-07-12 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

The revert is at https://reviews.llvm.org/D64687, which I will commit shortly 
if there are no objections.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64062/new/

https://reviews.llvm.org/D64062



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64062: Remove __VERSION__

2019-07-12 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

This revision breaks python 2.7.16 builds, which are still supported by 
upstream python for a few more months. I'm preparing a revert.

The file is getcompiler.c:

/* Return the compiler identification, if possible. */

#include "Python.h"

#ifndef COMPILER

#ifdef __GNUC__
#define COMPILER "\n[GCC " __VERSION__ "]"
#endif

#endif /* !COMPILER */

#ifndef COMPILER

#ifdef __cplusplus
#define COMPILER "[C++]"
#else
#define COMPILER "[C]"
#endif

#endif /* !COMPILER */

const char *
Py_GetCompiler(void)
{

  return COMPILER;

}


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64062/new/

https://reviews.llvm.org/D64062



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59841: [Gnu Driver] If -pie and -static-pie are both passed, let -static-pie win.

2019-03-26 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added inline comments.



Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:311
   if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
-  Args.hasArg(options::OPT_r))
+  Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie))
 return false;

It's not clear to me that the command line -static-pie -no-pie should result in 
static-pie, given the way the rest of that function is coded.

I might make it a ternary enum: "nothing" "pie" "static-pie" with the last one 
winning. That method seems more consistent with current behavior.

This would allow anyone checking the state of pie to use a single function and 
just check the result.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59841/new/

https://reviews.llvm.org/D59841



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59387: Make getFullyQualifiedName qualify both the pointee and class type for member ptr types

2019-03-14 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine accepted this revision.
saugustine added a comment.
This revision is now accepted and ready to land.

This looks correct to me, thanks for the fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59387/new/

https://reviews.llvm.org/D59387



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D55016: Correctly support -shared-libgcc.

2019-01-10 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine closed this revision.
saugustine added a comment.

Committed with r350900.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55016/new/

https://reviews.llvm.org/D55016



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D55016: Correctly support -shared-libgcc.

2018-11-28 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
saugustine added a reviewer: echristo.
Herald added subscribers: cfe-commits, srhines.

Correctly support -shared-libgcc.


Repository:
  rC Clang

https://reviews.llvm.org/D55016

Files:
  lib/Driver/ToolChains/CommonArgs.cpp
  test/Driver/linux-ld.c


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -211,24 +211,19 @@
 // RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC %s
-// CHECK-CLANG-SHARED-LIBGCC: warning: argument unused during compilation: 
'-shared-libgcc'
-// This will be the correct check once the driver supports -shared-libgcc
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
+// CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
+// CHECK-CLANG-SHARED-LIBGCC: "-lc"
+// CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
 //
 // RUN: %clang -shared-libgcc -dynamic -no-canonical-prefixes %s -### -o %t.o 
2>&1 \
 // RUN: --target=x86_64-unknown-linux -rtlib=platform \
 // RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC-DYNAMIC %s
-// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: warning: argument unused during 
compilation: '-shared-libgcc'
-// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
-// This will be the correct check once the driver supports -shared-libgcc
-// SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
+// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
+// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lc"
+// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
 //
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=aarch64-linux-android -rtlib=platform \
Index: lib/Driver/ToolChains/CommonArgs.cpp
===
--- lib/Driver/ToolChains/CommonArgs.cpp
+++ lib/Driver/ToolChains/CommonArgs.cpp
@@ -1156,11 +1156,8 @@
   bool StaticLibgcc = Args.hasArg(options::OPT_static_libgcc) ||
   Args.hasArg(options::OPT_static);
 
-  // The driver ignores -shared-libgcc and therefore treats such cases as
-  // unspecified.  Breaking out the two variables as below makes the current
-  // behavior explicit.
-  bool UnspecifiedLibgcc = !StaticLibgcc;
-  bool SharedLibgcc = !StaticLibgcc;
+  bool SharedLibgcc = Args.hasArg(options::OPT_shared_libgcc);
+  bool UnspecifiedLibgcc = !StaticLibgcc && !SharedLibgcc;
 
   // Gcc adds libgcc arguments in various ways:
   //
@@ -1177,7 +1174,7 @@
   if (LibGccFirst)
 CmdArgs.push_back("-lgcc");
 
-  bool AsNeeded = D.CCCIsCC() && !StaticLibgcc && !isAndroid && !isCygMing;
+  bool AsNeeded = D.CCCIsCC() && UnspecifiedLibgcc && !isAndroid && !isCygMing;
   if (AsNeeded)
 CmdArgs.push_back("--as-needed");
 


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -211,24 +211,19 @@
 // RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC %s
-// CHECK-CLANG-SHARED-LIBGCC: warning: argument unused during compilation: '-shared-libgcc'
-// This will be the correct check once the driver supports -shared-libgcc
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
+// CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
+// CHECK-CLANG-SHARED-LIBGCC: "-lc"
+// CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
 //
 // RUN: %clang -shared-libgcc -dynamic -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=x86_64-unknown-linux -rtlib=platform \
 // RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC-DYNAMIC %s
-// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: warning: argument unused during compilation: '-shared-libgcc'
-// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// This will be the correct check once the driver supports -shared-libgcc
-// SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
-// SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: 

[PATCH] D51521: Refactor Addlibgcc to make the when and what logic more straightfoward.

2018-08-31 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine closed this revision.
saugustine added a comment.

commited as r341231.


Repository:
  rC Clang

https://reviews.llvm.org/D51521



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51521: Refactor Addlibgcc to make the when and what logic more straightfoward.

2018-08-30 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
saugustine added a reviewer: srhines.
Herald added a subscriber: cfe-commits.

Refactor Addlibgcc to make the when and what logic more straightfoward.

No functional change. A forthcoming change will add support
for -shared-libgcc.


Repository:
  rC Clang

https://reviews.llvm.org/D51521

Files:
  lib/Driver/ToolChains/CommonArgs.cpp
  test/Driver/linux-ld.c


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -230,6 +230,30 @@
 // SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lc"
 // SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
 //
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=aarch64-linux-android -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-ANDROID-NONE %s
+// CHECK-CLANG-ANDROID-NONE: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-ANDROID-NONE: "-lgcc" "-ldl" "-lc"
+//
+// RUN: %clang -shared -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=aarch64-linux-android -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-ANDROID-SHARED %s
+// CHECK-CLANG-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-ANDROID-SHARED: "-lgcc" "-ldl" "-lc"
+//
+// RUN: %clang -static -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=aarch64-linux-android -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-ANDROID-STATIC %s
+// CHECK-CLANG-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-ANDROID-STATIC: "--start-group" "-lgcc" "-lc" "--end-group"
+//
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1  \
 // RUN: --target=x86_64-unknown-linux -rtlib=platform \
 // RUN: -static \
Index: lib/Driver/ToolChains/CommonArgs.cpp
===
--- lib/Driver/ToolChains/CommonArgs.cpp
+++ lib/Driver/ToolChains/CommonArgs.cpp
@@ -1126,23 +1126,42 @@
   bool IsIAMCU = Triple.isOSIAMCU();
   bool StaticLibgcc = Args.hasArg(options::OPT_static_libgcc) ||
   Args.hasArg(options::OPT_static);
-  if (!D.CCCIsCXX())
+
+  // The driver ignores -shared-libgcc and therefore treats such cases as
+  // unspecified.  Breaking out the two variables as below makes the current
+  // behavior explicit.
+  bool UnspecifiedLibgcc = !StaticLibgcc;
+  bool SharedLibgcc = !StaticLibgcc;
+
+  // Gcc adds libgcc arguments in various ways:
+  //
+  // gcc : -lgcc --as-needed -lgcc_s --no-as-needed
+  // g++ :   -lgcc_s   -lgcc
+  // gcc shared:   -lgcc_s   -lgcc
+  // g++ shared:   -lgcc_s   -lgcc
+  // gcc static: -lgcc -lgcc_eh
+  // g++ static: -lgcc -lgcc_eh
+  //
+  // Also, certain targets need additional adjustments.
+
+  bool LibGccFirst = (D.CCCIsCC() && UnspecifiedLibgcc) || StaticLibgcc;
+  if (LibGccFirst)
 CmdArgs.push_back("-lgcc");
 
-  if (StaticLibgcc || isAndroid) {
-if (D.CCCIsCXX())
-  CmdArgs.push_back("-lgcc");
-  } else {
-if (!D.CCCIsCXX() && !isCygMing)
-  CmdArgs.push_back("--as-needed");
+  bool AsNeeded = D.CCCIsCC() && !StaticLibgcc && !isAndroid && !isCygMing;
+  if (AsNeeded)
+CmdArgs.push_back("--as-needed");
+
+  if ((UnspecifiedLibgcc || SharedLibgcc) && !isAndroid)
 CmdArgs.push_back("-lgcc_s");
-if (!D.CCCIsCXX() && !isCygMing)
-  CmdArgs.push_back("--no-as-needed");
-  }
 
-  if (StaticLibgcc && !isAndroid && !IsIAMCU)
+  else if (StaticLibgcc && !isAndroid && !IsIAMCU)
 CmdArgs.push_back("-lgcc_eh");
-  else if (!Args.hasArg(options::OPT_shared) && D.CCCIsCXX())
+
+  if (AsNeeded)
+CmdArgs.push_back("--no-as-needed");
+
+  if (!LibGccFirst)
 CmdArgs.push_back("-lgcc");
 
   // According to Android ABI, we have to link with libdl if we are


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -230,6 +230,30 @@
 // SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lc"
 // SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
 //
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=aarch64-linux-android -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-ANDROID-NONE %s
+// CHECK-CLANG-ANDROID-NONE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-ANDROID-NONE: "-lgcc" "-ldl" "-lc"
+//
+// RUN: %clang -shared 

[PATCH] D51007: Test the cross-product of options that affect how libgcc-related arguments are passed to the linker.

2018-08-30 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine closed this revision.
saugustine added a comment.

Committed as https://reviews.llvm.org/rL341083


Repository:
  rC Clang

https://reviews.llvm.org/D51007



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51007: Test the cross-product of options that affect how libgcc-related arguments are passed to the linker.

2018-08-20 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

I am refactoring the code that does this, in preparation for adding support for 
-shared-libgcc, and, after that, shared compiler-rt. These tests are to defend 
against mistakes in that refactoring and prepare for correct handling of the 
other cases.


Repository:
  rC Clang

https://reviews.llvm.org/D51007



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51007: Test the cross-product of options that affect how libgcc-related arguments are passed to the linker.

2018-08-20 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
saugustine added a reviewer: echristo.
Herald added a subscriber: cfe-commits.

NFC. Add tests to verify how the driver passes libgcc arguments to the linker


Repository:
  rC Clang

https://reviews.llvm.org/D51007

Files:
  test/Driver/linux-ld.c


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -150,6 +150,88 @@
 //
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC %s
+// CHECK-CLANG-NO-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-NO-LIBGCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// CHECK-CLANG-NO-LIBGCC: "-lc"
+// CHECK-CLANG-NO-LIBGCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+//
+// RUN: %clang++ -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANGXX-NO-LIBGCC %s
+// CHECK-CLANGXX-NO-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANGXX-NO-LIBGCC: "-lgcc_s" "-lgcc"
+// CHECK-CLANGXX-NO-LIBGCC: "-lc"
+// CHECK-CLANGXX-NO-LIBGCC: "-lgcc_s" "-lgcc"
+//
+// RUN: %clang -static -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC-STATIC %s
+// CHECK-CLANG-NO-LIBGCC-STATIC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-NO-LIBGCC-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" 
"--end-group"
+//
+// RUN: %clang -dynamic -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC-DYNAMIC %s
+// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lgcc" "--as-needed" "-lgcc_s" 
"--no-as-needed"
+// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lc"
+// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lgcc" "--as-needed" "-lgcc_s" 
"--no-as-needed"
+//
+// RUN: %clang -static-libgcc -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-STATIC-LIBGCC %s
+// CHECK-CLANG-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
+// CHECK-CLANG-STATIC-LIBGCC: "-lc"
+// CHECK-CLANG-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
+//
+// RUN: %clang -static-libgcc -dynamic -no-canonical-prefixes %s -### -o %t.o 
2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-STATIC-LIBGCC-DYNAMIC %s
+// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lgcc" "-lgcc_eh"
+// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lc"
+// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lgcc" "-lgcc_eh"
+//
+// RUN: %clang -shared-libgcc -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC %s
+// CHECK-CLANG-SHARED-LIBGCC: warning: argument unused during compilation: 
'-shared-libgcc'
+// This will be the correct check once the driver supports -shared-libgcc
+// SKIP-CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
+// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lc"
+// SKIP-CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
+//
+// RUN: %clang -shared-libgcc -dynamic -no-canonical-prefixes %s -### -o %t.o 
2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC-DYNAMIC %s
+// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: warning: argument unused during 
compilation: '-shared-libgcc'
+// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" 
"--sysroot=[[SYSROOT:[^"]+]]"
+// This will be the correct check once the driver supports -shared-libgcc
+// SKIP-CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
+// 

[PATCH] D36610: [Tooling] Add option to getFullyQualifiedName using a custom PritingPolicy

2018-05-03 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D36610#1083952, @mikhail.ramalho wrote:

> Ping.


Given that richard smith is the only non-approver, and that he hasn't 
responded, and that I contributed this code, I'm going to make an executive 
decision and say that this is OK to submit.

We will roll back if there are problems.


https://reviews.llvm.org/D36610



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36431: Add powerpc64 to compiler-rt build infrastructure.

2017-11-30 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine closed this revision.
saugustine added a comment.

Committed as https://reviews.llvm.org/rL319474.


https://reviews.llvm.org/D36431



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36555: Move x86-specific sources to x86-specific source lists.

2017-11-30 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine closed this revision.
saugustine added a comment.

Committed as R319464.


https://reviews.llvm.org/D36555



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36431: Add powerpc64 to compiler-rt build infrastructure.

2017-11-30 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D36431#940169, @nemanjai wrote:

> This has been sitting in approved state for more than 2 months. As far as I 
> can tell, it wasn't committed. Do you plan to commit this soon or are you 
> abandoning it for some reason?


My apologies. I have gotten distracted by other things and will get this 
submitted shortly.


https://reviews.llvm.org/D36431



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36555: Move x86-specific sources to x86-specific source lists.

2017-08-22 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine updated this revision to Diff 112244.
saugustine added a comment.

Remove two files inadvertantly included in last patch.


https://reviews.llvm.org/D36555

Files:
  compiler-rt/lib/builtins/CMakeLists.txt

Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -51,7 +51,6 @@
   cmpti2.c
   comparedf2.c
   comparesf2.c
-  cpu_model.c
   ctzdi2.c
   ctzsi2.c
   ctzti2.c
@@ -66,7 +65,6 @@
   divtc3.c
   divti3.c
   divtf3.c
-  divxc3.c
   extendsfdf2.c
   extendhfsf2.c
   ffsdi2.c
@@ -84,27 +82,18 @@
   fixunssfdi.c
   fixunssfsi.c
   fixunssfti.c
-  fixunsxfdi.c
-  fixunsxfsi.c
-  fixunsxfti.c
-  fixxfdi.c
-  fixxfti.c
   floatdidf.c
   floatdisf.c
-  floatdixf.c
   floatsidf.c
   floatsisf.c
   floattidf.c
   floattisf.c
-  floattixf.c
   floatundidf.c
   floatundisf.c
-  floatundixf.c
   floatunsidf.c
   floatunsisf.c
   floatuntidf.c
   floatuntisf.c
-  floatuntixf.c
   int_util.c
   lshrdi3.c
   lshrti3.c
@@ -124,7 +113,6 @@
   mulvdi3.c
   mulvsi3.c
   mulvti3.c
-  mulxc3.c
   negdf2.c
   negdi2.c
   negsf2.c
@@ -142,7 +130,6 @@
   powidf2.c
   powisf2.c
   powitf2.c
-  powixf2.c
   subdf3.c
   subsf3.c
   subvdi3.c
@@ -226,6 +213,23 @@
 clear_cache.c)
 endif()
 
+# These sources work on all x86 variants, but only x86 variants.
+set(x86_ARCH_SOURCES
+  cpu_model.c
+  divxc3.c
+  fixxfdi.c
+  fixxfti.c
+  fixunsxfdi.c
+  fixunsxfsi.c
+  fixunsxfti.c
+  floatdixf.c
+  floattixf.c
+  floatundixf.c
+  floatuntixf.c
+  mulxc3.c
+  powixf2.c
+)
+
 if (NOT MSVC)
   set(x86_64_SOURCES
   x86_64/chkstk.S
@@ -288,6 +292,11 @@
   set(i686_SOURCES ${i386_SOURCES})
 endif () # if (NOT MSVC)
 
+set(x86_64h_SOURCES ${x86_64h_SOURCES} ${x86_ARCH_SOURCES})
+set(x86_64_SOURCES ${x86_64_SOURCES} ${x86_ARCH_SOURCES})
+set(i386_SOURCES ${i386_SOURCES} ${x86_ARCH_SOURCES})
+set(i686_SOURCES ${i686_SOURCES} ${x86_ARCH_SOURCES})
+
 set(arm_SOURCES
   arm/bswapdi2.S
   arm/bswapsi2.S
@@ -458,6 +467,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36555: Move x86-specific sources to x86-specific source lists.

2017-08-22 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a reviewer: weimingz.
saugustine added inline comments.



Comment at: compiler-rt/lib/builtins/CMakeLists.txt:223
+  cpu_model.c
+  divxc3.c
+  fixxfdi.c

mgorny wrote:
> This and the following files have only:
> 
> ```
> #if !_ARCH_PPC
> ```
> 
> so I suppose it's currently included on more targets than x86. If it's really 
> not useful there, I think it'd be better to update the `#if`s first (and 
> preferably get the author to review).
As discussed in D36764, these all assume 80-bit floats, and therefore are only 
useful on x86 (and ancient 68ks)--and, in fact, the tests for these functions 
are disabled for everything but x86. I have left these #ifs in for now, but 
will remove them after this patch gets submitted (and add comments about them 
needing 80-bit floats). Otherwise, powerpc builds will be broken.


https://reviews.llvm.org/D36555



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36555: Move x86-specific sources to x86-specific source lists.

2017-08-22 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine updated this revision to Diff 112242.
saugustine added a comment.

Thanks for the various comments. Please take another look.


https://reviews.llvm.org/D36555

Files:
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/builtin-config-ix.cmake
  compiler-rt/lib/builtins/CMakeLists.txt

Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -51,7 +51,6 @@
   cmpti2.c
   comparedf2.c
   comparesf2.c
-  cpu_model.c
   ctzdi2.c
   ctzsi2.c
   ctzti2.c
@@ -66,7 +65,6 @@
   divtc3.c
   divti3.c
   divtf3.c
-  divxc3.c
   extendsfdf2.c
   extendhfsf2.c
   ffsdi2.c
@@ -84,27 +82,18 @@
   fixunssfdi.c
   fixunssfsi.c
   fixunssfti.c
-  fixunsxfdi.c
-  fixunsxfsi.c
-  fixunsxfti.c
-  fixxfdi.c
-  fixxfti.c
   floatdidf.c
   floatdisf.c
-  floatdixf.c
   floatsidf.c
   floatsisf.c
   floattidf.c
   floattisf.c
-  floattixf.c
   floatundidf.c
   floatundisf.c
-  floatundixf.c
   floatunsidf.c
   floatunsisf.c
   floatuntidf.c
   floatuntisf.c
-  floatuntixf.c
   int_util.c
   lshrdi3.c
   lshrti3.c
@@ -124,7 +113,6 @@
   mulvdi3.c
   mulvsi3.c
   mulvti3.c
-  mulxc3.c
   negdf2.c
   negdi2.c
   negsf2.c
@@ -142,7 +130,6 @@
   powidf2.c
   powisf2.c
   powitf2.c
-  powixf2.c
   subdf3.c
   subsf3.c
   subvdi3.c
@@ -226,6 +213,23 @@
 clear_cache.c)
 endif()
 
+# These sources work on all x86 variants, but only x86 variants.
+set(x86_ARCH_SOURCES
+  cpu_model.c
+  divxc3.c
+  fixxfdi.c
+  fixxfti.c
+  fixunsxfdi.c
+  fixunsxfsi.c
+  fixunsxfti.c
+  floatdixf.c
+  floattixf.c
+  floatundixf.c
+  floatuntixf.c
+  mulxc3.c
+  powixf2.c
+)
+
 if (NOT MSVC)
   set(x86_64_SOURCES
   x86_64/chkstk.S
@@ -288,6 +292,11 @@
   set(i686_SOURCES ${i386_SOURCES})
 endif () # if (NOT MSVC)
 
+set(x86_64h_SOURCES ${x86_64h_SOURCES} ${x86_ARCH_SOURCES})
+set(x86_64_SOURCES ${x86_64_SOURCES} ${x86_ARCH_SOURCES})
+set(i386_SOURCES ${i386_SOURCES} ${x86_ARCH_SOURCES})
+set(i686_SOURCES ${i686_SOURCES} ${x86_ARCH_SOURCES})
+
 set(arm_SOURCES
   arm/bswapdi2.S
   arm/bswapsi2.S
@@ -458,6 +467,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/cmake/builtin-config-ix.cmake
===
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
+  check_symbol_exists(__powerpc64__ "" __PPC64)
+  check_symbol_exists(__powerpc64le__ "" __PPC64LE)
   check_symbol_exists(__s390x__ "" __S390X)
   check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
   check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
@@ -184,6 +186,10 @@
 add_default_target_arch(mips64)
   elseif(__MIPS)
 add_default_target_arch(mips)
+  elseif(__PPC64)
+add_default_target_arch(powerpc64)
+  elseif(__PPC64LE)
+add_default_target_arch(powerpc64le)
   elseif(__S390X)
 add_default_target_arch(s390x)
   elseif(__WEBASSEMBLY32)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36764: The following functions and tests work fine for powerpc64, so enable them.

2017-08-22 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

OK. I understand how these should work now.

As they are 80-bit specific, I am going to abandon this change and add them to 
my other patch which moves 80-bit specific floats and tests to x86-specific 
lists.


https://reviews.llvm.org/D36764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36764: The following functions and tests work fine for powerpc64, so enable them.

2017-08-16 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

Anyone have any opinions on this?


https://reviews.llvm.org/D36764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36764: The following functions and tests work fine for powerpc64, so enable them.

2017-08-15 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.

These functions were disabled for powerpc in the initial
checkin all the way back in 2009. The reasons why are lost to history,
but they work fine with modern clang and powerpc64.  I have no way
to test them on 32-bit systems, but will clean this up if the someone
finds a failure.


https://reviews.llvm.org/D36764

Files:
  compiler-rt/lib/builtins/divxc3.c
  compiler-rt/lib/builtins/mulxc3.c
  compiler-rt/lib/builtins/powixf2.c
  compiler-rt/test/builtins/Unit/divxc3_test.c
  compiler-rt/test/builtins/Unit/mulxc3_test.c
  compiler-rt/test/builtins/Unit/powixf2_test.c

Index: compiler-rt/test/builtins/Unit/powixf2_test.c
===
--- compiler-rt/test/builtins/Unit/powixf2_test.c
+++ compiler-rt/test/builtins/Unit/powixf2_test.c
@@ -1,5 +1,4 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// UNSUPPORTED: powerpc64
 //===-- powixf2_test.cpp - Test __powixf2 -===//
 //
 // The LLVM Compiler Infrastructure
@@ -13,8 +12,6 @@
 //
 //===--===//
 
-#if !_ARCH_PPC
-
 #include "int_lib.h"
 #include 
 #include 
@@ -33,11 +30,8 @@
 return !correct;
 }
 
-#endif
-
 int main()
 {
-#if !_ARCH_PPC
 if (test__powixf2(0, 0, 1))
 return 1;
 if (test__powixf2(1, 0, 1))
@@ -227,8 +221,5 @@
 if (test__powixf2(-2, -31, -1/2147483648.))
 return 1;
 
-#else
-printf("skipped\n");
-#endif
 return 0;
 }
Index: compiler-rt/test/builtins/Unit/mulxc3_test.c
===
--- compiler-rt/test/builtins/Unit/mulxc3_test.c
+++ compiler-rt/test/builtins/Unit/mulxc3_test.c
@@ -1,5 +1,4 @@
 // RUN: %clang_builtins %s %librt -lm -o %t && %run %t
-// UNSUPPORTED: powerpc64
 //===-- mulxc3_test.c - Test __mulxc3 -===//
 //
 // The LLVM Compiler Infrastructure
@@ -13,8 +12,6 @@
 //
 //===--===//
 
-#if !_ARCH_PPC
-
 #include "int_lib.h"
 #include 
 #include 
@@ -357,11 +354,8 @@
 
 };
 
-#endif
-
 int main()
 {
-#if !_ARCH_PPC
 const unsigned N = sizeof(x) / sizeof(x[0]);
 unsigned i, j;
 for (i = 0; i < N; ++i)
@@ -373,8 +367,5 @@
 }
 }
 
-#else
-printf("skipped\n");
-#endif
 return 0;
 }
Index: compiler-rt/test/builtins/Unit/divxc3_test.c
===
--- compiler-rt/test/builtins/Unit/divxc3_test.c
+++ compiler-rt/test/builtins/Unit/divxc3_test.c
@@ -1,5 +1,4 @@
 // RUN: %clang_builtins %s %librt -lm -o %t && %run %t
-// UNSUPPORTED: powerpc64
 //===-- divxc3_test.c - Test __divxc3 -===//
 //
 // The LLVM Compiler Infrastructure
@@ -13,8 +12,6 @@
 //
 //===--===//
 
-#if !_ARCH_PPC
-
 #include "int_lib.h"
 #include 
 #include 
@@ -361,11 +358,8 @@
 
 };
 
-#endif
-
 int main()
 {
-#if !_ARCH_PPC
 const unsigned N = sizeof(x) / sizeof(x[0]);
 unsigned i, j;
 for (i = 0; i < N; ++i)
@@ -377,8 +371,5 @@
 }
 }
 
-#else
-printf("skipped\n");
-#endif
 return 0;
 }
Index: compiler-rt/lib/builtins/powixf2.c
===
--- compiler-rt/lib/builtins/powixf2.c
+++ compiler-rt/lib/builtins/powixf2.c
@@ -12,8 +12,6 @@
  * ===--===
  */
 
-#if !_ARCH_PPC
-
 #include "int_lib.h"
 
 /* Returns: a ^ b */
@@ -34,5 +32,3 @@
 }
 return recip ? 1/r : r;
 }
-
-#endif
Index: compiler-rt/lib/builtins/mulxc3.c
===
--- compiler-rt/lib/builtins/mulxc3.c
+++ compiler-rt/lib/builtins/mulxc3.c
@@ -12,8 +12,6 @@
  * ===--===
  */
 
-#if !_ARCH_PPC
-
 #include "int_lib.h"
 #include "int_math.h"
 
@@ -73,5 +71,3 @@
 }
 return z;
 }
-
-#endif
Index: compiler-rt/lib/builtins/divxc3.c
===
--- compiler-rt/lib/builtins/divxc3.c
+++ compiler-rt/lib/builtins/divxc3.c
@@ -11,8 +11,6 @@
  *
  */
 
-#if !_ARCH_PPC
-
 #include "int_lib.h"
 #include "int_math.h"
 
@@ -59,5 +57,3 @@
 }
 return z;
 }
-
-#endif
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36555: Move x86-specific sources to x86-specific source lists.

2017-08-14 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

I've cleaned up this patch a bit. Now the only files that are in the x86_ARCH 
group are those that require 80 bits floats and cpu_model.c. Tests for all of 
these were already disabled on arm and powerpc (because neither has 80-bit 
floats), so we knew these library functions don't work on arm, but we compiled 
them anyway. It makes more sense to just not compile them at all if we know 
they require something the target architecture doesn't support.

I'm cc'ing some relevant people on this. The arm folks can comment on this 
patch (and I will add them to review) if there is a problem.

In https://reviews.llvm.org/D36555#839829, @mgorny wrote:

> Also, I think that if you're splitting them up, it'd also logical to move 
> them into a subdirectory, `x86-common` maybe.


I'm reluctant to do this because that would require adding another layer to the 
file the filtering code around line 526, and that already has some special 
casing and is a bit hard to follow. Nevertheless, if you insist, I will.


https://reviews.llvm.org/D36555



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36610: [Tooling] Add option to getFullyQualifiedName using a custom PritingPolicy

2017-08-11 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine accepted this revision.
saugustine added a comment.
This revision is now accepted and ready to land.

This is a good change as far as functionality, but I defer to others on the 
style and other details.


https://reviews.llvm.org/D36610



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36555: Move x86-specific sources to x86-specific source lists.

2017-08-09 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
Herald added a subscriber: mgorny.

https://reviews.llvm.org/D36555

Files:
  compiler-rt/lib/builtins/CMakeLists.txt


Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -51,7 +51,6 @@
   cmpti2.c
   comparedf2.c
   comparesf2.c
-  cpu_model.c
   ctzdi2.c
   ctzsi2.c
   ctzti2.c
@@ -66,7 +65,6 @@
   divtc3.c
   divti3.c
   divtf3.c
-  divxc3.c
   extendsfdf2.c
   extendhfsf2.c
   ffsdi2.c
@@ -84,22 +82,17 @@
   fixunssfdi.c
   fixunssfsi.c
   fixunssfti.c
-  fixunsxfdi.c
-  fixunsxfsi.c
   fixunsxfti.c
-  fixxfdi.c
   fixxfti.c
   floatdidf.c
   floatdisf.c
-  floatdixf.c
   floatsidf.c
   floatsisf.c
   floattidf.c
   floattisf.c
   floattixf.c
   floatundidf.c
   floatundisf.c
-  floatundixf.c
   floatunsidf.c
   floatunsisf.c
   floatuntidf.c
@@ -124,7 +117,6 @@
   mulvdi3.c
   mulvsi3.c
   mulvti3.c
-  mulxc3.c
   negdf2.c
   negdi2.c
   negsf2.c
@@ -142,7 +134,6 @@
   powidf2.c
   powisf2.c
   powitf2.c
-  powixf2.c
   subdf3.c
   subsf3.c
   subvdi3.c
@@ -226,6 +217,18 @@
 clear_cache.c)
 endif()
 
+# These sources work on all x86 variants, but only x86 variants.
+set(x86_ARCH_SOURCES
+  cpu_model.c
+  divxc3.c
+  fixxfdi.c
+  fixunsxfdi.c
+  fixunsxfsi.c
+  floatdixf.c
+  floatundixf.c
+  mulxc3.c
+  powixf2.c)
+
 if (NOT MSVC)
   set(x86_64_SOURCES
   x86_64/chkstk.S
@@ -288,6 +291,11 @@
   set(i686_SOURCES ${i386_SOURCES})
 endif () # if (NOT MSVC)
 
+set(x86_64h_SOURCES ${x86_64h_SOURCES} ${x86_ARCH_SOURCES})
+set(x86_64_SOURCES ${x86_64_SOURCES} ${x86_ARCH_SOURCES})
+set(i386_SOURCES ${i386_SOURCES} ${x86_ARCH_SOURCES})
+set(i686_SOURCES ${i686_SOURCES} ${x86_ARCH_SOURCES})
+
 set(arm_SOURCES
   arm/bswapdi2.S
   arm/bswapsi2.S


Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -51,7 +51,6 @@
   cmpti2.c
   comparedf2.c
   comparesf2.c
-  cpu_model.c
   ctzdi2.c
   ctzsi2.c
   ctzti2.c
@@ -66,7 +65,6 @@
   divtc3.c
   divti3.c
   divtf3.c
-  divxc3.c
   extendsfdf2.c
   extendhfsf2.c
   ffsdi2.c
@@ -84,22 +82,17 @@
   fixunssfdi.c
   fixunssfsi.c
   fixunssfti.c
-  fixunsxfdi.c
-  fixunsxfsi.c
   fixunsxfti.c
-  fixxfdi.c
   fixxfti.c
   floatdidf.c
   floatdisf.c
-  floatdixf.c
   floatsidf.c
   floatsisf.c
   floattidf.c
   floattisf.c
   floattixf.c
   floatundidf.c
   floatundisf.c
-  floatundixf.c
   floatunsidf.c
   floatunsisf.c
   floatuntidf.c
@@ -124,7 +117,6 @@
   mulvdi3.c
   mulvsi3.c
   mulvti3.c
-  mulxc3.c
   negdf2.c
   negdi2.c
   negsf2.c
@@ -142,7 +134,6 @@
   powidf2.c
   powisf2.c
   powitf2.c
-  powixf2.c
   subdf3.c
   subsf3.c
   subvdi3.c
@@ -226,6 +217,18 @@
 clear_cache.c)
 endif()
 
+# These sources work on all x86 variants, but only x86 variants.
+set(x86_ARCH_SOURCES
+  cpu_model.c
+  divxc3.c
+  fixxfdi.c
+  fixunsxfdi.c
+  fixunsxfsi.c
+  floatdixf.c
+  floatundixf.c
+  mulxc3.c
+  powixf2.c)
+
 if (NOT MSVC)
   set(x86_64_SOURCES
   x86_64/chkstk.S
@@ -288,6 +291,11 @@
   set(i686_SOURCES ${i386_SOURCES})
 endif () # if (NOT MSVC)
 
+set(x86_64h_SOURCES ${x86_64h_SOURCES} ${x86_ARCH_SOURCES})
+set(x86_64_SOURCES ${x86_64_SOURCES} ${x86_ARCH_SOURCES})
+set(i386_SOURCES ${i386_SOURCES} ${x86_ARCH_SOURCES})
+set(i686_SOURCES ${i686_SOURCES} ${x86_ARCH_SOURCES})
+
 set(arm_SOURCES
   arm/bswapdi2.S
   arm/bswapsi2.S
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36431: Add powerpc64 to compiler-rt build infrastructure.

2017-08-08 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D36431#835165, @nemanjai wrote:

> This patch appears to be perfectly fine. However, it triggers a large number 
> of warnings. Namely, there's a large number of `warning: ISO C forbids an 
> empty translation unit [-Wpedantic]` warnings produced.


What config are the buildbots using? I don't see these warnings in default or 
RELEASE style builds. I'm happy to fix them though.

> The reason is that all the code in the file is wrapped with an `if 
> !_ARCH_PPC` macro. I assume that we do not want `compiler_rt` to expose 
> builtins that assume an 80-bit `long double` (which is the behaviour we get 
> now). So it seems to me that files that define such builtins should simply be 
> removed from the `powerpc64_SOURCES` and they should `#error` on PPC.

I think it is better to mark plain powerpc (32) as unsupported in the 
testsuite, for similar reasons to marking powerpc64 unsupported. Whoever 
originally #ifdefed these did it in a way that is misleading.  See the comments 
on https://reviews.llvm.org/D36249 for my reasoning.

> Also, I'm getting lots of warnings from `compiler-rt/lib/builtins/atomic.c` 
> such as `warning: implicit declaration of function '__c11_atomic_fetch_or' 
> [-Wimplicit-function-declaration]`. It would appear that the `__c11_atomic_*` 
> family of builtins isn't exposed by the build compiler (and should presumably 
> be declared in a header if file is being built with a compiler that doesn't 
> expose those).

What config do the buildbots use? I don't see these errors with DEBUG or 
RELEASE. I'm happy to fix them regardless, but I'd like to be able to 
anticipate these problems.


https://reviews.llvm.org/D36431



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36249: Mark tests that need intel 80-bit floats as x86-only

2017-08-03 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

Landed as r309973


Repository:
  rL LLVM

https://reviews.llvm.org/D36249



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36249: Mark tests that need intel 80-bit floats as x86-only

2017-08-03 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D36249#830121, @weimingz wrote:

> I tried to address it via checking pre-defined macros:
>  https://reviews.llvm.org/D31573
>
> As long as the macros are defined correctly by clang, we don't need to worry 
> about the specific target machine. How do you think about it?


I like the idea of a feature check, rather than a specific architecture 
check--that is clearly the right thing to do.

On the other hand, I would like to mark the test as unsupported and not run in 
that case, rather than running it, saying it passed, but not actually testing 
anything. That better reflects the state of the implementation. Unfortunately, 
I don't think that can be done with macro checks. So my preference would be 
this patch over https://reviews.llvm.org/D31573, but I would also find 
https://reviews.llvm.org/D31573 acceptable if it came to that.

Finally, 80-bit doubles are a bit of a historical artifact these days. Only x86 
and m68k have them (and not even all m68Ks either). So I don't think it matters 
that much.


Repository:
  rL LLVM

https://reviews.llvm.org/D36249



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36249: Mark tests that need intel 80-bit floats as x86-only

2017-08-02 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.

These tests assume intel-80 bit floats, as noted in their comments. Rather than 
having each target discover the incompatibility and disable them ad-hoc, mark 
them as requiring x86.


Repository:
  rL LLVM

https://reviews.llvm.org/D36249

Files:
  compiler-rt/test/builtins/Unit/fixunsxfti_test.c
  compiler-rt/test/builtins/Unit/fixxfti_test.c
  compiler-rt/test/builtins/Unit/floattixf_test.c
  compiler-rt/test/builtins/Unit/floatuntixf_test.c


Index: compiler-rt/test/builtins/Unit/floatuntixf_test.c
===
--- compiler-rt/test/builtins/Unit/floatuntixf_test.c
+++ compiler-rt/test/builtins/Unit/floatuntixf_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- floatuntixf.c - Test __floatuntixf 
===//
 //
Index: compiler-rt/test/builtins/Unit/floattixf_test.c
===
--- compiler-rt/test/builtins/Unit/floattixf_test.c
+++ compiler-rt/test/builtins/Unit/floattixf_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- floattixf.c - Test __floattixf 
===//
 //
Index: compiler-rt/test/builtins/Unit/fixxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixxfti_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- fixxfti_test.c - Test __fixxfti 
---===//
 //
Index: compiler-rt/test/builtins/Unit/fixunsxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixunsxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixunsxfti_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- fixunsxfti_test.c - Test __fixunsxfti 
-===//
 //


Index: compiler-rt/test/builtins/Unit/floatuntixf_test.c
===
--- compiler-rt/test/builtins/Unit/floatuntixf_test.c
+++ compiler-rt/test/builtins/Unit/floatuntixf_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- floatuntixf.c - Test __floatuntixf ===//
 //
Index: compiler-rt/test/builtins/Unit/floattixf_test.c
===
--- compiler-rt/test/builtins/Unit/floattixf_test.c
+++ compiler-rt/test/builtins/Unit/floattixf_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- floattixf.c - Test __floattixf ===//
 //
Index: compiler-rt/test/builtins/Unit/fixxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixxfti_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- fixxfti_test.c - Test __fixxfti ---===//
 //
Index: compiler-rt/test/builtins/Unit/fixunsxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixunsxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixunsxfti_test.c
@@ -1,8 +1,5 @@
 // RUN: %clang_builtins %s %librt -o %t && %run %t
-// XFAIL: aarch64
-// test fails for aarch64 (see pr32260)
-
-// UNSUPPORTED: mips
+// REQUIRES: x86-target-arch
 
 //===-- fixunsxfti_test.c - Test __fixunsxfti -===//
 //
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36108: Add powerpc64 to compiler-rt build infrastructure.

2017-07-31 Thread Sterling Augustine via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL309634: Add powerpc64 to compiler-rt build infrastructure. 
(authored by saugustine).

Changed prior to commit:
  https://reviews.llvm.org/D36108?vs=109015=109017#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36108

Files:
  compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/trunk/cmake/builtin-config-ix.cmake
  compiler-rt/trunk/lib/builtins/CMakeLists.txt
  compiler-rt/trunk/lib/builtins/clear_cache.c


Index: compiler-rt/trunk/lib/builtins/CMakeLists.txt
===
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/trunk/lib/builtins/clear_cache.c
===
--- compiler-rt/trunk/lib/builtins/clear_cache.c
+++ compiler-rt/trunk/lib/builtins/clear_cache.c
@@ -165,7 +165,7 @@
   for (addr = xstart; addr < xend; addr += icache_line_size)
 __asm __volatile("ic ivau, %0" :: "r"(addr));
   __asm __volatile("isb sy");
-#elif defined (__powerpc64__) && defined(__LITTLE_ENDIAN__)
+#elif defined (__powerpc64__)
   const size_t line_size = 32;
   const size_t len = (uintptr_t)end - (uintptr_t)start;
 
Index: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
+  check_symbol_exists(__powerpc64__ "" __PPC64)
+  check_symbol_exists(__powerpc64le__ "" __PPC64LE)
   check_symbol_exists(__s390x__ "" __S390X)
   check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
   check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
@@ -184,6 +186,10 @@
 add_default_target_arch(mips64)
   elseif(__MIPS)
 add_default_target_arch(mips)
+  elseif(__PPC64)
+add_default_target_arch(powerpc64)
+  elseif(__PPC64LE)
+add_default_target_arch(powerpc64le)
   elseif(__S390X)
 add_default_target_arch(s390x)
   elseif(__WEBASSEMBLY32)
Index: compiler-rt/trunk/cmake/builtin-config-ix.cmake
===
--- compiler-rt/trunk/cmake/builtin-config-ix.cmake
+++ compiler-rt/trunk/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)


Index: compiler-rt/trunk/lib/builtins/CMakeLists.txt
===
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/trunk/lib/builtins/clear_cache.c
===
--- compiler-rt/trunk/lib/builtins/clear_cache.c
+++ compiler-rt/trunk/lib/builtins/clear_cache.c
@@ -165,7 +165,7 @@
   for (addr = xstart; addr < xend; addr += icache_line_size)
 __asm __volatile("ic ivau, %0" :: "r"(addr));
   __asm __volatile("isb sy");
-#elif defined (__powerpc64__) && defined(__LITTLE_ENDIAN__)
+#elif defined (__powerpc64__)
   const size_t line_size = 32;
   const size_t len = (uintptr_t)end - (uintptr_t)start;
 
Index: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
+  check_symbol_exists(__powerpc64__ "" __PPC64)
+  check_symbol_exists(__powerpc64le__ "" __PPC64LE)
   

[PATCH] D36108: Add powerpc64 to compiler-rt build infrastructure.

2017-07-31 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D36108#826673, @timshen wrote:

> Offline discussion discovered that __clear_cache() is not implemented for 
> powerpc64 (the big-endian target). I think it's correct to use the same 
> implementation of __clear_cache() for both endianness. With that change 
> (possibly in the same patch), this patch looks good.


Done. Thanks.


https://reviews.llvm.org/D36108



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36108: Add powerpc64 to compiler-rt build infrastructure.

2017-07-31 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine updated this revision to Diff 109015.
saugustine added a comment.

- The current powerpc implementation of clear cache works for big endian.


https://reviews.llvm.org/D36108

Files:
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/builtin-config-ix.cmake
  compiler-rt/lib/builtins/CMakeLists.txt
  compiler-rt/lib/builtins/clear_cache.c


Index: compiler-rt/lib/builtins/clear_cache.c
===
--- compiler-rt/lib/builtins/clear_cache.c
+++ compiler-rt/lib/builtins/clear_cache.c
@@ -165,7 +165,7 @@
   for (addr = xstart; addr < xend; addr += icache_line_size)
 __asm __volatile("ic ivau, %0" :: "r"(addr));
   __asm __volatile("isb sy");
-#elif defined (__powerpc64__) && defined(__LITTLE_ENDIAN__)
+#elif defined (__powerpc64__)
   const size_t line_size = 32;
   const size_t len = (uintptr_t)end - (uintptr_t)start;
 
Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/cmake/builtin-config-ix.cmake
===
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
+  check_symbol_exists(__powerpc64__ "" __PPC64)
+  check_symbol_exists(__powerpc64le__ "" __PPC64LE)
   check_symbol_exists(__s390x__ "" __S390X)
   check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
   check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
@@ -184,6 +186,10 @@
 add_default_target_arch(mips64)
   elseif(__MIPS)
 add_default_target_arch(mips)
+  elseif(__PPC64)
+add_default_target_arch(powerpc64)
+  elseif(__PPC64LE)
+add_default_target_arch(powerpc64le)
   elseif(__S390X)
 add_default_target_arch(s390x)
   elseif(__WEBASSEMBLY32)


Index: compiler-rt/lib/builtins/clear_cache.c
===
--- compiler-rt/lib/builtins/clear_cache.c
+++ compiler-rt/lib/builtins/clear_cache.c
@@ -165,7 +165,7 @@
   for (addr = xstart; addr < xend; addr += icache_line_size)
 __asm __volatile("ic ivau, %0" :: "r"(addr));
   __asm __volatile("isb sy");
-#elif defined (__powerpc64__) && defined(__LITTLE_ENDIAN__)
+#elif defined (__powerpc64__)
   const size_t line_size = 32;
   const size_t len = (uintptr_t)end - (uintptr_t)start;
 
Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/cmake/builtin-config-ix.cmake
===
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   

[PATCH] D36108: Add powerpc64 to compiler-rt build infrastructure.

2017-07-31 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
Herald added subscribers: aheejin, mgorny, dberris, nemanjai.

Add powerpc64 to compiler-rt build infrastructure.


https://reviews.llvm.org/D36108

Files:
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/builtin-config-ix.cmake
  compiler-rt/lib/builtins/CMakeLists.txt


Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/cmake/builtin-config-ix.cmake
===
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
+  check_symbol_exists(__powerpc64__ "" __PPC64)
+  check_symbol_exists(__powerpc64le__ "" __PPC64LE)
   check_symbol_exists(__s390x__ "" __S390X)
   check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
   check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
@@ -184,6 +186,10 @@
 add_default_target_arch(mips64)
   elseif(__MIPS)
 add_default_target_arch(mips)
+  elseif(__PPC64)
+add_default_target_arch(powerpc64)
+  elseif(__PPC64LE)
+add_default_target_arch(powerpc64le)
   elseif(__S390X)
 add_default_target_arch(s390x)
   elseif(__WEBASSEMBLY32)


Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/cmake/builtin-config-ix.cmake
===
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -167,6 +167,8 @@
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
+  check_symbol_exists(__powerpc64__ "" __PPC64)
+  check_symbol_exists(__powerpc64le__ "" __PPC64LE)
   check_symbol_exists(__s390x__ "" __S390X)
   check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
   check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
@@ -184,6 +186,10 @@
 add_default_target_arch(mips64)
   elseif(__MIPS)
 add_default_target_arch(mips)
+  elseif(__PPC64)
+add_default_target_arch(powerpc64)
+  elseif(__PPC64LE)
+add_default_target_arch(powerpc64le)
   elseif(__S390X)
 add_default_target_arch(s390x)
   elseif(__WEBASSEMBLY32)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D35959: Summary: For powerpc64, disable tests that assume long double is 80-bits.

2017-07-28 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine updated this revision to Diff 108727.
saugustine added a comment.
Herald added subscribers: aheejin, mgorny.

- Add clear_cache implementation for ppc64. Fix buffer to meet ppc64 alignment.
- Merge branch 'master' of https://github.com/llvm-project/llvm-project-20170507
- Merge branch 'master' of https://github.com/llvm-project/llvm-project-20170507
- Merge branch 'master' of https://github.com/llvm-project/llvm-project-20170507


https://reviews.llvm.org/D35959

Files:
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/base-config-ix.cmake
  compiler-rt/cmake/builtin-config-ix.cmake
  compiler-rt/lib/builtins/CMakeLists.txt
  compiler-rt/test/builtins/Unit/fixunsxfti_test.c
  compiler-rt/test/builtins/Unit/fixxfti_test.c
  compiler-rt/test/builtins/Unit/floattixf_test.c
  compiler-rt/test/builtins/Unit/floatuntixf_test.c

Index: compiler-rt/test/builtins/Unit/floatuntixf_test.c
===
--- compiler-rt/test/builtins/Unit/floatuntixf_test.c
+++ compiler-rt/test/builtins/Unit/floatuntixf_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- floatuntixf.c - Test __floatuntixf ===//
 //
Index: compiler-rt/test/builtins/Unit/floattixf_test.c
===
--- compiler-rt/test/builtins/Unit/floattixf_test.c
+++ compiler-rt/test/builtins/Unit/floattixf_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- floattixf.c - Test __floattixf ===//
 //
Index: compiler-rt/test/builtins/Unit/fixxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixxfti_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- fixxfti_test.c - Test __fixxfti ---===//
 //
Index: compiler-rt/test/builtins/Unit/fixunsxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixunsxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixunsxfti_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- fixunsxfti_test.c - Test __fixunsxfti -===//
 //
Index: compiler-rt/lib/builtins/CMakeLists.txt
===
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -458,6 +458,20 @@
 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  ${mips_SOURCES})
 
+set(powerpc64_SOURCES
+  ppc/divtc3.c
+  ppc/fixtfdi.c
+  ppc/fixunstfdi.c
+  ppc/floatditf.c
+  ppc/floatunditf.c
+  ppc/gcc_qadd.c
+  ppc/gcc_qdiv.c
+  ppc/gcc_qmul.c
+  ppc/gcc_qsub.c
+  ppc/multc3.c
+  ${GENERIC_SOURCES})
+set(powerpc64le_SOURCES ${powerpc64_SOURCES})
+
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})
 
Index: compiler-rt/cmake/builtin-config-ix.cmake
===
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -40,7 +40,7 @@
 endif()
 
 set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
-${MIPS32} ${MIPS64} ${WASM32} ${WASM64})
+${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64})
 
 include(CompilerRTUtils)
 include(CompilerRTDarwinUtils)
Index: compiler-rt/cmake/base-config-ix.cmake
===
--- compiler-rt/cmake/base-config-ix.cmake
+++ compiler-rt/cmake/base-config-ix.cmake
@@ -4,6 +4,7 @@
 # runtime libraries.
 
 include(CheckIncludeFile)
+include(TestBigEndian)
 check_include_file(unwind.h HAVE_UNWIND_H)
 
 # Top level target used to build all compiler-rt libraries.
@@ -180,6 +181,10 @@
   test_target_arch(aarch32 "" "-march=armv8-a")
 elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch64")
   test_target_arch(aarch64 "" "-march=armv8-a")
+elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc64")
+  test_target_arch(powerpc64 "" "--target=powerpc64-unknown-unknown")
+elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc64le")
+  test_target_arch(powerpc64le "" "--target=powerpc64le-unknown-unknown")
 elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "wasm32")
   test_target_arch(wasm32 "" "--target=wasm32-unknown-unknown")
 elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "wasm64")
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake

[PATCH] D35959: Summary: For powerpc64, disable tests that assume long double is 80-bits.

2017-07-27 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.
Herald added a subscriber: nemanjai.

https://reviews.llvm.org/D35959

Files:
  compiler-rt/test/builtins/Unit/fixunsxfti_test.c
  compiler-rt/test/builtins/Unit/fixxfti_test.c
  compiler-rt/test/builtins/Unit/floattixf_test.c
  compiler-rt/test/builtins/Unit/floatuntixf_test.c


Index: compiler-rt/test/builtins/Unit/floatuntixf_test.c
===
--- compiler-rt/test/builtins/Unit/floatuntixf_test.c
+++ compiler-rt/test/builtins/Unit/floatuntixf_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- floatuntixf.c - Test __floatuntixf 
===//
 //
Index: compiler-rt/test/builtins/Unit/floattixf_test.c
===
--- compiler-rt/test/builtins/Unit/floattixf_test.c
+++ compiler-rt/test/builtins/Unit/floattixf_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- floattixf.c - Test __floattixf 
===//
 //
Index: compiler-rt/test/builtins/Unit/fixxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixxfti_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- fixxfti_test.c - Test __fixxfti 
---===//
 //
Index: compiler-rt/test/builtins/Unit/fixunsxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixunsxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixunsxfti_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- fixunsxfti_test.c - Test __fixunsxfti 
-===//
 //


Index: compiler-rt/test/builtins/Unit/floatuntixf_test.c
===
--- compiler-rt/test/builtins/Unit/floatuntixf_test.c
+++ compiler-rt/test/builtins/Unit/floatuntixf_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- floatuntixf.c - Test __floatuntixf ===//
 //
Index: compiler-rt/test/builtins/Unit/floattixf_test.c
===
--- compiler-rt/test/builtins/Unit/floattixf_test.c
+++ compiler-rt/test/builtins/Unit/floattixf_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- floattixf.c - Test __floattixf ===//
 //
Index: compiler-rt/test/builtins/Unit/fixxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixxfti_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- fixxfti_test.c - Test __fixxfti ---===//
 //
Index: compiler-rt/test/builtins/Unit/fixunsxfti_test.c
===
--- compiler-rt/test/builtins/Unit/fixunsxfti_test.c
+++ compiler-rt/test/builtins/Unit/fixunsxfti_test.c
@@ -2,7 +2,7 @@
 // XFAIL: aarch64
 // test fails for aarch64 (see pr32260)
 
-// UNSUPPORTED: mips
+// UNSUPPORTED: mips, powerpc64, powerpc64le
 
 //===-- fixunsxfti_test.c - Test __fixunsxfti -===//
 //
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D35131: Prevent ClangTools from generating dependency files.D34304 created a way for ToolInvocations to conditionally generatedependency files, and updated call sites to preserve the old behav

2017-07-11 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

Manuel, What do you think?


https://reviews.llvm.org/D35131



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D35131: Prevent ClangTools from generating dependency files.D34304 created a way for ToolInvocations to conditionally generatedependency files, and updated call sites to preserve the old behav

2017-07-09 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine created this revision.

...are yet another
call-path that needs updating to preserve the old behavior.


https://reviews.llvm.org/D35131

Files:
  lib/Tooling/Tooling.cpp


Index: lib/Tooling/Tooling.cpp
===
--- lib/Tooling/Tooling.cpp
+++ lib/Tooling/Tooling.cpp
@@ -336,6 +336,7 @@
   OverlayFileSystem->pushOverlay(InMemoryFileSystem);
   appendArgumentsAdjuster(getClangStripOutputAdjuster());
   appendArgumentsAdjuster(getClangSyntaxOnlyAdjuster());
+  appendArgumentsAdjuster(getClangStripDependencyFileAdjuster());
 }
 
 ClangTool::~ClangTool() {}


Index: lib/Tooling/Tooling.cpp
===
--- lib/Tooling/Tooling.cpp
+++ lib/Tooling/Tooling.cpp
@@ -336,6 +336,7 @@
   OverlayFileSystem->pushOverlay(InMemoryFileSystem);
   appendArgumentsAdjuster(getClangStripOutputAdjuster());
   appendArgumentsAdjuster(getClangSyntaxOnlyAdjuster());
+  appendArgumentsAdjuster(getClangStripDependencyFileAdjuster());
 }
 
 ClangTool::~ClangTool() {}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34304: Allow CompilerInvocations to generate .d files.

2017-06-27 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine updated this revision to Diff 104307.
saugustine added a comment.

Rework this patch to use argument adjusters. It turns out that
the call to newInvocation from ClangFuzzer has a very limited
set of hard-coded arguments, so I don't think it is necessary
to do the hand-adjusting there. Any new callers would be on their
own.


https://reviews.llvm.org/D34304

Files:
  include/clang/Tooling/ArgumentsAdjusters.h
  include/clang/Tooling/Tooling.h
  lib/Tooling/ArgumentsAdjusters.cpp
  lib/Tooling/Tooling.cpp

Index: lib/Tooling/Tooling.cpp
===
--- lib/Tooling/Tooling.cpp
+++ lib/Tooling/Tooling.cpp
@@ -100,7 +100,6 @@
   *Diagnostics);
   Invocation->getFrontendOpts().DisableFree = false;
   Invocation->getCodeGenOpts().DisableFree = false;
-  Invocation->getDependencyOutputOpts() = DependencyOutputOptions();
   return Invocation;
 }
 
@@ -510,7 +509,8 @@
 std::unique_ptr buildASTFromCodeWithArgs(
 const Twine , const std::vector ,
 const Twine , const Twine ,
-std::shared_ptr PCHContainerOps) {
+std::shared_ptr PCHContainerOps,
+ArgumentsAdjuster Adjuster) {
   SmallString<16> FileNameStorage;
   StringRef FileNameRef = FileName.toNullTerminatedStringRef(FileNameStorage);
 
@@ -523,8 +523,10 @@
   OverlayFileSystem->pushOverlay(InMemoryFileSystem);
   llvm::IntrusiveRefCntPtr Files(
   new FileManager(FileSystemOptions(), OverlayFileSystem));
-  ToolInvocation Invocation(getSyntaxOnlyToolArgs(ToolName, Args, FileNameRef),
-, Files.get(), std::move(PCHContainerOps));
+
+  ToolInvocation Invocation(
+  getSyntaxOnlyToolArgs(ToolName, Adjuster(Args, FileNameRef), FileNameRef),
+  , Files.get(), std::move(PCHContainerOps));
 
   SmallString<1024> CodeStorage;
   InMemoryFileSystem->addFile(FileNameRef, 0,
Index: lib/Tooling/ArgumentsAdjusters.cpp
===
--- lib/Tooling/ArgumentsAdjusters.cpp
+++ lib/Tooling/ArgumentsAdjusters.cpp
@@ -51,6 +51,26 @@
   };
 }
 
+ArgumentsAdjuster getClangStripDependencyFileAdjuster() {
+  return [](const CommandLineArguments , StringRef /*unused*/) {
+CommandLineArguments AdjustedArgs;
+for (size_t i = 0, e = Args.size(); i < e; ++i) {
+  StringRef Arg = Args[i];
+  // All dependency-file options begin with -M. These include -MM,
+  // -MF, -MG, -MP, -MT, -MQ, -MD, and -MMD.
+  if (!Arg.startswith("-M"))
+AdjustedArgs.push_back(Args[i]);
+
+  if ((Arg == "-MF") || (Arg == "-MT") || (Arg == "-MQ") ||
+  (Arg == "-MD") || (Arg == "-MMD")) {
+// Output is specified as -MX foo. Skip the next argument also.
+++i;
+  }
+}
+return AdjustedArgs;
+  };
+}
+
 ArgumentsAdjuster getInsertArgumentAdjuster(const CommandLineArguments ,
 ArgumentInsertPosition Pos) {
   return [Extra, Pos](const CommandLineArguments , StringRef /*unused*/) {
@@ -83,4 +103,3 @@
 
 } // end namespace tooling
 } // end namespace clang
-
Index: include/clang/Tooling/Tooling.h
===
--- include/clang/Tooling/Tooling.h
+++ include/clang/Tooling/Tooling.h
@@ -202,12 +202,15 @@
 /// \param PCHContainerOps The PCHContainerOperations for loading and creating
 /// clang modules.
 ///
+/// \param Adjuster A function to filter the command line arguments as specified.
+///
 /// \return The resulting AST or null if an error occurred.
 std::unique_ptr buildASTFromCodeWithArgs(
 const Twine , const std::vector ,
 const Twine  = "input.cc", const Twine  = "clang-tool",
 std::shared_ptr PCHContainerOps =
-std::make_shared());
+  std::make_shared(),
+ArgumentsAdjuster Adjuster = getClangStripDependencyFileAdjuster());
 
 /// \brief Utility to run a FrontendAction in a single clang invocation.
 class ToolInvocation {
Index: include/clang/Tooling/ArgumentsAdjusters.h
===
--- include/clang/Tooling/ArgumentsAdjusters.h
+++ include/clang/Tooling/ArgumentsAdjusters.h
@@ -44,6 +44,10 @@
 /// arguments.
 ArgumentsAdjuster getClangStripOutputAdjuster();
 
+/// \brief Gets an argument adjuster which removes dependency-file
+/// related command line arguments.
+ArgumentsAdjuster getClangStripDependencyFileAdjuster();
+
 enum class ArgumentInsertPosition { BEGIN, END };
 
 /// \brief Gets an argument adjuster which inserts \p Extra arguments in the
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34304: Allow CompilerInvocations to generate .d files.

2017-06-22 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D34304#787699, @klimek wrote:

> I mean, arguments need to be adjusted before converting to ArgStringList and 
> calling newInvocation? I'm not sure I fully understand the problem, can you 
> elaborate?


This gets back to why the original patch plumbed the boolean all the way down 
to newInvocation.

newInvocation is the function that actually discards the dependency file 
options--today unconditionally. But there is code that calls newInvocation 
directly (ClangFuzzer is one), without going through a higher-level API. So I 
can't adjust the arguments at a higher level and still preserve the old 
behavior.

Unfortunately, newInvocation's argument list type is incompatible with 
ArgumentAdjusters, so something else will need to be done. What do you 
recommend?


https://reviews.llvm.org/D34304



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34304: Allow CompilerInvocations to generate .d files.

2017-06-21 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

> Actually, now that I figured out you mean ArgumentAdjusters, I am making 
> progress.

Unfortunately, ArgumentAdjusters only work on vector, and while 
ToolInvocation::Invocation takes its arguments in that form, 
tooling::newInvocation (which returns a CompilerInvocation) takes a 
SmallVector, so we either need to change one side's 
interface, or write two ArgumentAdjusters, but with similar semantics.

What is your preferred solution?


https://reviews.llvm.org/D34304



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34304: Allow CompilerInvocations to generate .d files.

2017-06-20 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D34304#785984, @saugustine wrote:

> In https://reviews.llvm.org/D34304#785083, @klimek wrote:
>
> > I think it's cleaner, because it uses a concept we already have (argument 
> > adapters).
>
>
> Will you point me to an example of these. Google is coming up empty.


Actually, now that I figured out you mean ArgumentAdjusters, I am making 
progress.


https://reviews.llvm.org/D34304



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34304: Allow CompilerInvocations to generate .d files.

2017-06-20 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a comment.

In https://reviews.llvm.org/D34304#785083, @klimek wrote:

> I think it's cleaner, because it uses a concept we already have (argument 
> adapters).


Will you point me to an example of these. Google is coming up empty.


https://reviews.llvm.org/D34304



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34304: Allow CompilerInvocations to generate .d files.

2017-06-19 Thread Sterling Augustine via Phabricator via cfe-commits
saugustine added a subscriber: klimek.
saugustine added a comment.

In https://reviews.llvm.org/D34304#783675, @klimek wrote:

> I think a better way might be to generally leave dependency options alone, 
> add a default argument adapter to filter out all deps related flags, and 
> allow users to add their own argument adapters that don't do that.


This argument adapter would have to be passed down in a similar way, no?

buildASTFromCodeWithArgs, toolIinvocation::Run, and newInvocation are all 
entry-points that would need this behavior, and all are called by themselves in 
one place or another.

I'm happy to do that, as it is quite a bit more flexible, but it doesn't seem 
any cleaner.


https://reviews.llvm.org/D34304



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits