[PATCH] D53475: Create ConstantExpr class

2018-10-20 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: rsmith. void added a project: clang. Herald added a subscriber: cfe-commits. A ConstantExpr class represents a full expression that's in a context where a constant expression is required. This class reflects the path the evaluator took to reach th

[PATCH] D53475: Create ConstantExpr class

2018-10-20 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 170321. Repository: rC Clang https://reviews.llvm.org/D53475 Files: include/clang/AST/Expr.h include/clang/AST/RecursiveASTVisitor.h include/clang/AST/StmtDataCollectors.td include/clang/Basic/StmtNodes.td include/clang/Serialization/ASTBitCodes.h

[PATCH] D53475: Create ConstantExpr class

2018-10-20 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 170324. void marked an inline comment as done. void added a comment. Create a "FullExpression" parent class and skip full expressions in all places we skip with ExprWithCleanups. Repository: rC Clang https://reviews.llvm.org/D53475 Files: include/clang/A

[PATCH] D53475: Create ConstantExpr class

2018-10-20 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 170325. Repository: rC Clang https://reviews.llvm.org/D53475 Files: include/clang/AST/Expr.h include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/AST/StmtDataCollectors.td include/clang/Basic/StmtNodes.td include/clang

[PATCH] D53475: Create ConstantExpr class

2018-10-28 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 171417. void marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D53475 Files: include/clang/AST/Expr.h include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/AST/StmtDataCollectors.td include/c

[PATCH] D53475: Create ConstantExpr class

2018-10-28 Thread Bill Wendling via Phabricator via cfe-commits
void marked 6 inline comments as done. void added inline comments. Comment at: lib/AST/StmtProfile.cpp:1001 + VisitExpr(S); + VisitExpr(S->getSubExpr()); +} rsmith wrote: > This is unnecessary: this visitor visits the children of the node for you. If I don't ha

[PATCH] D53475: Create ConstantExpr class

2018-10-30 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Ping? Repository: rC Clang https://reviews.llvm.org/D53475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53475: Create ConstantExpr class

2018-10-30 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Thanks, Richard! :-) Repository: rC Clang https://reviews.llvm.org/D53475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53475: Create ConstantExpr class

2018-10-30 Thread Bill Wendling via Phabricator via cfe-commits
void closed this revision. void marked 2 inline comments as done. void added inline comments. Comment at: include/clang/AST/Expr.h:898 +class ConstantExpr : public FullExpr { + Stmt *Val; +public: rsmith wrote: > I think it'd be cleaner and simpler to move this

[PATCH] D53475: Create ConstantExpr class

2018-10-30 Thread Bill Wendling via Phabricator via cfe-commits
void marked 4 inline comments as done. void added a comment. That change was intentional. But I guess it's causing issues. I'll change it to a `class`. Repository: rC Clang https://reviews.llvm.org/D53475 ___ cfe-commits mailing list cfe-commits

[PATCH] D53475: Create ConstantExpr class

2018-10-30 Thread Bill Wendling via Phabricator via cfe-commits
void added a subscriber: rsmith. void added a comment. I didn't see that during my tests. Probably different -W flags or something. I reverted that bit. I hope it fixes the problem. -bw Repository: rC Clang https://reviews.llvm.org/D53475 ___ cf

[PATCH] D53921: Compound literals and enums require constant inits

2018-10-31 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: rsmith. Herald added a subscriber: cfe-commits. Both compound literals and enums require their initializers to be constant. Wrap the initializer expressions in a ConstantExpr so that we can easily check for this later on. Repository: rC Clang

[PATCH] D55616: Emit ASM input in a constant context

2019-01-11 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. > Apologies - the value seems to indeed overflow, but I'm still very confused > how this was affected by this change. What's different is that `setRequiresImmediate` is being set on the constraint where before it wasn't. If no range values are supplied (like in this patch)

[PATCH] D57114: Remove Expr sugar decorating the CXXUuidofExpr node.

2019-01-23 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: rsmith. Herald added a subscriber: cfe-commits. Sugar, like ConstantExpr, causes an infinite expansion of the template object. Repository: rC Clang https://reviews.llvm.org/D57114 Files: lib/Sema/SemaTemplate.cpp test/CodeGenCXX/pr40395.

[PATCH] D57114: Remove Expr sugar decorating the CXXUuidofExpr node.

2019-01-23 Thread Bill Wendling via Phabricator via cfe-commits
void marked 2 inline comments as done. void added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:6311 if (isa(E)) { - Converted = TemplateArgument(ArgResult.get()); + Converted = TemplateArgument(ArgResult.get()->IgnoreImpCasts()); br

[PATCH] D57114: Remove Expr sugar decorating the CXXUuidofExpr node.

2019-01-23 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 183180. void added a comment. Move test to proper place and add "-verify" flag. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57114/new/ https://reviews.llvm.org/D57114 Files: lib/Sema/SemaTemplate.cpp test/SemaCXX/PR40395.

[PATCH] D57114: Remove Expr sugar decorating the CXXUuidofExpr node.

2019-01-26 Thread Bill Wendling via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC352307: Remove Expr sugar decorating the CXXUuidofExpr node. (authored by void, committed by ). Changed prior to commit: https://reviews.llvm.org/D57114?vs=183180&id=183750#toc Repository: rC Clang

[PATCH] D57427: [CodeGen][ObjC] Fix assert on calling `__builtin_constant_p` with ObjC objects.

2019-01-29 Thread Bill Wendling via Phabricator via cfe-commits
void accepted this revision. void added a comment. This revision is now accepted and ready to land. LGTM, but may want to wait for other reviewers. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57427/new/ https://reviews.llvm.org/D57427 ___

[PATCH] D53921: Compound literals, global array decls, and enums require constant inits

2018-10-31 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 171976. void retitled this revision from "Compound literals and enums require constant inits" to "Compound literals, global array decls, and enums require constant inits". void edited the summary of this revision. Repository: rC Clang https://reviews.llvm.or

[PATCH] D53921: Compound literals, global array decls, and enums require constant inits

2018-10-31 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments. Comment at: lib/Sema/SemaDecl.cpp:16411 // this constant. Skip this enum since it may be ill-formed. -if (!ECD) { - return; -} +if (!ECD) return; nickdesaulniers wrote: > probably don't need to adjust this line

[PATCH] D53921: Compound literals, global array decls, and enums require constant inits

2018-10-31 Thread Bill Wendling via Phabricator via cfe-commits
void marked 3 inline comments as done. void added inline comments. Herald added a reviewer: shafik. Comment at: lib/Sema/SemaDecl.cpp:16086-16094 CheckConvertedConstantExpression(Val, EltTy, EnumVal, CCEK_Enumerator);

[PATCH] D53921: Compound literals, global array decls, and enums require constant inits

2018-10-31 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 172082. Repository: rC Clang https://reviews.llvm.org/D53921 Files: include/clang/AST/Expr.h include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/AST/StmtDataCollectors.td include/clang/Basic/StmtNodes.td include/clang

[PATCH] D53921: Compound literals, global array decls, and enums require constant inits

2018-11-01 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 172194. Repository: rC Clang https://reviews.llvm.org/D53921 Files: lib/ARCMigrate/ObjCMT.cpp lib/AST/ASTImporter.cpp lib/AST/ExprConstant.cpp lib/Analysis/CFG.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGExprComplex.cpp

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-01 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 172279. void retitled this revision from "Compound literals, global array decls, and enums require constant inits" to "Compound literals, enums, et al require const expr". void edited the summary of this revision. void added a comment. I believe this patch shou

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-01 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 172297. Repository: rC Clang https://reviews.llvm.org/D53921 Files: include/clang/AST/Expr.h include/clang/ASTMatchers/ASTMatchers.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/ASTMatchers/ASTMatchersInternal.cpp lib/AS

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-02 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 172313. Repository: rC Clang https://reviews.llvm.org/D53921 Files: include/clang/AST/Expr.h include/clang/ASTMatchers/ASTMatchers.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/ASTMatchers/ASTMatchersInternal.cpp lib/AS

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-08 Thread Bill Wendling via Phabricator via cfe-commits
void marked 2 inline comments as done. void added inline comments. Comment at: include/clang/AST/Expr.h:3073-3074 + e = ice->getSubExpr(); +else if (ConstantExpr *ce = dyn_cast(e)) + e = ce->getSubExpr(); +else rsmith wrote: > Should we skip an

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-08 Thread Bill Wendling via Phabricator via cfe-commits
void marked an inline comment as done. void added a comment. I'm using "arcanist" for the first time, and I don't want to mess things up. I'll address the comments here in the next patch. Repository: rC Clang https://reviews.llvm.org/D53921 ___

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-08 Thread Bill Wendling via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC346455: Compound literals, enums, et al require const expr (authored by void, committed by ). Changed prior to commit: https://reviews.llvm.org/D53921?vs=172313&id=173248#toc Repository: rC Clang ht

[PATCH] D53921: Compound literals, enums, et al require const expr

2018-11-08 Thread Bill Wendling via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346455: Compound literals, enums, et al require const expr (authored by void, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D53921?vs=172313&

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-09 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: rsmith. Herald added subscribers: cfe-commits, kristina. Herald added a reviewer: shafik. A __builtin_constant_p may end up with a constant after inlining. Use the is.constant intrinsic if it's a variable that's in a context where it may resolve t

[PATCH] D54356: Convert CheckICE into a statment visitor

2018-11-09 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added reviewers: rsmith, shafik. Herald added a subscriber: jfb. This cleans up the code somewhat and allows us conditionally to act on different types of nodes depending on their context. E.g., if we're checking for an ICE in a constant context. Repository: rC

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-09 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 173445. void added a comment. Herald added a subscriber: jfb. Adding ConstantExpr visitor. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/C

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-09 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This has https://reviews.llvm.org/D54356 integrated into it. https://reviews.llvm.org/D54356 should be reviewed and submitted first, even though it's out of order. Repository: rC Clang https://reviews.llvm.org/D54355 ___ c

[PATCH] D54356: Convert CheckICE into a statment visitor

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Ping? Repository: rC Clang https://reviews.llvm.org/D54356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Ping? Repository: rC Clang https://reviews.llvm.org/D54355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54356: Convert CheckICE into a statment visitor

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This code is called in over 90 places, so it's hard to tell if they all are in a constant context. Though I suppose that what this code is supposed to check for would work the same in a constant context as without one. I can revert this if you want, but to be honest the or

[PATCH] D54356: Convert CheckICE into a statment visitor

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Okay. I'll revert this then. Repository: rC Clang https://reviews.llvm.org/D54356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54356: Convert CheckICE into a statment visitor

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void abandoned this revision. void added a comment. This isn't necessary. We can assume it's in a constant context because it's checking for an ICE. Repository: rC Clang https://reviews.llvm.org/D54356 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D54356: Convert CheckICE into a statment visitor

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In https://reviews.llvm.org/D54356#1297543, @rsmith wrote: > In https://reviews.llvm.org/D54356#1297522, @void wrote: > > > Okay. I'll revert this then. > > > I don't think we necessarily need the change in the other patch that's based > on this one, but I still think this

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 173922. void marked an inline comment as done. void added a comment. Remove some extraneous checks. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cp

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments. Comment at: include/clang/AST/Expr.h:908-912 + static ConstantExpr *Create(const ASTContext &Context, Expr *E) { +if (ConstantExpr *CE = dyn_cast(E)) + return CE; +return new (Context) ConstantExpr(E); + } rsmith wrote:

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void marked an inline comment as not done. void added inline comments. Comment at: lib/AST/Expr.cpp:2915-2916 + case ConstantExprClass: { +const Expr *Exp = cast(this)->getSubExpr(); +return Exp->isConstantInitializer(Ctx, false, Culprit); + } void wrot

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 173970. void marked an inline comment as not done. void added a comment. Updated to address comments. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. I think this is ready now. PTAL. Comment at: lib/CodeGen/CGBuiltin.cpp:1930-1931 +if (CGM.getCodeGenOpts().OptimizationLevel == 0) + // At -O0, we don't perform inlining, so we don't need to delay the + // processing. + return RValue::ge

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 173974. void added a comment. Fix overflow flag. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaDeclCX

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-13 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 173986. void added a comment. ImpCast. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaDeclCXX.cpp li

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-15 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Ping? :-) Repository: rC Clang https://reviews.llvm.org/D54355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-18 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Ping? I really don't want this review to go on forever. Repository: rC Clang https://reviews.llvm.org/D54355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-18 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 174529. void added a comment. Don't re-wrap a ConstExpr. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/Se

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-18 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 174551. void added a comment. No function pointers Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaDecl

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-19 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 174692. void added a comment. Remove ODR violation. Repository: rC Clang https://reviews.llvm.org/D54355 Files: include/clang/AST/Expr.h lib/AST/ASTImporter.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaDec

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-19 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Should be okay now. PTAL. :-) Repository: rC Clang https://reviews.llvm.org/D54355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-20 Thread Bill Wendling 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 rC347294: Use is.constant intrinsic for __builtin_constant_p (authored by void, committed by ). Changed prior to commit:

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-25 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Doh! I'll take a look at it. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54355/new/ https://reviews.llvm.org/D54355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.or

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-11-25 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Fixed in r347531. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54355/new/ https://reviews.llvm.org/D54355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-12-10 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D54355#1326494 , @craig.topper wrote: > I'm seeing a case where an inline assembly 'n' constraint is behaving > differently in -O0 now. Previously we would evaluate the __builtin_constant_p > as part of the EvaluateAsInt call in

[PATCH] D58821: Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)

2019-03-01 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. My opinion doesn't carry as much weight as others who are more familiar with the front-end code, but LGTM. One question, the code you added looks similar. Is there a way to extrapolate it into its own function? Maybe yet another `EvaluateAs*` method? Co

[PATCH] D56571: [RFC prototype] Implementation of asm-goto support in clang

2019-04-15 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. ; ModuleID = 'arch_static_branch.bc' source_filename = "arch/x86/entry/vsyscall/vsyscall_64.c" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-grtev4-linux-gnu" %struct.atomic_t = type { i32 } %struct.jump_entry = type { i6

[PATCH] D56571: [RFC prototype] Implementation of asm-goto support in clang

2019-04-15 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D56571#1467358 , @craig.topper wrote: > I think things don't work right unless you disable the integrated assembler. > I'm not sure why though. Using `-no-integrated-as` does allow it to compile, but it doesn't link (with ld.l

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-21 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. An inline asm call may result in an immediate input value after inlining. Therefore, don't emit a diagnostic here if the input isn't an immediate. Repository: rC Clang https://reviews.llvm.org/D

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-21 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 195992. void added a comment. Put constraint string check in the correct place. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 Files: lib/CodeGen/CGStmt.cpp lib/Sema/SemaStmtAsm.cpp

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-21 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 195994. void added a comment. Herald added a subscriber: eraman. Fix test. Use "e" instead of "n". Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 Files: lib/CodeGen/CGStmt.cpp lib/S

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-21 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This relies upon D60943 . Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-22 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D60943#1474091 , @joerg wrote: > I'm in the process of testing this, but feedback will take a bit. > > On the more meaty parts of this change, I think further iterations will be > necessary in-tree to extend this to the other cons

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-22 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Here's the motivating bug report: https://bugs.llvm.org/show_bug.cgi?id=41027 In general, I agree with you that diagnostics shouldn't depend on optimization levels, but inline assembly subverts this paradigm because it was originally a gcc extension. :-( That said, I don't

[PATCH] D60943: Delay diagnosing "n" constraint until after inlining

2019-04-22 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D60943#1474926 , @rsmith wrote: > In D60943#1474899 , @void wrote: > > > Here's the motivating bug report: > > https://bugs.llvm.org/show_bug.cgi?id=41027 > > > Thanks, that's illuminating.

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-03 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added reviewers: jyknight, eli.friedman, resistor, janusz. Herald added subscribers: cfe-commits, kristina. A __builtin_constant_p may end up with a constant after inlining. Use the is.constant intrinsic if we're unable to determine if it's a constant. See: https:

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-03 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This is related to https://reviews.llvm.org/D4276, which I believe has been deleted. However, I believe that a modified version of that patch will work. The idea of this patch is *not* to be fully compatible with gcc's implementation, but to expand clang's implementation o

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-04 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 168356. void added a comment. Removed unused field. https://reviews.llvm.org/D52854 Files: include/clang/AST/Expr.h include/clang/Sema/Sema.h lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaT

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-04 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments. Comment at: lib/Sema/SemaExpr.cpp:15621-15623 +for (InitListExpr::iterator II = E->begin(), IE = E->end(); + II != IE; ++II) + Visit(*II); nickdesaulniers wrote: > nickdesaulniers wrote: > > `std::for_each`

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-04 Thread Bill Wendling via Phabricator via cfe-commits
void marked 9 inline comments as done. void added a comment. In https://reviews.llvm.org/D52854#1255755, @rsmith wrote: > Essentially, you would add a `ConstExpr` node (or similar), teach > `IgnoreImplicit` and friends to step over it I've been trying to do this to no avail. Here's the code I

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-04 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 168395. void marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D52854 Files: include/clang/AST/Expr.h include/clang/Sema/Sema.h lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaExpr.cpp

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-07 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. @rsmith I've been implementing your suggestion, but it's quickly becoming ridiculous. Just to implement a `ConstExpr` wrapper class, I need to touch ~23 files, virtually all changes being boilerplate code to forward the action to the wrapped expression. And this is before

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-08 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. No, I understood that. But the issue is that you then need to specify this new expression class in over 23 different files: various macros, switch statements, etc. Repository: rC Clang https://reviews.llvm.org/D52854 ___ c

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-08 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Here's a WIP patch to show what I'm talking about.F7375980: example.diff Repository: rC Clang https://reviews.llvm.org/D52854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-08 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 168708. void added a comment. I updated the patch that implements putting the "can delay evaluation" bit into the CallExprBitfields. PTAL. Repository: rC Clang https://reviews.llvm.org/D52854 Files: include/clang/AST/Expr.h include/clang/AST/Stmt.h i

[PATCH] D52854: Use is.constant intrinsic for __builtin_constant_p

2018-10-08 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 168712. Repository: rC Clang https://reviews.llvm.org/D52854 Files: include/clang/AST/Expr.h include/clang/AST/Stmt.h include/clang/Sema/Sema.h lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Parse/ParseDecl.cpp lib/Par

[PATCH] D57267: [AST] Factor out the logic of the various Expr::Ignore*

2019-02-08 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D57267#1390484 , @riccibruno wrote: > @void @rnk Perhaps you can comment on this: currently `Expr::IgnoreImpCasts` > skips `FullExpr`s, but `Expr::IgnoreParenImpCasts` only skips (via > `IgnoreParens`) `ConstantExpr`s. Is there a

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-07-26 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. That was intentional. We want to do this for more than just the `n` constraint. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 ___ cfe-commits mailing l

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-07-27 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 212072. void added a comment. Save checking of immediates until code generation. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 Files: lib/CodeGen/CGStmt.cpp lib/Sema/SemaStmtAsm.cp

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-07-27 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 212079. void added a comment. Don't emit errors here. Wait until codegen. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 Files: lib/CodeGen/CGStmt.cpp lib/Sema/SemaStmtAsm.cpp tes

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-07-28 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 212085. void added a comment. Herald added subscribers: s.egerton, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, asb. Move a few more tests around. Some go to the L

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-07-31 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Friendly ping. :-) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-08-05 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D60943#1612083 , @joerg wrote: > The combination of D60942 , D06943 and > D65280 solves the problems for me on all > targets I have. Excellent! I submitted D609

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-08-07 Thread Bill Wendling 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 rL368104: Delay diagnosing asm constraints that require immediates until after inlining (authored by void, committed by ). H

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-08-07 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D60943#1619579 , @JamesNagurne wrote: > In case you haven't seen, this commit breaks non-x86 build bots due to the > combination of '-triple x86_64*' and '-S'. Some tests that use this target > are only looking for AST dumps, an

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-06-25 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This should be ready for review now. PTAL. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-06-25 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 206587. void added a comment. Modify so that no diagnistics are emitted until we can determine if it's an immediate or not. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 Files: lib/C

[PATCH] D60943: Delay diagnosing asm constraints that require immediates until after inlining

2019-07-09 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Friendly ping. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60943/new/ https://reviews.llvm.org/D60943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[PATCH] D38479: Make -mgeneral-regs-only more like GCC's

2019-05-19 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D38479#1507435 , @phosek wrote: > We (Fuchsia) would like to see this landed as well so we can start using this > in our kernel. I get the feeling that this patch has been abandoned by the author. Would someone like to resurrec

[PATCH] D38479: Make -mgeneral-regs-only more like GCC's

2019-05-22 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments. Comment at: clang/include/clang/Basic/LangOptions.def:143 LANGOPT(RelaxedTemplateTemplateArgs, 1, 0, "C++17 relaxed matching of template template arguments") +LANGOPT(GeneralOpsOnly, 1, 0, "Whether to diagnose the use of floating-point or vector

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. The issue is that "`n`" is expecting an immediate value, but the result of the ternary operator isn't calculated by the front-end, because it doesn't "know" that the evaluation of `__builtin_constant_p` shouldn't be delayed (it being compiled at `-O0`). I suspect that this

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. As a side note, the number of ways to evaluate a constant expression are legion in clang. They should really be unified... Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 _

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: rsmith. Herald added a subscriber: cfe-commits. void added subscribers: jyknight, craig.topper. void added a comment. As a side note, the number of ways to evaluate a constant expression are legion in clang. They should really be unified... Som

[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D54355#1328786 , @jyknight wrote: > In D54355#1328557 , @void wrote: > > > The issue is that "`n`" is expecting an immediate value, but the result of > > the ternary operator isn't calculat

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 177936. void marked an inline comment as done. void added a comment. Don't look at the optimization level here. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 Files: include/clang/AST

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Addressed Eli's comment. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

[PATCH] D55616: Emit ASM input in a constant context

2018-12-13 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 178158. void added a comment. The `n` constriant *requires* a known integer. Therefore, enforce this in both Sema and CodeGen by setting the "requires immediate" flag and evaluating to a known integer instead of random "int".. This doesn't so much address `i`, w

[PATCH] D55616: Emit ASM input in a constant context

2018-12-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D55616#1329301 , @jyknight wrote: > This seems like a good start, but not complete. > > "n" and "i" both should require that their argument is a constant expression. > For "n", it actually must be an immediate constant integer, so

  1   2   3   4   5   6   >