Skip to content

[clang][NFC] Update isAuxBuiltinID comment #128038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2025
Merged

[clang][NFC] Update isAuxBuiltinID comment #128038

merged 2 commits into from
Feb 20, 2025

Conversation

sarnex
Copy link
Member

@sarnex sarnex commented Feb 20, 2025

Clarify behavior of the function when the builtin is also supported on the main target.
Based on feedback from #126324

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@sarnex sarnex marked this pull request as ready for review February 20, 2025 17:58
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Feb 20, 2025
@sarnex sarnex requested a review from erichkeane February 20, 2025 17:58
@llvmbot
Copy link
Member

llvmbot commented Feb 20, 2025

@llvm/pr-subscribers-clang

Author: Nick Sarnie (sarnex)

Changes

Clarify behavior of the function when the builtin is also supported on the main target.
Based on feedback from #126324


Full diff: https://github.com/llvm/llvm-project/pull/128038.diff

1 Files Affected:

  • (modified) clang/include/clang/Basic/Builtins.h (+3-1)
diff --git a/clang/include/clang/Basic/Builtins.h b/clang/include/clang/Basic/Builtins.h
index 6d29b4315e5a7..91a03c3a51da2 100644
--- a/clang/include/clang/Basic/Builtins.h
+++ b/clang/include/clang/Basic/Builtins.h
@@ -408,7 +408,9 @@ class Context {
 
   unsigned getRequiredVectorWidth(unsigned ID) const;
 
-  /// Return true if builtin ID belongs to AuxTarget.
+  /// Return true if builtin ID belongs to only the AuxTarget.
+  /// Return false if builtin ID belongs to both the primary
+  /// and auxiliary target.
   bool isAuxBuiltinID(unsigned ID) const {
     return ID >= (Builtin::FirstTSBuiltin + NumTargetBuiltins);
   }

@@ -408,7 +408,9 @@ class Context {

unsigned getRequiredVectorWidth(unsigned ID) const;

/// Return true if builtin ID belongs to AuxTarget.
/// Return true if builtin ID belongs to only the AuxTarget.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, "Return true if the builtin ID belongs exclusively to the AuxTarget, and false if it belongs to both primary and aux target, or neither."

WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, applied this in latest commit.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@sarnex sarnex merged commit cc45365 into llvm:main Feb 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants