Skip to content

[RISCV][NFC] Add isTargetAndroid API in RISCVSubtarget #87671

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

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Apr 4, 2024

This is required to set target specific code generation options for Android,
like using the TLS slot for the stack protector.

Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented Apr 4, 2024

@llvm/pr-subscribers-backend-risc-v

Author: Paul Kirth (ilovepi)

Changes

This is required to set target specific code generation options for Android,
like using the TLS slot for the stack protector.


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

1 Files Affected:

  • (modified) llvm/lib/Target/RISCV/RISCVSubtarget.h (+1)
diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index ba108912d93400..85f8f5f654fe7c 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -254,6 +254,7 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
   const LegalizerInfo *getLegalizerInfo() const override;
   const RegisterBankInfo *getRegBankInfo() const override;
 
+  bool isTargetAndroid() const { return getTargetTriple().isAndroid(); }
   bool isTargetFuchsia() const { return getTargetTriple().isOSFuchsia(); }
 
   bool useConstantPoolForLargeInts() const;

Copy link
Collaborator

@topperc topperc left a comment

Choose a reason for hiding this comment

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

LGTM

@ilovepi ilovepi merged commit bffc0b6 into main Apr 4, 2024
@ilovepi ilovepi deleted the users/ilovepi/spr/riscvnfc-add-istargetandroid-api-in-riscvsubtarget branch April 4, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants